Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 21:36:10 +0000 (UTC)
From:      David C Somayajulu <davidcs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r339885 - stable/9/sys/dev/bxe
Message-ID:  <201810292136.w9TLaAtc057563@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidcs
Date: Mon Oct 29 21:36:10 2018
New Revision: 339885
URL: https://svnweb.freebsd.org/changeset/base/339885

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@cavium.com

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

Modified: stable/9/sys/dev/bxe/bxe.c
==============================================================================
--- stable/9/sys/dev/bxe/bxe.c	Mon Oct 29 21:31:23 2018	(r339884)
+++ stable/9/sys/dev/bxe/bxe.c	Mon Oct 29 21:36:10 2018	(r339885)
@@ -7081,13 +7081,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) {
@@ -16284,9 +16284,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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810292136.w9TLaAtc057563>