* Initialise the mbuf pool for packet reception for the NIC, and any other * buffer pools needed by the app - currently none. */
| 66 | * buffer pools needed by the app - currently none. |
| 67 | */ |
| 68 | static int |
| 69 | init_mbuf_pools(void) |
| 70 | { |
| 71 | const unsigned int num_mbufs = (num_nodes * MBUFS_PER_NODE) + |
| 72 | (info->num_ports * MBUFS_PER_PORT); |
| 73 | |
| 74 | /* |
| 75 | * Don't pass single-producer/single-consumer flags to mbuf create as it |
| 76 | * seems faster to use a cache instead |
| 77 | */ |
| 78 | printf("Creating mbuf pool '%s' [%u mbufs] ...\n", |
| 79 | PKTMBUF_POOL_NAME, num_mbufs); |
| 80 | pktmbuf_pool = rte_pktmbuf_pool_create(PKTMBUF_POOL_NAME, num_mbufs, |
| 81 | MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); |
| 82 | |
| 83 | return pktmbuf_pool == NULL; /* 0 on success */ |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Initialise an individual port: |
no test coverage detected