[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210506172021.7327-3-yannick.vignon@oss.nxp.com>
Date: Thu, 6 May 2021 19:20:21 +0200
From: Yannick Vignon <yannick.vignon@....nxp.com>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Antoine Tenart <atenart@...nel.org>,
Wei Wang <weiwan@...gle.com>, Taehee Yoo <ap420073@...il.com>,
Alexander Lobakin <alobakin@...me>, netdev@...r.kernel.org,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Joakim Zhang <qiangqing.zhang@....com>,
sebastien.laveze@....nxp.com
Cc: Yannick Vignon <yannick.vignon@....com>
Subject: [RFC PATCH net-next v1 2/2] net: stmmac: use specific name for each NAPI instance
From: Yannick Vignon <yannick.vignon@....com>
Use the newly introduced name field of the NAPI struct to identify which
queue each NAPI instance works on.
Signed-off-by: Yannick Vignon <yannick.vignon@....com>
---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 21 ++++++++++++-------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e0b7eebcb512..d7fc3eddb7b7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6615,6 +6615,7 @@ static void stmmac_napi_add(struct net_device *dev)
{
struct stmmac_priv *priv = netdev_priv(dev);
u32 queue, maxq;
+ char name[NAPINAMSIZ];
maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use);
@@ -6626,19 +6627,23 @@ static void stmmac_napi_add(struct net_device *dev)
spin_lock_init(&ch->lock);
if (queue < priv->plat->rx_queues_to_use) {
- netif_napi_add(dev, &ch->rx_napi, stmmac_napi_poll_rx,
- NAPI_POLL_WEIGHT);
+ snprintf(name, NAPINAMSIZ, "rx-%d", queue);
+ netif_napi_add_named(dev, &ch->rx_napi,
+ stmmac_napi_poll_rx,
+ NAPI_POLL_WEIGHT, name);
}
if (queue < priv->plat->tx_queues_to_use) {
- netif_tx_napi_add(dev, &ch->tx_napi,
- stmmac_napi_poll_tx,
- NAPI_POLL_WEIGHT);
+ snprintf(name, NAPINAMSIZ, "tx-%d", queue);
+ netif_tx_napi_add_named(dev, &ch->tx_napi,
+ stmmac_napi_poll_tx,
+ NAPI_POLL_WEIGHT, name);
}
if (queue < priv->plat->rx_queues_to_use &&
queue < priv->plat->tx_queues_to_use) {
- netif_napi_add(dev, &ch->rxtx_napi,
- stmmac_napi_poll_rxtx,
- NAPI_POLL_WEIGHT);
+ snprintf(name, NAPINAMSIZ, "rxtx-%d", queue);
+ netif_napi_add_named(dev, &ch->rxtx_napi,
+ stmmac_napi_poll_rxtx,
+ NAPI_POLL_WEIGHT, name);
}
}
}
--
2.17.1
Powered by blists - more mailing lists