* Performance test function to measure enqueue & dequeue performance. * */
| 875 | * |
| 876 | */ |
| 877 | static 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); |
| 920 | out: |
| 921 | return result; |
| 922 | } |
| 923 | |
| 924 | /** |
| 925 | * define the functional tests to be executed fast |
nothing calls this directly
no test coverage detected