Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2018 22:52:24 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332050 - head/sys/dev/cxgbe
Message-ID:  <201804042252.w34MqOx5026643@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Apr  4 22:52:24 2018
New Revision: 332050
URL: https://svnweb.freebsd.org/changeset/base/332050

Log:
  cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave
  IFF_UP and IFF_DRV_RUNNING out of sync.  ifhwioctl in the kernel pays no
  attention to the return code from the driver ioctl during SIOCSIFFLAGS
  so these messages are the only indication that the ioctl was called but
  failed.
  
  MFC after:	1 week
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Apr  4 22:46:30 2018	(r332049)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Apr  4 22:52:24 2018	(r332050)
@@ -1636,8 +1636,13 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd
 redo_sifflags:
 		rc = begin_synchronized_op(sc, vi,
 		    can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg");
-		if (rc)
+		if (rc) {
+			if_printf(ifp, "%ssleepable synch operation failed: %d."
+			    "  if_flags 0x%08x, if_drv_flags 0x%08x\n",
+			    can_sleep ? "" : "non-", rc, ifp->if_flags,
+			    ifp->if_drv_flags);
 			return (rc);
+		}
 
 		if (ifp->if_flags & IFF_UP) {
 			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
@@ -4306,8 +4311,13 @@ cxgbe_uninit_synchronized(struct vi_info *vi)
 	ASSERT_SYNCHRONIZED_OP(sc);
 
 	if (!(vi->flags & VI_INIT_DONE)) {
-		KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
-		    ("uninited VI is running"));
+		if (__predict_false(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+			KASSERT(0, ("uninited VI is running"));
+			if_printf(ifp, "uninited VI with running ifnet.  "
+			    "vi->flags 0x%016lx, if_flags 0x%08x, "
+			    "if_drv_flags 0x%08x\n", vi->flags, ifp->if_flags,
+			    ifp->if_drv_flags);
+		}
 		return (0);
 	}
 



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