net: socionext: Reset tx queue in ndo_stop
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Tue, 23 Oct 2018 11:24:28 +0000 (20:24 +0900)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Oct 2018 17:55:35 +0000 (10:55 -0700)
We observed that packets and bytes count are not reset
when user performs interface down. Eventually, tx queue is
exhausted and packets will not be sent out.
To avoid this problem, resets tx queue in ndo_stop.

Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Signed-off-by: Yoshitoyo Osaki <osaki.yoshitoyo@socionext.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/socionext/netsec.c

index dbf71e1..d9d0d03 100644 (file)
@@ -955,6 +955,9 @@ static void netsec_uninit_pkt_dring(struct netsec_priv *priv, int id)
        dring->head = 0;
        dring->tail = 0;
        dring->pkt_cnt = 0;
+
+       if (id == NETSEC_RING_TX)
+               netdev_reset_queue(priv->ndev);
 }
 
 static void netsec_free_dring(struct netsec_priv *priv, int id)