PROX: fix minimum rx buffer size used within generator 89/67589/2
authorXavier Simonart <xavier.simonart@intel.com>
Mon, 15 Apr 2019 08:48:46 +0000 (10:48 +0200)
committerXavier Simonart <xavier.simonart@intel.com>
Mon, 15 Apr 2019 14:34:06 +0000 (16:34 +0200)
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 <xavier.simonart@intel.com>
VNFs/DPPD-PROX/prox_port_cfg.c

index a538be4..043e755 100644 (file)
@@ -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,