提交 9f19306d 编写于 作者: O Ong Boon Leong 提交者: David S. Miller

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: c22a3f48 net: stmmac: adding multiple napi mechanism
Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 686cff3d
...@@ -176,32 +176,6 @@ static void stmmac_enable_all_queues(struct stmmac_priv *priv) ...@@ -176,32 +176,6 @@ static void stmmac_enable_all_queues(struct stmmac_priv *priv)
} }
} }
/**
* stmmac_stop_all_queues - Stop all queues
* @priv: driver private structure
*/
static void stmmac_stop_all_queues(struct stmmac_priv *priv)
{
u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
u32 queue;
for (queue = 0; queue < tx_queues_cnt; queue++)
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue));
}
/**
* stmmac_start_all_queues - Start all queues
* @priv: driver private structure
*/
static void stmmac_start_all_queues(struct stmmac_priv *priv)
{
u32 tx_queues_cnt = priv->plat->tx_queues_to_use;
u32 queue;
for (queue = 0; queue < tx_queues_cnt; queue++)
netif_tx_start_queue(netdev_get_tx_queue(priv->dev, queue));
}
static void stmmac_service_event_schedule(struct stmmac_priv *priv) static void stmmac_service_event_schedule(struct stmmac_priv *priv)
{ {
if (!test_bit(STMMAC_DOWN, &priv->state) && if (!test_bit(STMMAC_DOWN, &priv->state) &&
...@@ -2864,7 +2838,7 @@ static int stmmac_open(struct net_device *dev) ...@@ -2864,7 +2838,7 @@ static int stmmac_open(struct net_device *dev)
} }
stmmac_enable_all_queues(priv); stmmac_enable_all_queues(priv);
stmmac_start_all_queues(priv); netif_tx_start_all_queues(priv->dev);
return 0; return 0;
...@@ -2907,8 +2881,6 @@ static int stmmac_release(struct net_device *dev) ...@@ -2907,8 +2881,6 @@ static int stmmac_release(struct net_device *dev)
phylink_stop(priv->phylink); phylink_stop(priv->phylink);
phylink_disconnect_phy(priv->phylink); phylink_disconnect_phy(priv->phylink);
stmmac_stop_all_queues(priv);
stmmac_disable_all_queues(priv); stmmac_disable_all_queues(priv);
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++) for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
...@@ -5116,7 +5088,6 @@ int stmmac_suspend(struct device *dev) ...@@ -5116,7 +5088,6 @@ int stmmac_suspend(struct device *dev)
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
netif_device_detach(ndev); netif_device_detach(ndev);
stmmac_stop_all_queues(priv);
stmmac_disable_all_queues(priv); stmmac_disable_all_queues(priv);
...@@ -5242,8 +5213,6 @@ int stmmac_resume(struct device *dev) ...@@ -5242,8 +5213,6 @@ int stmmac_resume(struct device *dev)
stmmac_enable_all_queues(priv); stmmac_enable_all_queues(priv);
stmmac_start_all_queues(priv);
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { if (!device_may_wakeup(priv->device) || !priv->plat->pmt) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册