[RFC,PATCH 2/2] net: stmmac: Change the tx clean lock

From: David Wu
Date: Tue Mar 24 2020 - 05:40:34 EST


At tx clean, use a frozen queue instead of blocking
the current queue, could still queue skb, which improve
performance.

Signed-off-by: David Wu <david.wu@xxxxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cb7a5bad4cfe..946058bcc9ed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1897,7 +1897,7 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
unsigned int bytes_compl = 0, pkts_compl = 0;
unsigned int entry, count = 0;

- __netif_tx_lock_bh(netdev_get_tx_queue(priv->dev, queue));
+ netif_tx_lock_q(netdev_get_tx_queue(priv->dev, queue));

priv->xstats.tx_clean++;

@@ -1994,7 +1994,7 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
if (tx_q->dirty_tx != tx_q->cur_tx)
mod_timer(&tx_q->txtimer, STMMAC_COAL_TIMER(priv->tx_coal_timer));

- __netif_tx_unlock_bh(netdev_get_tx_queue(priv->dev, queue));
+ netif_tx_unlock_q(netdev_get_tx_queue(priv->dev, queue));

return count;
}
--
2.19.1