From nobody Fri Oct 3 08:32:09 2025 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 4cdMNB0ZNYz69ty4; Fri, 03 Oct 2025 08:32:10 +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 4cdMNB086pz43Mk; Fri, 03 Oct 2025 08:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480330; 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=kv/cANmldTXILSzjdPJnsASyTaGPW8zyXMM1c68wFHA=; b=ktCp/Rrhfe0QiQ/FRMZELr1ktEP+a6N6oUs+WRyTN6wardFTacuVLGgSF7vggoBr1RXIbu ESSs0vDm+ZaAgfPiumZHsJHGwjO9zWRM9m/+wuqaZ78QOCainOcFEPfwNX/tuJWzsljmx/ +BtfW1V2HRdX9gcpOLMYhvpYt89wGIqC9e7Km1doSzNExqYjfcVEGavziU7LkeZ78FuppJ Jbu8idA2pQ8IbOS9TjEMogBpNtFDvPHNEq2kZV0do/as1GU9VZo1fGzrU4gPw3TmWjtiPD MsI3xqWH0KMqoj6TFmOKIWELRUPnb7KH0GTh/BVo4Gg8vOlOfsXqABXL7QW4kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480330; 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=kv/cANmldTXILSzjdPJnsASyTaGPW8zyXMM1c68wFHA=; b=TChotBtciK2QYSO18+EMjTCFuCzkMOaEXZkk84UOyHgiRqBpcXKKB83vl8nZ5ye5WNUA8P MZoqmOxeQ1PFyQvS2nfJba5TloGvI0mOvS3NBs2N1sPCCQtLlRfw2Cdv+y+jgaUVxlSa0g WWqN+BLBYcWP6bB+6kjZOKcM2xQoy1eJj+w958/9XCZ1Sgg1WyYewP+d7o1KJdd4k/gQIH wJIyqNszodaaqPros2x7RPlz6h3xzC6EgKlJ8KRoTaJrw+dpu/OJX+RtCd4KZmxp3ldMwM z5gK3tl9JXUfbR5JrXqT1lFibSSOMF4RLaj53r9N4+Iv82eq2rFL7nSLptJ9YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759480330; a=rsa-sha256; cv=none; b=yxy9gIEQOuozD03PRUc0E2bqpcxoSI9A9L3WdOKxvhvob7ldxeOC3siKNiDeb+0lUbi/9H +Mu4jQqWUv37nVfTXrkz8x5J1niyCup93JxJN/n1ekkvtjug6WbO+UyUK3Iz9UBA9oHWrP gmZpU3SdT+FAR5BzA8YqAkxAsERUvqQgc/qJfJusCr511jxMR+Mh8662nKQBUF7AwCbL6k iL1f3FdbdK5IFIHs8pEIpVFWXePVqo8kSZf/l5fjKB+5ogxeeRr82chmn15f3stgPyFOrD 4GBElaDH3VwDMG6xyBsJevvcpQLdFsGXXDfCeGvE2NZvKVhSwKq0HVLlqwTlqA== 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 4cdMN96qxvzmpq; Fri, 03 Oct 2025 08:32:09 +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 5938W9jt020359; Fri, 3 Oct 2025 08:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5938W9f0020356; Fri, 3 Oct 2025 08:32:09 GMT (envelope-from git) Date: Fri, 3 Oct 2025 08:32:09 GMT Message-Id: <202510030832.5938W9f0020356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3d548504c705 - stable/14 - vtnet: disable hardware TCP LRO by default 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: 3d548504c705ac9a38a0fee2e85985340c1fe488 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3d548504c705ac9a38a0fee2e85985340c1fe488 commit 3d548504c705ac9a38a0fee2e85985340c1fe488 Author: Michael Tuexen AuthorDate: 2025-09-29 23:58:37 +0000 Commit: Michael Tuexen CommitDate: 2025-10-03 08:28:45 +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 Differential Revision: https://reviews.freebsd.org/D52684 (cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e) --- 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 8b96445f0f04..dbe1283eceab 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. .El .Sh TRANSMIT QUEUE STATISTICS diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 38e7e0f48cf4..846b2d49b15d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -282,7 +282,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");