svn commit: r332050 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Wed Apr 4 22:52:24 UTC 2018


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);
 	}
 


More information about the svn-src-all mailing list