From nobody Fri Jul 31 08:55:46 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 4hBKfb2ZNbz6mpCn for ; Fri, 31 Jul 2026 08:55:51 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hBKfV1nVhz3pYP for ; Fri, 31 Jul 2026 08:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785488146; 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=fJJ5L9vXHP+Ts76XzRHrBT3b2CddzVz4mJfeusG/unk=; b=Jg+MDtogzmx9QdfgEqi5H0LC8Kb2bNkPZp5Toh3LuCDZn3msCHVK0VTOWxrPt0YrD2gfJ8 HJzfSDKY0WfzF6p1KweZv0YhzifgdZtHHKBeRGiL85H0Q8+E2ZKZI9V11wKN2dTo6LJbly unnoCqt8N+IPFe5oN3KwAldQ7IU262NupCkG5/jyAYigh9zqYl2Uls6TEbcwO+2bVI9SKc 7nb6nLsz+JY+ehp+KltpbyVuNoHBd7YLwjEBa96J43n2mvG94s4R/O01W62ODY2BxUL4Oy LM8nliiCdz/qO3YYH1f6pZwezmjZK07yLaebWYf+DZdDsRJFfOo4rVDVluGjlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785488146; a=rsa-sha256; cv=none; b=l93Q5CLJnLPst0pNUUj2/Wrd0H2SaRfvMjEEAExnHC97fmmuBkriZQrAMIP+6ieXfxuy3/ E4qzTKNUNffxbow9oHQR+Bf1mTjUhIbW/6apj4Y7jiTaa0qX1W4HJgDwsOUVa0F0CGG0uc KSWXw6z9NR8HbtnT/4k7Pkd+hJ92VeTSfNf5BuNxe9G0rRltpsJtLxlciCoCq8lGxugy5C 0ju5mt3rKr2//zD8b4wSOPgu7zqrIv5tPSyiTxPbYxlIEtJfQMs/71XF3ujH6eRCL4NZSz IMO2rHxtUQZAS3ZSJH8U8EZmmXmYfsmxHzaJIwJiGU+yUrDd8Ra5rm4SGSeSKQ== 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=1785488146; 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=fJJ5L9vXHP+Ts76XzRHrBT3b2CddzVz4mJfeusG/unk=; b=Hs4f252vPlIsFxzXUbadSltFQdfrExuUBtQHGdN++GUEQoYtMmwSuvbq+93V9IQOxv+mpA Y8SXjHTFom4ikN77MsOkdDVsjJbi6vOQuqid2FqPrCt3zG154aH408+cqlCbbbrR7e8oQR ShXCJf+Y2H8GqysEwUl4QBE35v3py2FdXNm4yEabi9iaDVu7aQqdun/wuF8OwLvPzItHxp mN38mIcMsSGzvTVo+pawxpVscmSjVfzef+I0eP/Y/hXG1MkGG2bl+QiezWPXCshYDGY+RO qymSkxpqe1aaGY+0tf0rQMmDpj6Z/JvqWo5Yf6aFKA2MYDDUWF7Y5yL0aiFokw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBKfV0Qk6zsrZ for ; Fri, 31 Jul 2026 08:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2423e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 08:55:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 41759495769d - main - e1000: restrict conventional PCI DMA to 32 bits 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: 41759495769dff87cd4ebbb257d4054128ea5b42 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 08:55:46 +0000 Message-Id: <6a6c6312.2423e.2e7b8491@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=41759495769dff87cd4ebbb257d4054128ea5b42 commit 41759495769dff87cd4ebbb257d4054128ea5b42 Author: Kevin Bowling AuthorDate: 2026-07-31 07:02:22 +0000 Commit: Kevin Bowling CommitDate: 2026-07-31 08:55:07 +0000 e1000: restrict conventional PCI DMA to 32 bits Some conventional PCI e1000 configurations hang when given DMA addresses above 4 GB, particularly on systems using AMD HyperTransport-to-PCI bridges. Linux has restricted e1000 to DMA32 in PCI mode since 2011 for the same failure class in commit e508be174ad36b0cf9b324cd04978c2b13c21502. Set iflib's DMA width after determining the negotiated bus type. This covers descriptor and packet-buffer mappings while preserving 64-bit DMA for PCI-X and PCIe devices and providing a conditional tunable. PR: 297064 Reported by: Alexander Leidinger Tested by: Alexander Leidinger MFC after: 1 week --- sys/dev/e1000/if_em.c | 21 +++++++++++++++++++++ sys/dev/e1000/if_em.h | 1 + 2 files changed, 22 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 43519dd72d25..bfb5595be199 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1446,6 +1446,27 @@ em_if_attach_pre(if_ctx_t ctx) em_setup_msix(ctx); e1000_get_bus_info(hw); + /* + * Some conventional PCI systems hang when e1000 devices use + * DMA addresses above 4 GB. Keep PCI-mode DMA below that boundary + * by default; PCI-X and PCIe retain 64-bit DMA. + */ + if (hw->bus.type == e1000_bus_type_pci) { + SYSCTL_ADD_BOOL(ctx_list, child, OID_AUTO, "allow_64bit_dma", + CTLFLAG_RDTUN, &sc->allow_64bit_dma, 0, + "Allow 64-bit DMA in conventional PCI mode"); + if (sc->allow_64bit_dma) + device_printf(dev, "64-bit DMA in conventional PCI mode. " + "Some chipsets are unstable.\n"); + else { + scctx->isc_dma_width = 32; + device_printf(dev, "32-bit DMA in conventional PCI mode. " + "Set dev.%s.%d.allow_64bit_dma=1 at boot to enable " + "64-bit DMA if the chipset is stable with it.\n", + device_get_name(dev), device_get_unit(dev)); + } + } + /* Set up some sysctls for the tunable interrupt delays */ if (hw->mac.type < igb_mac_min) { em_add_int_delay_sysctl(sc, "rx_int_delay", diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 6e9d17c7b7a0..4676cffc5033 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -556,6 +556,7 @@ struct e1000_softc { int if_flags; int em_insert_vlan_header; u32 ims; + bool allow_64bit_dma; bool in_detach; u32 flags;