From nobody Tue Sep 30 17:14:47 2025 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 4cbl6c0shRz69NYW; Tue, 30 Sep 2025 17:14:48 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbl6b5y3nz3D8K; Tue, 30 Sep 2025 17:14:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759252487; 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=zHrIy374vh/l0JAPHgV65iaZB3Oy0NxWjVZ/OTO/AAA=; b=GIarX+B8ByWK7fL9y8OfnBMrRCzyL6MEnJpUF4EZG+3+UTFG6l+4xUf6vAIls5nfQ+59Bv xXrPTwyFhBi0z+DScr8dnUgXPrcPNs6hY3j0TD6q/1+s9j+xx+z0G0PWvMar+1W3iEK56p xauQDtCR83pQAp/R78ccXq2cfVCVqH2W8w9BYMVJjBhfPekdAWyaWPirU+wVHv9h6/1yVM pb58Qxs8YulxRx3ydWeT/m9gQp0rByEk429W9/WL2S3jLyWreiojFECj5+gQ/6vDcc/Eu5 bx98cW6v8K1aHV+HtlFIYrvV5kxIeaPq9GoLC8JdihYIMgfw8c4FgCXM1f2GIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759252487; 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=zHrIy374vh/l0JAPHgV65iaZB3Oy0NxWjVZ/OTO/AAA=; b=oau5J9KGwZvxVmGyyZvgKOQCzojTUh8dBDOoD201VZFkLk+YDbTqVa1M2OMb0egDoVuhDb eYjdx9OUcNBobptFdQQfWwlMiBx3WhoTVHCfifBtcD270rwdXK+En/vVAL8HJqTpDNJ0P0 kYWYyYbhJd7k/UZslhS9QMLlDSMPpX9zpwhH1nKv6spMd8l+89g+mbjyAr8+p9WXMKxd9d 6ER1be2wWrpgN8Duw9bSLqKJAvEPVFG2YvKzW9Fs37QJmuw1BMlFp5Ixu1PDdnn47EiaNm mbJ2AiSuidcwydSYGTBk7NLJOAQJ8Pj1R5NqthhdqDkFy4ctLzFnvR48NPk5JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759252487; a=rsa-sha256; cv=none; b=Fu5notIgotoJWdQW9O57qu+lBiaVq9MRq8lrlO6IklM1a1aBtc/rRFKkI5x6B4WzVTTGi5 M9zKWDSQryYvQfHHzaZJqqjC3SCy2aBf+JPSWr76aFd8Ayq07mPs4pp7vYJJcQDsz5+Gsc Z/kDTj7j4pkARyFzZNZJF8YNQwPl7RCYw+U/jqZFxZrsWyPRxMOTlutw+CylGqVV5Y4pGY 4bOukGU3WVWajnAZquNo4sqG0Dr/d9QxeQpFcjXyFNjF3Zm/fsLe8D3TtGErElX7/jjeY2 7uS67zNa5F8SL2QmS7/LCJent46WSxD4x2ToCDiqvW73va698kv6WEI5MyoRCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cbl6b5XhgzmFQ; Tue, 30 Sep 2025 17:14:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UHElKU055419; Tue, 30 Sep 2025 17:14:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UHElqv055416; Tue, 30 Sep 2025 17:14:47 GMT (envelope-from git) Date: Tue, 30 Sep 2025 17:14:47 GMT Message-Id: <202509301714.58UHElqv055416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6e4b811009d6 - main - vtnet: disable hardware TCP LRO by default 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 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/main X-Git-Reftype: branch X-Git-Commit: 6e4b811009d63f33c59d51f28fd4a030ca90843e Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6e4b811009d63f33c59d51f28fd4a030ca90843e commit 6e4b811009d63f33c59d51f28fd4a030ca90843e Author: Michael Tuexen AuthorDate: 2025-09-29 23:58:37 +0000 Commit: Michael Tuexen CommitDate: 2025-09-30 00:03:49 +0000 vtnet: disable hardware TCP LRO by default Hardware TCP LRO results in problems in settings with IP forwarding being enabled. In case of nodes without IP forwarding, using software LRO is also beneficial in general, since it can provide better information about what was received on the wire. Therefore, disable hardware TCP LRO by default. By tuning the loader tunable, this can be changed. PR: 263229 Reviewed by: Timo Völker MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52684 --- share/man/man4/vtnet.4 | 22 +++++++++++++++++----- sys/dev/virtio/network/if_vtnet.c | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 636ce4cc9b60..fd41b36882a6 100644 --- a/share/man/man4/vtnet.4 +++ b/share/man/man4/vtnet.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 26, 2025 +.Dd September 30, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -54,6 +54,18 @@ TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. +.Pp +Two flavors of TCP LRO are supported: +Hardware TCP LRO, which is performed by the host providing TCP segments larger +than the MTU to the guest, and Software TCP LRO, which is performed by the +network stack of the guest processing TCP segments in an optimized way. +Only one flavour of TCP LRO should be used. +Since hardware TCP LRO can have bad interactions with IP forwarding and +software TCP LRO mitigates several drawbacks of hardware TCP LRO, the default +setting is to disable hardware TCP LRO. +See the loader tunable +.Va hw.vtnet. Ns Ar X Ns Va .lro_disable . +.Pp TCP/UDP receive checksum offload cannot be configured independently for IPv4 and IPv6. Selecting an MTU larger than 1500 bytes with the @@ -94,8 +106,8 @@ This tunable disables TCP segmentation offloading. The default value is 0. .It Va hw.vtnet.lro_disable .It Va hw.vtnet. Ns Ar X Ns Va .lro_disable -This tunable disables large receive offload. -The default value is 0. +This tunable disables hardware TCP LRO. +The default value is 1. .It Va hw.vtnet.mq_disable .It Va hw.vtnet. Ns Ar X Ns Va .mq_disable This tunable disables multiqueue. @@ -119,11 +131,11 @@ This tunable sets the number of RX segments processed in one pass. The default value is 1024. .It Va hw.vtnet.lro_entry_count .It Va hw.vtnet. Ns Ar X Ns Va .lro_entry_count -This tunable sets the software LRO entry count. +This tunable sets the software TCP LRO entry count. The default value is 128, the minimum value is 8. .It Va hw.vtnet.lro_mbufq_depth .It Va hw.vtnet. Ns Ar X Ns Va .lro_mbufq_depth -This tunable sets the depth of the software LRO mbuf queue. +This tunable sets the depth of the software TCP LRO mbuf queue. The default value is 0. .It Va hw.vtnet.altq_disable This tunable disables ALTQ support, allowing the use of multiqueue instead. diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 634ba0de2d55..471c6b3714b2 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -281,7 +281,7 @@ static int vtnet_tso_disable = 0; SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, 0, "Disables TSO"); -static int vtnet_lro_disable = 0; +static int vtnet_lro_disable = 1; SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, 0, "Disables hardware LRO");