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

Function perf_test

dpdk/app/test/test_pie.c:800–844  ·  view source on GitHub ↗

* Performance test function to measure enqueue performance. * */

Source from the content-addressed store, hash-verified

798 *
799 */
800static enum test_result perf_test(struct test_config *tcfg)
801{
802 enum test_result result = PASS;
803 struct rdtsc_prof prof = {0, 0, 0, 0, 0.0, NULL};
804 uint32_t total = 0;
805
806 printf("%s", tcfg->msg);
807
808 rdtsc_prof_init(&prof, "enqueue");
809
810 if (test_rte_pie_init(tcfg) != PASS) {
811 result = FAIL;
812 goto out;
813 }
814
815 /**
816 * initialize the rte_pie run time data structure
817 */
818 rte_pie_rt_data_init(tcfg->tqueue->pdata_in);
819 rte_pie_set_active(NULL, tcfg->tqueue->pdata_in, 1);
820 *tcfg->tvar->enqueued = 0;
821 *tcfg->tvar->dropped = 0;
822
823 enqueue_dequeue_perf(tcfg->tconfig->pconfig,
824 tcfg->tqueue->pdata_in,
825 NULL,
826 tcfg->tqueue->qlen,
827 tcfg->tvar->num_ops,
828 tcfg->tvar->enqueued,
829 tcfg->tvar->dropped,
830 tcfg->tvar->dequeued,
831 &prof);
832
833 total = *tcfg->tvar->enqueued + *tcfg->tvar->dropped;
834
835 printf("\ntotal: %u, enqueued: %u (%.2lf%%), dropped: %u (%.2lf%%)\n",
836 total, *tcfg->tvar->enqueued,
837 ((double)(*tcfg->tvar->enqueued) / (double)total) * 100.0,
838 *tcfg->tvar->dropped,
839 ((double)(*tcfg->tvar->dropped) / (double)total) * 100.0);
840
841 rdtsc_prof_print(&prof);
842out:
843 return result;
844}
845
846
847

Callers

nothing calls this directly

Calls 7

test_rte_pie_initFunction · 0.85
rte_pie_rt_data_initFunction · 0.85
rte_pie_set_activeFunction · 0.85
rdtsc_prof_initFunction · 0.70
enqueue_dequeue_perfFunction · 0.70
rdtsc_prof_printFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected