svn commit: r339874 - stable/11/sys/dev/bxe

David C Somayajulu davidcs at FreeBSD.org
Mon Oct 29 21:00:17 UTC 2018


Author: davidcs
Date: Mon Oct 29 21:00:16 2018
New Revision: 339874
URL: https://svnweb.freebsd.org/changeset/base/339874

Log:
  MFC r338734
  
  Fixed isses:
     State check before enqueuing transmit task in bxe_link_attn() routine.
     State check before invoking bxe_nic_unload in bxe_shutdown().
  
  Submitted by:Vaishali.Kulkarni at cavium.com

Modified:
  stable/11/sys/dev/bxe/bxe.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/bxe/bxe.c
==============================================================================
--- stable/11/sys/dev/bxe/bxe.c	Mon Oct 29 20:53:05 2018	(r339873)
+++ stable/11/sys/dev/bxe/bxe.c	Mon Oct 29 21:00:16 2018	(r339874)
@@ -7072,13 +7072,13 @@ bxe_link_attn(struct bxe_softc *sc)
 
         if (sc->state == BXE_STATE_OPEN) {
             bxe_stats_handle(sc, STATS_EVENT_LINK_UP);
+	    /* Restart tx when the link comes back. */
+	    FOR_EACH_ETH_QUEUE(sc, i) {
+		fp = &sc->fp[i];
+		taskqueue_enqueue(fp->tq, &fp->tx_task);
+	    }
         }
 
-	/* Restart tx when the link comes back. */
-        FOR_EACH_ETH_QUEUE(sc, i) {
-            fp = &sc->fp[i];
-            taskqueue_enqueue(fp->tq, &fp->tx_task);
-	}
     }
 
     if (sc->link_vars.link_up && sc->link_vars.line_speed) {
@@ -16272,9 +16272,11 @@ bxe_shutdown(device_t dev)
     /* stop the periodic callout */
     bxe_periodic_stop(sc);
 
-    BXE_CORE_LOCK(sc);
-    bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE);
-    BXE_CORE_UNLOCK(sc);
+    if (sc->state != BXE_STATE_CLOSED) {
+    	BXE_CORE_LOCK(sc);
+    	bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE);
+    	BXE_CORE_UNLOCK(sc);
+    }
 
     return (0);
 }


More information about the svn-src-stable-11 mailing list