From 7a89c091708f4cddc9849f4a1d6e86403a2d2456 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Mon, 15 Apr 2019 10:48:46 +0200 Subject: PROX: fix minimum rx buffer size used within generator Different PMD have different requirements for minimum rx buffer size. vmxnet3 has (in DPDK 18.08) requires minimum 1518 + 128 (RTE_PKTMBUF_HEADROOM). Change-Id: I327ae5b8dcf7eef8dd71fb4e2f0603b9bab6e1d3 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/prox_port_cfg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index a538be4f..043e755b 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -470,6 +470,9 @@ static void init_port(struct prox_port_cfg *port_cfg) plog_info("\t\tPort %u had no RX queues, setting to 1\n", port_id); port_cfg->n_rxq = 1; uint32_t mbuf_size = TX_MBUF_SIZE; + if (mbuf_size < port_cfg->min_rx_bufsize + RTE_PKTMBUF_HEADROOM + sizeof(struct rte_mbuf)) + mbuf_size = port_cfg->min_rx_bufsize + RTE_PKTMBUF_HEADROOM + sizeof(struct rte_mbuf); + plog_info("\t\tAllocating dummy memory pool on socket %u with %u elements of size %u\n", port_cfg->socket, port_cfg->n_rxd, mbuf_size); port_cfg->pool[0] = rte_mempool_create(dummy_pool_name, port_cfg->n_rxd, mbuf_size, -- cgit 1.2.3-korg