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

Function init_mbufpool

dpdk/app/test/test_pmd_perf.c:232–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static int
233init_mbufpool(unsigned nb_mbuf)
234{
235 int socketid;
236 unsigned lcore_id;
237 char s[64];
238
239 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
240 if (rte_lcore_is_enabled(lcore_id) == 0)
241 continue;
242
243 socketid = rte_lcore_to_socket_id(lcore_id);
244 if (socketid >= NB_SOCKETS) {
245 rte_exit(EXIT_FAILURE,
246 "Socket %d of lcore %u is out of range %d\n",
247 socketid, lcore_id, NB_SOCKETS);
248 }
249 if (mbufpool[socketid] == NULL) {
250 snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
251 mbufpool[socketid] =
252 rte_pktmbuf_pool_create(s, nb_mbuf,
253 MEMPOOL_CACHE_SIZE, 0,
254 RTE_MBUF_DEFAULT_BUF_SIZE, socketid);
255 if (mbufpool[socketid] == NULL)
256 rte_exit(EXIT_FAILURE,
257 "Cannot init mbuf pool on socket %d\n",
258 socketid);
259 else
260 printf("Allocated mbuf pool on socket %d\n",
261 socketid);
262 }
263 }
264 return 0;
265}
266
267static uint16_t
268alloc_lcore(int socketid)

Callers 1

test_pmd_perfFunction · 0.85

Calls 6

rte_lcore_is_enabledFunction · 0.85
rte_lcore_to_socket_idFunction · 0.85
rte_exitFunction · 0.85
snprintfFunction · 0.85
rte_pktmbuf_pool_createFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected