From owner-svn-src-stable@freebsd.org Mon May 15 18:24:15 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCAED6E8C3; Mon, 15 May 2017 18:24:15 +0000 (UTC) (envelope-from davidcs@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 mx1.freebsd.org (Postfix) with ESMTPS id B2B32156; Mon, 15 May 2017 18:24:15 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4FIOELb059616; Mon, 15 May 2017 18:24:14 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4FIOEWi059614; Mon, 15 May 2017 18:24:14 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201705151824.v4FIOEWi059614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 15 May 2017 18:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r318309 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 18:24:16 -0000 Author: davidcs Date: Mon May 15 18:24:14 2017 New Revision: 318309 URL: https://svnweb.freebsd.org/changeset/base/318309 Log: MFC r317996 Fix bug where MTX_DEF lock was held while taskqueue_drain() was invoked. Check IFF_DRV_RUNNING flag is set prior to calling ql_hw_set_multi() Modified: stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_isr.c Mon May 15 18:21:36 2017 (r318308) +++ stable/9/sys/dev/qlxgbe/ql_isr.c Mon May 15 18:24:14 2017 (r318309) @@ -983,7 +983,8 @@ ql_isr(void *arg) fp = &ha->tx_fp[idx]; - if (fp->fp_taskqueue != NULL) + if ((fp->fp_taskqueue != NULL) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); return; Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Mon May 15 18:21:36 2017 (r318308) +++ stable/9/sys/dev/qlxgbe/ql_os.c Mon May 15 18:24:14 2017 (r318309) @@ -930,7 +930,9 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); QLA_LOCK(ha); - ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + } QLA_UNLOCK(ha); return (ret); @@ -1036,20 +1038,16 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, QL_DPRINT4(ha, (ha->pci_dev, "%s: %s (0x%lx)\n", __func__, "SIOCADDMULTI", cmd)); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (qla_set_multi(ha, 1)) - ret = EINVAL; - } + if (qla_set_multi(ha, 1)) + ret = EINVAL; break; case SIOCDELMULTI: QL_DPRINT4(ha, (ha->pci_dev, "%s: %s (0x%lx)\n", __func__, "SIOCDELMULTI", cmd)); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (qla_set_multi(ha, 0)) - ret = EINVAL; - } + if (qla_set_multi(ha, 0)) + ret = EINVAL; break; case SIOCSIFMEDIA: @@ -1550,9 +1548,9 @@ qla_stop(qla_host_t *ha) ha->flags.qla_interface_up = 0; + QLA_UNLOCK(ha); qla_drain_fp_taskqueues(ha); - - ql_hw_stop_rcv(ha); + QLA_LOCK(ha); ql_del_hw_if(ha); @@ -1943,8 +1941,6 @@ qla_error_recovery(void *context, int pe ha->hw.imd_compl = 1; qla_mdelay(__func__, 300); - ql_hw_stop_rcv(ha); - ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); for (i = 0; i < ha->hw.num_sds_rings; i++) { @@ -1964,6 +1960,8 @@ qla_error_recovery(void *context, int pe QLA_UNLOCK(ha); + qla_drain_fp_taskqueues(ha); + if ((ha->pci_func & 0x1) == 0) { if (!ha->msg_from_peer) {