From nobody Fri Nov 13 18:33:44 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 4jR5Vx0QYYz713Z5 for ; Fri, 13 Nov 2026 18:33:45 +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 4jR5Vw6bRhz4N1V for ; Fri, 13 Nov 2026 18:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794594824; 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=Fvc4P0ZkmQuK022vs2ZE6rZSRhAFH+wme74f7jHrzmE=; b=H6dbZVtaHXLGHRoOwgh0X+CCYrM9DlWfAOkNG0vO6yq4b+6RrnKbyQGyU0T+GEPeQIGNrz CXONiU2CzEz7iu994MM2CHAUQtys+Uenstvxjjum2vZ5x33pNFko0wGiH2IqXn4FEc7L4M slxbAHaSDSQRQk2hOt6LH3/h2LSIcIB9x8WxnLfhSND3p84keLS2CkQQEnQ5BKIDXqgcVP rM0dUeL7MIU/yC/p0I4sx1MSmNbeV4zmkIG5y8VVi0fxzY3z1itePgs8PzY0b0iVu4+83y U99SEwIEpk33jtvqYbUdsXJzRKJJF+nByN0YdydiVxk3NokwvkhIAfUeNgiWxQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794594824; b=gHNc9qY1NJmMtU0mZk8vxexqK9ZbnnPFzJWqarMhWeBEvxE+qIsB4eiDSOO1EAmp7M9u8R DE8EAZkhwdWEM8Eu5d1rySZpEt8t0vO6clKA4Uo+xxC1mVNNG5mkQ/mv2k/PYqsZg5EAqO eQudJV+Dau25vsID+nbNcTZRUHdQynoIt4UvYgNTToM9GBhHQIs89LuMEKET+fmBaJJ/2b vLGSlMNUeDiNPe4bM0WD7+oNt8bsLXfzsZVuhkabYeSl6E9ir/OjF23rTU9hGm3cPstidk Z3L0xna8w6lqvJleneVP8JMxymz6urFhfQKxwJrR6sKlPmiavw8EuWm7Jrw+UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794594824; 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=Fvc4P0ZkmQuK022vs2ZE6rZSRhAFH+wme74f7jHrzmE=; b=SO/h6d6nCFokvl9Xy2DLcLL12IDd+YRVgSAffEFvYmO2flMJiwgMDhk7Rhi51KmePNdIBq wpkTCXyxGn+Mq7z7UWNNIP+IQnR9kSuSXkyERGsUIJ8wAvdKEcosIe85IZSqJ9vcrs9RVr Xj+8tiCbh8OAEFFjeU79quZinU4l29xDiVWr0U+Az83iuY+XbCNHC5VtMQT4xE4nwnCOlD X0FsZs1Fnhllr88likovmzJq2aaqRpRoSv6I8JRkSD5+CjejSjJ9jq+BUrmCUHhzfjUHxX wuJM3poro+LsCMd3cznzns2p1UrT6fBIOa9+hHiqpcTj9KZOXWNs+piob0ysQA== 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 4jR5Vw6GC4zmX0 for ; Fri, 13 Nov 2026 18:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f003 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 13 Nov 2026 18:33:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roman Bogorodskiy Subject: git: d03e991d067d - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: d03e991d067da14a4fb290ccc10a2a46324d9a8b Auto-Submitted: auto-generated Date: Fri, 13 Nov 2026 18:33:44 +0000 Message-Id: <6af75808.1f003.3a1d526f@gitrepo.freebsd.org> The branch stable/15 has been updated by novel: URL: https://cgit.FreeBSD.org/src/commit/?id=d03e991d067da14a4fb290ccc10a2a46324d9a8b commit d03e991d067da14a4fb290ccc10a2a46324d9a8b Author: Roman Bogorodskiy AuthorDate: 2026-10-29 18:24:15 +0000 Commit: Roman Bogorodskiy CommitDate: 2026-11-13 17:54:34 +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 05cc51f16228..180f128717a7 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1338,6 +1338,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));