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

Function run_thash_test

dpdk/app/test/test_thash_perf.c:87–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static void
88run_thash_test(unsigned int tuple_len)
89{
90 uint32_t *tuples[BATCH_SZ];
91 unsigned int i, j;
92 uint32_t len = RTE_ALIGN_CEIL(tuple_len, sizeof(uint32_t));
93 uint64_t tsc_diff;
94
95 for (i = 0; i < BATCH_SZ; i++) {
96 tuples[i] = rte_zmalloc(NULL, len, 0);
97 for (j = 0; j < len / sizeof(uint32_t); j++)
98 tuples[i][j] = rte_rand();
99 }
100
101 tsc_diff = run_rss_calc(tuples, TEST_SOFTRSS, len, default_rss_key);
102 printf("Average rte_softrss() takes \t\t%.1f cycles for key len %d\n",
103 (double)(tsc_diff) / (double)(ITERATIONS * BATCH_SZ), len);
104
105 tsc_diff = run_rss_calc(tuples, TEST_SOFTRSS_BE, len,
106 default_rss_key);
107 printf("Average rte_softrss_be() takes \t\t%.1f cycles for key len %d\n",
108 (double)(tsc_diff) / (double)(ITERATIONS * BATCH_SZ), len);
109
110 if (!rte_thash_gfni_supported())
111 return;
112
113 uint64_t rss_key_matrixes[RTE_DIM(default_rss_key)];
114
115 rte_thash_complete_matrix(rss_key_matrixes, default_rss_key,
116 RTE_DIM(default_rss_key));
117
118 tsc_diff = run_rss_calc(tuples, TEST_RSS_GFNI, len, rss_key_matrixes);
119 printf("Average rte_thash_gfni takes \t\t%.1f cycles for key len %d\n",
120 (double)(tsc_diff) / (double)(ITERATIONS * BATCH_SZ), len);
121
122 tsc_diff = run_rss_calc_bulk(tuples, len, rss_key_matrixes);
123 printf("Average rte_thash_gfni_bulk takes \t%.1f cycles for key len %d\n",
124 (double)(tsc_diff) / (double)(ITERATIONS * BATCH_SZ), len);
125}
126
127static int
128test_thash_perf(void)

Callers 1

test_thash_perfFunction · 0.85

Calls 7

rte_zmallocFunction · 0.85
rte_randFunction · 0.85
run_rss_calcFunction · 0.85
rte_thash_gfni_supportedFunction · 0.85
run_rss_calc_bulkFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected