From owner-svn-src-stable-8@freebsd.org Thu Aug 9 00:56:41 2018 Return-Path: Delivered-To: svn-src-stable-8@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 5DE9E1071769; Thu, 9 Aug 2018 00:56:41 +0000 (UTC) (envelope-from davidcs@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 0D62175873; Thu, 9 Aug 2018 00:56:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8874123FB; Thu, 9 Aug 2018 00:56:40 +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 w790ueN8036752; Thu, 9 Aug 2018 00:56:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790ueMG036751; Thu, 9 Aug 2018 00:56:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090056.w790ueMG036751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r337513 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/8/sys/dev/bxe X-SVN-Commit-Revision: 337513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:56:41 -0000 Author: davidcs Date: Thu Aug 9 00:56:40 2018 New Revision: 337513 URL: https://svnweb.freebsd.org/changeset/base/337513 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Thu Aug 9 00:52:38 2018 (r337512) +++ stable/8/sys/dev/bxe/bxe.c Thu Aug 9 00:56:40 2018 (r337513) @@ -4396,6 +4396,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4441,30 +4443,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7018,7 +7029,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9097,11 +9108,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) fp = &sc->fp[i]; if (fp->tq) { taskqueue_drain(fp->tq, &fp->tq_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task);