From nobody Wed Jan 21 14:20:52 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 4dx5vt0W6qz6PGJ4 for ; Wed, 21 Jan 2026 14:20:58 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dx5vs6PwJz3TdY for ; Wed, 21 Jan 2026 14:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769005257; 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=9GT+mFmKFSr/sHANH5yLrfMp1pHTJgZpmdCmmv83zD0=; b=qV8x6CNd0oTnwOYaPs7GkYYha+JC8LAKH6UMqlyZV+DjiRCRrI9mKrPTkJFsmZZsFtEVy+ e6JYTcG3dPCwUc6nTfRZyTntoWEJ6sHRHFaB6uWJZb9nBvCi1ZAZkcAHWnTAldqgWZm+d+ B/x2IyrQ3P5mwRAXo/n5QmcEsEV6MMV3WwA6o1Vil6VdH59E3GvH5wP8tXY8JE+bEPosLz SsqlgykSCCk4LZ2t5PuXnovtqMd+Yzs7xVIOdDKc/lGOhUtJoJaFT/5SHu7SKVz3FdL7nz PgF3fmztztKF1UtcZdULJjEy18tvJmtckgr3nyD9JPNCGPsaIWGKKbOn8qzsag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769005257; 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=9GT+mFmKFSr/sHANH5yLrfMp1pHTJgZpmdCmmv83zD0=; b=H5RS+4QyVzkyGgkiQuEVHhM9BtqdEwF/ygQ+AJ8KBx8DA/GBdZaB+ybO2cfKsMjRys5qcZ 3oN2bydUks5dOgA5oEpmH5pYP/DLJPoxAuCPL1l11QVPH9Y1GOls9GTJ2GW+qX9Na0VleV Q01leJhPVNfXzKdi1rQeUF0m5gwILcqt9+luIycxzBcIMAY1N+gog4sT9UMN2z97Zj8XGF v7Nn6yCiYSv31VfrG3rEYab7OZju1D7PQrtEXFC8taxRGwI34UOxEHp0MXOiKaybKq5KC/ cyx5rlSZjwY5I9N5TWoY2npSJTMpJbvf713kzBtpReOVZttXaL6Z29NnlSJzLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769005257; a=rsa-sha256; cv=none; b=mwBewOPlLEW3ac8DjFqKxFFuShvezqa09erFKfaHzfcN1Dfm15A/8ESkOT13yOacN2QOew WvvVFvbkwHp4zGbTQMy2cW9R7kYyEawhU7L+u0P8o9VYdQrM77JlNdxOr0TERene2cU1tV bVPoAd+7QCR1srU5bRJS1ztr+E4jqzjt/jinRkCu/KVD1k1PxBjUFv5lCktMPZGrUlnWjp k+7CfRyvuHwMc+4Ya6CPB4dxL0J8Cl+DFQuL/VthbB/3A8HVUWPoZaopA8+jvcK08iOuaj 31D0zPeyK+TyJztZKQu3TRIBAijq6FQWFoQ+HQXrsZdQqjB4seFaiX8anTr9IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dx5vs5z0XzrZN for ; Wed, 21 Jan 2026 14:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24253 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 21 Jan 2026 14:20:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 39a25aa8a736 - stable/14 - bge: disable TXCSUM if UDP transmit checksum offloading is disabled 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 39a25aa8a736a827f7a99e682fdb1579af4e8df5 Auto-Submitted: auto-generated Date: Wed, 21 Jan 2026 14:20:52 +0000 Message-Id: <6970e0c4.24253.152137dc@gitrepo.freebsd.org> The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=39a25aa8a736a827f7a99e682fdb1579af4e8df5 commit 39a25aa8a736a827f7a99e682fdb1579af4e8df5 Author: Michael Tuexen AuthorDate: 2026-01-16 12:32:13 +0000 Commit: Michael Tuexen CommitDate: 2026-01-21 14:11:56 +0000 bge: disable TXCSUM if UDP transmit checksum offloading is disabled The bge interface is special with respect to transmit checksumi offloading. In the default settings, an bge interface announces TXCSUM capabilities, but only supports TCP/IPv4 and not UDP/IPv4 due to limitations of some of the NICs. This results in problems when the bge interface becomes a member of a bridge. Since currently only the TXCSUM capabilities are synced when a member is added to a bridge and not the protocol specific capabilities, this can result in a situation where UDP packets are sent out using a bge interface without having a correct checksum. To mitigate this problem, initially don't announce TXCSUM capabilities, when UDP transmit checksum is disabled. It is still possible to enable TXCSUM capabilities via ifconfig. PR: 291420 Reviewed by: Timo Voelker Differential Revision: https://reviews.freebsd.org/D54486 (cherry picked from commit bbd30927b1af44226c8de0512912a7fedfce2824) --- share/man/man4/bge.4 | 10 +++++++++- sys/dev/bge/if_bge.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/man/man4/bge.4 b/share/man/man4/bge.4 index de559c16df3c..fdf46fec0073 100644 --- a/share/man/man4/bge.4 +++ b/share/man/man4/bge.4 @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 18, 2017 +.Dd January 16, 2026 .Dt BGE 4 .Os .Sh NAME @@ -276,3 +276,11 @@ Also, due to the lack of hotplug support, Thunderbolt-based interfaces must not while the system is up as the kernel is currently unable to cope with a .Nm interface disappearing. +.Pp +The UDP transmit checksum offloading is disabled by default, see +.Va dev.bge.%d.forced_udpcsum . +To avoid problems when the interface is a member of a +.Xr bridge 4 +interface, all transmit checksum offloading is initially disabled in this case. +Transmit checksum offloading can be enabled using +.Xr ifconfig 8 . diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 6c3301b1473a..b676f03f715d 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -3721,7 +3721,12 @@ bge_attach(device_t dev) if_setgetcounterfn(ifp, bge_get_counter); if_setsendqlen(ifp, BGE_TX_RING_CNT - 1); if_setsendqready(ifp); - if_sethwassist(ifp, sc->bge_csum_features); + /* Initially enable checksum offloading either for all of IPv4, TCP/IPv4 + * and UDP/IPv4, or for none. This avoids problems when the interface + * is added to a bridge. + */ + if (sc->bge_csum_features & CSUM_UDP) + if_sethwassist(ifp, sc->bge_csum_features); if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU); if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) { @@ -3732,6 +3737,13 @@ bge_attach(device_t dev) if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWCSUM, 0); #endif if_setcapenable(ifp, if_getcapabilities(ifp)); + /* + * Disable TXCSUM capability initially, if UDP checksum offloading is + * not enabled. This avoids problems when the interface is added to a + * bridge. + */ + if ((sc->bge_csum_features & CSUM_UDP) == 0) + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM); #ifdef DEVICE_POLLING if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); #endif