From nobody Mon Sep 07 10:02:34 2026 X-Original-To: dev-commits-src-main@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 4hdjL22zT2z6r4Dr for ; Mon, 07 Sep 2026 10:02:34 +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 4hdjL229Klz4JPX for ; Mon, 07 Sep 2026 10:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788775354; 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=M49zvp1ZzyX3YiMUVLs0mG5u18X8GSTIMaHfNWjWqyzmHGYNeP5MtJk0cPjCj3UAxgyA03 SD6slDcD9pCFubq3RZmr1ug9sPKrX2mnB3uAMIp9N0VU2zJL4U5m+lbw4bOwaBKEPyLRfc 7oVQADfgkDu2pNSPtB5SQbeL9ChRi9+COhHQuMdTgjoPy61n7WyUSU4NVjky6HtlBc8E8a QUCF1E+zyHlkAyF8Zdo/ObsNzXdyAJnW8SbMsozP0sCYDGr6GCB5YJKKBmbxFfrR+P7loz ZJfFNZsP1YgxhuDVARvRNW9Z0z4V8N/FB8Uep95M505WN/0EbjjwxkAZT4JIXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788775354; a=rsa-sha256; cv=none; b=RY8UgV3i++MlQCqvTd5cd/corRvpWnh4hU5zEnT/rg9dGVj7yFY9J0uvSv6KOFAqajUAaT m0bv6ZVoS1Op2nP09qBE0HZMsIYoI2vqv4Spc+AQU/I4swWxj2W98AyBd9DAHzoDh1H6tz sNeaTSZkIY+hlTZ9Ynaq/suIiWLsBHvzjbOLoGuu48DBoqmbw61a3DN9QGV6UW74i/4nPD bRlyqxE1HbNlRbHSQiP1L2IzEd6u5zqoWlpH/dKKqYQFSxbyxoxybpbh4+k7bb4AWoYbBX S4ARjsWg/YH7wouXph+iQHMhVKTQSEHSXE+yztSxHPBniN9ldXWFi5UzRGmK1g== 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=1788775354; 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=dmKkhfKwM0poeqnWvsxd3VyjpgFA/41zdu5+6fetA5A+rEcvkvXUMgc6F4xEKqkdZe29VT lQA2wx0JhKdsXZW2Xe45lDj5belVsW7wlImA0CR4ObNvhCZlClvej81lPyPGmYPUDDAE6V /qLjaSgYlRfCXgM5iQ4cMzYhcSZLuMa5QPFeKQzTxCQGwUUX2+kv7O2/ELGdT1gLVyFl4Q SIAO7KEtQXdOJhOqxS2clRB+vod+VoHJvbmnnmeie+sm90aSzJLbznxilR0OUuVQ6QiCbH LJqA8Awn/5Xcs3Ii69BPofj5SfKrlY/l/K1RpzthW9N6b4TxmhilCNzmgAWiiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hdjL20z3Sz1CK2 for ; Mon, 07 Sep 2026 10:02:34 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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; } }