From owner-svn-src-all@freebsd.org Wed Apr 4 22:52:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A351DF7D489; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56F6978673; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5181E1A2A8; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34MqOOm026644; Wed, 4 Apr 2018 22:52:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34MqOx5026643; Wed, 4 Apr 2018 22:52:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804042252.w34MqOx5026643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 4 Apr 2018 22:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332050 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 332050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 22:52:24 -0000 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); }