From: Rahul Lakkireddy Date: Thu, 6 Dec 2018 10:13:20 +0000 (+0530) Subject: net/cxgbe: fix control queue mbuf pool naming convention X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=46df488b270a81a9353cac9374b8c338fcf7dfeb;p=dpdk.git net/cxgbe: fix control queue mbuf pool naming convention When multiple Chelsio adapters are present, the current naming convention of using underlying physical port number of the adapter creates conflicts when allocating control queue mbuf pool for multiple adapters and hence results in allocation failure. Fix by using port_id from rte_eth_dev_data, instead of physical port number. Fixes: 3a3aaabc7c77 ("net/cxgbe: add control queue to communicate filter requests") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index ec080e5d3d..0368db5091 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -122,6 +122,7 @@ int setup_sge_ctrl_txq(struct adapter *adapter) int err = 0, i = 0; for_each_port(adapter, i) { + struct port_info *pi = adap2pinfo(adapter, i); char name[RTE_ETH_NAME_MAX_LEN]; struct sge_ctrl_txq *q = &s->ctrlq[i]; @@ -135,16 +136,19 @@ int setup_sge_ctrl_txq(struct adapter *adapter) err); goto out; } - snprintf(name, sizeof(name), "cxgbe_ctrl_pool_%d", i); + snprintf(name, sizeof(name), "%s_ctrl_pool_%d", + pi->eth_dev->device->driver->name, + pi->eth_dev->data->port_id); q->mb_pool = rte_pktmbuf_pool_create(name, s->ctrlq[i].q.size, RTE_CACHE_LINE_SIZE, RTE_MBUF_PRIV_ALIGN, RTE_MBUF_DEFAULT_BUF_SIZE, SOCKET_ID_ANY); if (!q->mb_pool) { - dev_err(adapter, "Can't create ctrl pool for port: %d", - i); - err = -ENOMEM; + err = -rte_errno; + dev_err(adapter, + "Can't create ctrl pool for port %d. Err: %d\n", + pi->eth_dev->data->port_id, err); goto out; } }