MCPcopy Create free account
hub / github.com/F-Stack/f-stack / enqueue_dequeue_perf

Function enqueue_dequeue_perf

dpdk/app/test/test_pie.c:721–770  ·  view source on GitHub ↗

* enqueue/dequeue packets * aka * rte_sched_port_enqueue(port, in_mbufs, 10); * rte_sched_port_dequeue(port, out_mbufs, 10); */

Source from the content-addressed store, hash-verified

719 * rte_sched_port_dequeue(port, out_mbufs, 10);
720 */
721static 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

Callers 2

perf_testFunction · 0.70
perf_test2Function · 0.70

Calls 6

rte_pie_enqueueFunction · 0.85
rte_pie_dequeueFunction · 0.85
get_port_tsFunction · 0.70
rdtsc_prof_startFunction · 0.70
rdtsc_prof_endFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected