be2net: fix disabling TX in be_close()
authorSathya Perla <sathya.perla@emulex.com>
Thu, 22 Aug 2013 06:53:41 +0000 (12:23 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Aug 2013 02:58:23 +0000 (19:58 -0700)
commit fba875591 ("disable TX in be_close()") disabled TX in be_close()
to protect be_xmit() from touching freed up queues in the AER recovery
flow.  But, TX must be disabled *before* cleaning up TX completions in
the close() path, not after. This allows be_tx_compl_clean() to free up
all TX-req skbs that were notified to the HW.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 181edb522450ada0c9ba72e9a736d312594cc183..4559c35eea13b5bf5e989066cf062c94ab38710a 100644 (file)
@@ -2563,8 +2563,8 @@ static int be_close(struct net_device *netdev)
        /* Wait for all pending tx completions to arrive so that
         * all tx skbs are freed.
         */
-       be_tx_compl_clean(adapter);
        netif_tx_disable(netdev);
+       be_tx_compl_clean(adapter);
 
        be_rx_qs_destroy(adapter);