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

Function perf_test2

dpdk/app/test/test_pie.c:877–922  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

875 *
876 */
877static enum test_result perf_test2(struct test_config *tcfg)
878{
879 enum test_result result = PASS;
880 struct rdtsc_prof prof = {0, 0, 0, 0, 0.0, NULL};
881 uint32_t total = 0;
882
883 printf("%s", tcfg->msg);
884
885 rdtsc_prof_init(&prof, "enqueue");
886
887 if (test_rte_pie_init(tcfg) != PASS) {
888 result = FAIL;
889 goto out;
890 }
891
892 /**
893 * initialize the rte_pie run time data structure
894 */
895 rte_pie_rt_data_init(tcfg->tqueue->pdata_in);
896 rte_pie_set_active(NULL, tcfg->tqueue->pdata_in, 1);
897 *tcfg->tvar->enqueued = 0;
898 *tcfg->tvar->dequeued = 0;
899 *tcfg->tvar->dropped = 0;
900
901 enqueue_dequeue_perf(tcfg->tconfig->pconfig,
902 tcfg->tqueue->pdata_in,
903 tcfg->tqueue->pdata_out,
904 tcfg->tqueue->qlen,
905 tcfg->tvar->num_ops,
906 tcfg->tvar->enqueued,
907 tcfg->tvar->dropped,
908 tcfg->tvar->dequeued,
909 &prof);
910
911 total = *tcfg->tvar->enqueued + *tcfg->tvar->dropped;
912
913 printf("\ntotal: %u, dequeued: %u (%.2lf%%), dropped: %u (%.2lf%%)\n",
914 total, *tcfg->tvar->dequeued,
915 ((double)(*tcfg->tvar->dequeued) / (double)total) * 100.0,
916 *tcfg->tvar->dropped,
917 ((double)(*tcfg->tvar->dropped) / (double)total) * 100.0);
918
919 rdtsc_prof_print(&prof);
920out:
921 return result;
922}
923
924/**
925 * define the functional tests to be executed fast

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