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

Function randomize_array_positions

dpdk/app/test/test_reassembly_perf.c:87–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static void
88randomize_array_positions(void **array, uint8_t sz)
89{
90 void *tmp;
91 int i, j;
92
93 if (sz == 2) {
94 tmp = array[0];
95 array[0] = array[1];
96 array[1] = tmp;
97 } else {
98 for (i = sz - 1; i > 0; i--) {
99 j = rte_rand_max(i + 1);
100 tmp = array[i];
101 array[i] = array[j];
102 array[j] = tmp;
103 }
104 }
105}
106
107static void
108reassembly_print_banner(const char *proto_str)

Calls 1

rte_rand_maxFunction · 0.85

Tested by

no test coverage detected