patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/cxgbe: fix control queue mbuf pool naming convention
@ 2018-12-06 10:13 Rahul Lakkireddy
  2018-12-12 10:42 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Rahul Lakkireddy @ 2018-12-06 10:13 UTC (permalink / raw)
  To: dev; +Cc: indranil, nirranjan, stable

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 <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_main.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index ec080e5d3..0368db509 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;
 		}
 	}
-- 
2.18.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/cxgbe: fix control queue mbuf pool naming convention
  2018-12-06 10:13 [dpdk-stable] [PATCH] net/cxgbe: fix control queue mbuf pool naming convention Rahul Lakkireddy
@ 2018-12-12 10:42 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-12-12 10:42 UTC (permalink / raw)
  To: Rahul Lakkireddy, dev; +Cc: indranil, nirranjan, stable

On 12/6/2018 10:13 AM, Rahul Lakkireddy wrote:
> 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 <rahul.lakkireddy@chelsio.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-12 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 10:13 [dpdk-stable] [PATCH] net/cxgbe: fix control queue mbuf pool naming convention Rahul Lakkireddy
2018-12-12 10:42 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).