nfp: clear ring delayed kick counters
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 16 Dec 2015 19:08:52 +0000 (19:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Dec 2015 20:27:38 +0000 (15:27 -0500)
We need to clear delayed kick counters when we free rings otherwise
after ndo_close()/ndo_open() we could kick HW by more entries than
actually written to rings.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 7060539d276aa17a9538ebfec527d5d202645f7c..6c5af4cb5bdcc19dbda0cb46776032401414144d 100644 (file)
@@ -1363,6 +1363,7 @@ static void nfp_net_tx_ring_free(struct nfp_net_tx_ring *tx_ring)
        tx_ring->wr_p = 0;
        tx_ring->rd_p = 0;
        tx_ring->qcp_rd_p = 0;
+       tx_ring->wr_ptr_add = 0;
 
        tx_ring->txbufs = NULL;
        tx_ring->txds = NULL;
@@ -1437,6 +1438,7 @@ static void nfp_net_rx_ring_free(struct nfp_net_rx_ring *rx_ring)
        rx_ring->cnt = 0;
        rx_ring->wr_p = 0;
        rx_ring->rd_p = 0;
+       rx_ring->wr_ptr_add = 0;
 
        rx_ring->rxbufs = NULL;
        rx_ring->rxds = NULL;