* enqueue/dequeue packets * aka * rte_sched_port_enqueue(port, in_mbufs, 10); * rte_sched_port_dequeue(port, out_mbufs, 10); */
| 719 | * rte_sched_port_dequeue(port, out_mbufs, 10); |
| 720 | */ |
| 721 | static void enqueue_dequeue_perf(struct rte_pie_config *pie_cfg, |
| 722 | struct rte_pie *pie_in, |
| 723 | struct rte_pie *pie_out, |
| 724 | uint32_t *qlen, |
| 725 | uint32_t num_ops, |
| 726 | uint32_t *enqueued, |
| 727 | uint32_t *dropped, |
| 728 | uint32_t *dequeued, |
| 729 | struct rdtsc_prof *prof) |
| 730 | { |
| 731 | uint32_t i = 0; |
| 732 | |
| 733 | if (pie_cfg == NULL) { |
| 734 | printf("%s: Error: PIE configuration cannot be empty.\n", __func__); |
| 735 | return; |
| 736 | } |
| 737 | |
| 738 | if (pie_in == NULL) { |
| 739 | printf("%s: Error: PIE enqueue data cannot be empty.\n", __func__); |
| 740 | return; |
| 741 | } |
| 742 | |
| 743 | for (i = 0; i < num_ops; i++) { |
| 744 | uint64_t ts = 0; |
| 745 | int ret = 0; |
| 746 | |
| 747 | /** |
| 748 | * enqueue |
| 749 | */ |
| 750 | ts = get_port_ts(); |
| 751 | rdtsc_prof_start(prof); |
| 752 | ret = rte_pie_enqueue(pie_cfg, pie_in, *qlen, |
| 753 | 1000*sizeof(uint32_t), ts); |
| 754 | rdtsc_prof_end(prof); |
| 755 | |
| 756 | if (ret == 0) |
| 757 | (*enqueued)++; |
| 758 | else |
| 759 | (*dropped)++; |
| 760 | |
| 761 | if (pie_out != NULL) { |
| 762 | ts = get_port_ts(); |
| 763 | rdtsc_prof_start(prof); |
| 764 | rte_pie_dequeue(pie_out, 1000*sizeof(uint32_t), ts); |
| 765 | rdtsc_prof_end(prof); |
| 766 | |
| 767 | (*dequeued)++; |
| 768 | } |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | /** |
| 773 | * Setup test structures for tests P1 |
no test coverage detected