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

Function test_loop

dpdk/app/test/test_mempool_perf.c:123–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static __rte_always_inline int
124test_loop(struct rte_mempool *mp, struct rte_mempool_cache *cache,
125 unsigned int x_keep, unsigned int x_get_bulk, unsigned int x_put_bulk)
126{
127 void *obj_table[MAX_KEEP] __rte_cache_aligned;
128 unsigned int idx;
129 unsigned int i;
130 int ret;
131
132 for (i = 0; likely(i < (N / x_keep)); i++) {
133 /* get x_keep objects by bulk of x_get_bulk */
134 for (idx = 0; idx < x_keep; idx += x_get_bulk) {
135 ret = rte_mempool_generic_get(mp,
136 &obj_table[idx],
137 x_get_bulk,
138 cache);
139 if (unlikely(ret < 0)) {
140 rte_mempool_dump(stdout, mp);
141 return ret;
142 }
143 }
144
145 /* put the objects back by bulk of x_put_bulk */
146 for (idx = 0; idx < x_keep; idx += x_put_bulk) {
147 rte_mempool_generic_put(mp,
148 &obj_table[idx],
149 x_put_bulk,
150 cache);
151 }
152 }
153
154 return 0;
155}
156
157static int
158per_lcore_mempool_test(void *arg)

Callers 1

per_lcore_mempool_testFunction · 0.85

Calls 3

rte_mempool_generic_getFunction · 0.85
rte_mempool_dumpFunction · 0.85
rte_mempool_generic_putFunction · 0.85

Tested by

no test coverage detected