Skip to content

Commit 9f19306

Browse files
elvinongbldavem330
authored andcommitted
net: stmmac: use netif_tx_start|stop_all_queues() function
The current implementation of stmmac_stop_all_queues() and stmmac_start_all_queues() will not work correctly when the value of tx_queues_to_use is changed through ethtool -L DEVNAME rx N tx M command. Also, netif_tx_start|stop_all_queues() are only needed in driver open() and close() only. Fixes: c22a3f4 net: stmmac: adding multiple napi mechanism Signed-off-by: Ong Boon Leong <[email protected]> Signed-off-by: Voon Weifeng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 686cff3 commit 9f19306

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -176,32 +176,6 @@ static void stmmac_enable_all_queues(struct stmmac_priv *priv)
176176
}
177177
}
178178

179-
/**
180-
* stmmac_stop_all_queues - Stop all queues
181-
* @priv: driver private structure
182-
*/
183-
static void stmmac_stop_all_queues(struct stmmac_priv *priv)
184-
{
185-
u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
186-
u32 queue;
187-
188-
for (queue = 0; queue < tx_queues_cnt; queue++)
189-
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue));
190-
}
191-
192-
/**
193-
* stmmac_start_all_queues - Start all queues
194-
* @priv: driver private structure
195-
*/
196-
static void stmmac_start_all_queues(struct stmmac_priv *priv)
197-
{
198-
u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
199-
u32 queue;
200-
201-
for (queue = 0; queue < tx_queues_cnt; queue++)
202-
netif_tx_start_queue(netdev_get_tx_queue(priv->dev, queue));
203-
}
204-
205179
static void stmmac_service_event_schedule(struct stmmac_priv *priv)
206180
{
207181
if (!test_bit(STMMAC_DOWN, &priv->state) &&
@@ -2864,7 +2838,7 @@ static int stmmac_open(struct net_device *dev)
28642838
}
28652839

28662840
stmmac_enable_all_queues(priv);
2867-
stmmac_start_all_queues(priv);
2841+
netif_tx_start_all_queues(priv->dev);
28682842

28692843
return 0;
28702844

@@ -2907,8 +2881,6 @@ static int stmmac_release(struct net_device *dev)
29072881
phylink_stop(priv->phylink);
29082882
phylink_disconnect_phy(priv->phylink);
29092883

2910-
stmmac_stop_all_queues(priv);
2911-
29122884
stmmac_disable_all_queues(priv);
29132885

29142886
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -5116,7 +5088,6 @@ int stmmac_suspend(struct device *dev)
51165088
mutex_lock(&priv->lock);
51175089

51185090
netif_device_detach(ndev);
5119-
stmmac_stop_all_queues(priv);
51205091

51215092
stmmac_disable_all_queues(priv);
51225093

@@ -5242,8 +5213,6 @@ int stmmac_resume(struct device *dev)
52425213

52435214
stmmac_enable_all_queues(priv);
52445215

5245-
stmmac_start_all_queues(priv);
5246-
52475216
mutex_unlock(&priv->lock);
52485217

52495218
if (!device_may_wakeup(priv->device) || !priv->plat->pmt) {

0 commit comments

Comments
 (0)