From owner-dev-commits-src-all@freebsd.org Tue Sep 28 16:57:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAEFD6A8210; Tue, 28 Sep 2021 16:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJm005t3nz4Rf1; Tue, 28 Sep 2021 16:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A19E227ED6; Tue, 28 Sep 2021 16:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18SGvaKJ035447; Tue, 28 Sep 2021 16:57:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18SGvalo035446; Tue, 28 Sep 2021 16:57:36 GMT (envelope-from git) Date: Tue, 28 Sep 2021 16:57:36 GMT Message-Id: <202109281657.18SGvalo035446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 594a25fa4304 - stable/13 - e1000: Re-arm link changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 594a25fa43049c336d6016002538cad7a5383284 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 16:57:37 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=594a25fa43049c336d6016002538cad7a5383284 commit 594a25fa43049c336d6016002538cad7a5383284 Author: Kevin Bowling AuthorDate: 2021-09-27 16:17:48 +0000 Commit: Kevin Bowling CommitDate: 2021-09-28 16:55:59 +0000 e1000: Re-arm link changes A change to MSI-X link handler was somehow causing issues on MSI-based em(4) NICs. Revert the change based on user reports and testing. PR: 258551 Reported by: Franco Fichtner , t_uemura@macome.co.jp Reviewed by: markj, Franco Fichtner Tested by: t_uemura@macome.co.jp MFC after: 1 day (cherry picked from commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf) --- sys/dev/e1000/if_em.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 47513c5d9e1e..34d7b8f5f87e 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1495,7 +1495,6 @@ em_msix_link(void *arg) { struct e1000_softc *sc = arg; u32 reg_icr; - bool notlink = false; ++sc->link_irq; MPASS(sc->hw.back != NULL); @@ -1506,17 +1505,14 @@ em_msix_link(void *arg) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) em_handle_link(sc->ctx); - else - notlink = true; - /* Re-arm for other/spurious interrupts */ - if (notlink && sc->hw.mac.type >= igb_mac_min) { + /* Re-arm unconditionally */ + if (sc->hw.mac.type >= igb_mac_min) { E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); } else if (sc->hw.mac.type == e1000_82574) { - if (notlink) - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | - E1000_IMS_OTHER); + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC | + E1000_IMS_OTHER); /* * Because we must read the ICR for this interrupt it may * clear other causes using autoclear, for this reason we @@ -1524,7 +1520,8 @@ em_msix_link(void *arg) */ if (reg_icr) E1000_WRITE_REG(&sc->hw, E1000_ICS, sc->ims); - } + } else + E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); return (FILTER_HANDLED); } @@ -1873,13 +1870,6 @@ em_if_update_admin_status(if_ctx_t ctx) if (hw->mac.type < em_mac_min) lem_smartspeed(sc); - else if (hw->mac.type >= igb_mac_min && - sc->intr_type == IFLIB_INTR_MSIX) { - E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC); - E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask); - } else if (hw->mac.type == e1000_82574 && - sc->intr_type == IFLIB_INTR_MSIX) - E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC | E1000_IMS_OTHER); } static void