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

Function create_mbuf_pool

dpdk/app/test-bbdev/test_bbdev_perf.c:508–528  ·  view source on GitHub ↗

allocates mbuf mempool for inputs and outputs */

Source from the content-addressed store, hash-verified

506
507/* allocates mbuf mempool for inputs and outputs */
508static struct rte_mempool *
509create_mbuf_pool(struct op_data_entries *entries, uint8_t dev_id,
510 int socket_id, unsigned int mbuf_pool_size,
511 const char *op_type_str)
512{
513 unsigned int i;
514 uint32_t max_seg_sz = 0;
515 char pool_name[RTE_MEMPOOL_NAMESIZE];
516
517 /* find max input segment size */
518 for (i = 0; i < entries->nb_segments; ++i)
519 if (entries->segments[i].length > max_seg_sz)
520 max_seg_sz = entries->segments[i].length;
521
522 snprintf(pool_name, sizeof(pool_name), "%s_pool_%u", op_type_str,
523 dev_id);
524 return rte_pktmbuf_pool_create(pool_name, mbuf_pool_size, 0, 0,
525 RTE_MAX(max_seg_sz + RTE_PKTMBUF_HEADROOM
526 + FILLER_HEADROOM,
527 (unsigned int)RTE_MBUF_DEFAULT_BUF_SIZE), socket_id);
528}
529
530static int
531create_mempools(struct active_device *ad, int socket_id,

Callers 1

create_mempoolsFunction · 0.85

Calls 2

snprintfFunction · 0.85
rte_pktmbuf_pool_createFunction · 0.85

Tested by

no test coverage detected