From nobody Fri Nov 13 19:15: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 4jR6RQ3V3gz71722 for ; Fri, 13 Nov 2026 19:15:46 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jR6RQ1Jsvz4b27 for ; Fri, 13 Nov 2026 19:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794597346; 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=NVr/M48Gdx6MHbkHSqbwOCi/clx5LnpqNZWrSgo1t+I=; b=bzTFheN5Kzw3Welmt732cM3dkx6Vg7azAhk45O1b30iJS9u3wm6SSZkhnqhQagucFvWu9h EhS+4wos7jaQdEkxFmQMJxqHqY//Awz92saWC31GIhVAKC/OElBdShCuTRFPtO0prAqd4P sFdiiU36jETGL69h68ASj492QlRuCbkNxTJSbcRyIpx79PnQzTF9zL6DVsyUFtA0I/o9Cp iRQCrvcpPZgDtWAPL8Cv2fir7lMGI1tPoCyK1wLkqo7zsgSHfUhxB06G7c3286JEcHPzQx ZgJmBVv9pl5J63/s3IeC+ecu7IsCOtWu6Mt0AaR146OSwAieoAg7Fyj30hY27w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794597346; b=XHNr5i3blzohRRvVH+JmEOs+QwyOx0MFNwklPOszodcTvi2Agr32OVzY1OMxvovwbz+zs8 ZGUQStUzXVGjTcqwh/Em7WUx1IWcCUSnz70TCoMY0l4XHh2LNCZAIxaCi4Qk7xLwK9zOUn ql7ZBFW84zq9u+SlDW5D04PxKk9dmZPGDDsB4fFMWhIIckCME+/2XzXAbGk7QFDui4TUOn FX411CBVezuWXmFr4GDGYsahY+h0QY4JqX7bM4yvKy44CTzOWujhD4vr1eiT+VGkYdO0Tl bLQU6OJAtqTxOz7P61FPNfFtcXgEjaB7OZ1Pno9M5vzQmZuiNemy3DrtVAxgag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794597346; 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=NVr/M48Gdx6MHbkHSqbwOCi/clx5LnpqNZWrSgo1t+I=; b=X2BwdEFL+5sarJlA/LOqKCS3dwQ7vYPuvkyR2hWs0wi982JFnnxmerymLnYITGjS3be96T GZ/rEN6uMyhom0QxqqyPhJXhhgHPcwGhCghTmKwEanIVkohuifZKSzkiIQmY7oQxjehRNp 8KfTyNujKz5xzq2u9x3ukpr9cxnlhvJ//Mdw9UYkvXSDghI6oyif2nHFYgIvISXUdv2556 Eaki6/UgBZXJ+ar6z8lM2WiCIsTITpTlC4tP5R/fxX8wkIpNBN4YqX7xx6DNG49RFETvE0 0pngJgafFGIJ7GaiNA42BflkG4yunC+YOCEMX9ox6MYt1soE+cW2HcUra95+MQ== 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 4jR6RQ0hHGzp3M for ; Fri, 13 Nov 2026 19:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20962 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 13 Nov 2026 19:15:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roman Bogorodskiy Subject: git: 6db2770210b6 - stable/14 - vtnet: honor the advertised MTU limit on attach List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: novel X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6db2770210b6595ae75346eee67042dd5ffc8e81 Auto-Submitted: auto-generated Date: Fri, 13 Nov 2026 19:15:46 +0000 Message-Id: <6af761e2.20962.31999d0a@gitrepo.freebsd.org> The branch stable/14 has been updated by novel: URL: https://cgit.FreeBSD.org/src/commit/?id=6db2770210b6595ae75346eee67042dd5ffc8e81 commit 6db2770210b6595ae75346eee67042dd5ffc8e81 Author: Roman Bogorodskiy AuthorDate: 2026-10-29 18:24:15 +0000 Commit: Roman Bogorodskiy CommitDate: 2026-11-13 19:14:28 +0000 vtnet: honor the advertised MTU limit on attach When VIRTIO_NET_F_MTU is negotiated, virtio_net_config.mtu specifies the maximum MTU the driver may use. vtnet_ioctl_mtu() enforces this limit for subsequent MTU changes, but ether_ifattach() unconditionally initializes the interface MTU to ETHERMTU (1500). So a device advertising a maximum below 1500 starts with an MTU above its limit. So make sure to set the initial MTU no larger than vtnet_max_mtu. That is, for vtnet_max_mtu less than 1500 interface MTU will be set to this value, otherwise the current behaviour is preserved, MTU will be set to 1500. Reviewed by: kfv, tuexen Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60980 (cherry picked from commit 0974ef03b43f279f16289ad4d5be3a03923983ea) --- sys/dev/virtio/network/if_vtnet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 28a161ecd924..440879f65893 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1194,6 +1194,8 @@ vtnet_setup_interface(struct vtnet_softc *sc) } ether_ifattach(ifp, sc->vtnet_hwaddr); + if (if_getmtu(ifp) > sc->vtnet_max_mtu) + if_setmtu(ifp, sc->vtnet_max_mtu); /* Tell the upper layer(s) we support long frames. */ if_setifheaderlen(ifp, sizeof(struct ether_vlan_header));