From owner-svn-src-head@freebsd.org Thu Jun 14 01:27:37 2018 Return-Path: Delivered-To: svn-src-head@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 D69FC100CE03; Thu, 14 Jun 2018 01:27:36 +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 82E076856F; Thu, 14 Jun 2018 01:27:36 +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 49FEB21745; Thu, 14 Jun 2018 01:27:36 +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 w5E1Ra1T004638; Thu, 14 Jun 2018 01:27:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1Radw004637; Thu, 14 Jun 2018 01:27:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806140127.w5E1Radw004637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 14 Jun 2018 01:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335102 - 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: 335102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 01:27:37 -0000 Author: np Date: Thu Jun 14 01:27:35 2018 New Revision: 335102 URL: https://svnweb.freebsd.org/changeset/base/335102 Log: cxgbe(4): Catch up with recent changes in the kernel -- it no longer holds non-sleepable locks around any of the driver ioctls. 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 Thu Jun 14 01:15:19 2018 (r335101) +++ head/sys/dev/cxgbe/t4_main.c Thu Jun 14 01:27:35 2018 (r335102) @@ -1663,7 +1663,7 @@ cxgbe_init(void *arg) static int cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) { - int rc = 0, mtu, flags, can_sleep; + int rc = 0, mtu, flags; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; @@ -1689,59 +1689,36 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd break; case SIOCSIFFLAGS: - can_sleep = 0; -redo_sifflags: - rc = begin_synchronized_op(sc, vi, - can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg"); - 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); + rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4flg"); + if (rc) return (rc); - } if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { flags = vi->if_flags; if ((ifp->if_flags ^ flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - if (can_sleep == 1) { - end_synchronized_op(sc, 0); - can_sleep = 0; - goto redo_sifflags; - } rc = update_mac_settings(ifp, XGMAC_PROMISC | XGMAC_ALLMULTI); } } else { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } rc = cxgbe_init_synchronized(vi); } vi->if_flags = ifp->if_flags; } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } rc = cxgbe_uninit_synchronized(vi); } - end_synchronized_op(sc, can_sleep ? 0 : LOCK_HELD); + end_synchronized_op(sc, 0); break; case SIOCADDMULTI: - case SIOCDELMULTI: /* these two are called with a mutex held :-( */ - rc = begin_synchronized_op(sc, vi, HOLD_LOCK, "t4multi"); + case SIOCDELMULTI: + rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4multi"); if (rc) return (rc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MCADDRS); - end_synchronized_op(sc, LOCK_HELD); + end_synchronized_op(sc, 0); break; case SIOCSIFCAP: