From nobody Mon Sep 07 10:02:34 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hdjL764xvz6r4WX for ; Mon, 07 Sep 2026 10:02:39 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hdjL73ZYHz4J5d for ; Mon, 07 Sep 2026 10:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788775359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p87YUV/3fPh8/+uo5uEd7ZennxrUSp6G4+wL9UyYWWY=; b=C72oJe6VgY5KR4weuPgnEMHa+IhdxM6miJak8s5sJf6iwyegCFKXEPjUbzHTIV1Bk7bPrI ai4/1c6MSSAix1FO7GdFIyCEUi6kAyrcSqMtlkXlKi35PeW8ocwWm5l3JpwEylduVKZWF3 wQgNuFDmisMc6xaM9rFbPDbObu+yHGLSbXqhgtgrXlG83LnO4ozCs2YfNAX9nmJtErgfM4 loIX8h4hPQkIh7r4H16w4Yp87pI/lV5QXV2ztyXoXca1WfIdtPGHy2i0x83fqYDvchypID fA8mUI7C9duBffHLJKeyFlY6p6FOpLf+jgfl84aOSoewetdls2Est+NKw+x1CA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788775359; a=rsa-sha256; cv=none; b=wP/c9o38PhDBp5d+Eexi7T+n0kI3eZZM4jWXOChQourNO6XYdDpHGtLYOB4uEAk6JKku80 DalSLBlrrs4bX9MHsg2jMo3Qieccj8U9p8fzaUItvvScnf+8rehZlCmFkIcO/3d5d/Ct4N BL500uAhjsFmrtTX4JX7TYS69mKoJhPmxYlFuZaMLGvZlquJ9oxVgwfsaY0q2M82DT9nEX skjQy0Y43E+RlTEVGVKqJOPSZfBvFfdYUY36/Vqyu97hKc94i72wOY393CHKu9rIUIFN3T hQpOhC0vgU8Kdb5Ofh2vUEmB1AGk/1iskM9u0Tb+I8Yts/CFor6tTQPmSW6f4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788775359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p87YUV/3fPh8/+uo5uEd7ZennxrUSp6G4+wL9UyYWWY=; b=DJ5/QvfUyZM9amDdj2JoNq5LMgpU6RKJWJnfJrmkM+kudBpb7hKeynYmqfi4cnRDwAfMst qDAnuHhASnvHDrTSdFDpPyQ553WIr5H/Oe1Aoc7NwfIptw2SIEVCQeQrwkHW6PV30+SxAW icP70RtALJ+uaXEwImEtgAe5mZtavtHlZMgijWw9CR4td6TifHDOm/LPH8NZ/n7cVOPWz5 71OLQUC9I5B1v3ZTPgtklQWFt7/pKhwmGwrVLsahrFA4gPKa+bzIE9k/GhTus76xlf2u/u DSck4NDtylF2kNsqHtlFcJOOw2JX95I6x0tYg5rkY/SIytAn3BWBD6PkC7IXkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hdjL71v4zz1CXC for ; Mon, 07 Sep 2026 10:02:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45c5f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 07 Sep 2026 10:02:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f51ad3a266ec - main - e1000: Fence DMA when hardware reset fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/main X-Git-Reftype: branch X-Git-Commit: f51ad3a266ec1ea71c24329dbffdb66a3708b214 Auto-Submitted: auto-generated Date: Mon, 07 Sep 2026 10:02:34 +0000 Message-Id: <6a9e8bba.45c5f.1f2b9c66@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f51ad3a266ec1ea71c24329dbffdb66a3708b214 commit f51ad3a266ec1ea71c24329dbffdb66a3708b214 Author: Kevin Bowling AuthorDate: 2026-08-26 09:21:56 +0000 Commit: Kevin Bowling CommitDate: 2026-09-07 10:02:18 +0000 e1000: Fence DMA when hardware reset fails iflib releases queue mappings after IFDI_STOP() returns. If a Physical Function reset fails, returning with PCI bus mastering enabled can therefore leave the device able to access mappings which the framework is about to recycle. Disable bus mastering and drain pending PCIe transactions when reset fails during initialization or stop. Re-enable and verify bus mastering only after a later reset succeeds and before queue programming begins. Treat inability to establish the DMA fence as a fail-stop invariant violation. MFC after: 2 weeks Sponsored by: BBOX.io --- sys/dev/e1000/if_em.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 5587920a47b5..2e872b82680f 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1953,6 +1953,7 @@ em_if_init(if_ctx_t ctx) (void)igbv_reset(ctx); em_rebase_vf_stats(sc); } else if (em_reset(ctx) != E1000_SUCCESS) { + em_fence_pci_busmaster(sc); iflib_init_failed(ctx); return; } @@ -1976,7 +1977,7 @@ em_if_init(if_ctx_t ctx) * Keep a fail-closed device fenced until reset and VF queue * sanitization have removed every stale DMA address. */ - if (sc->vf_ifp && em_enable_pci_busmaster(sc) != 0) { + if (em_enable_pci_busmaster(sc) != 0) { device_printf(sc->dev, "Unable to enable PCI bus mastering\n"); iflib_init_failed(ctx); @@ -4141,6 +4142,7 @@ em_if_stop(if_ctx_t ctx) if (!sc->vf_ifp && error != E1000_SUCCESS) { device_printf(sc->dev, "Hardware reset failed while " "stopping: %d\n", error); + em_fence_pci_busmaster(sc); return; } }