From owner-dev-commits-src-main@freebsd.org Tue Jan 19 05:08:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A72E04E534B; Tue, 19 Jan 2021 05:08:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DKc9z3MHhz4XW9; Tue, 19 Jan 2021 05:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C16C820CE5; Tue, 19 Jan 2021 05:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10J58IdY085890; Tue, 19 Jan 2021 05:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10J58Il5085889; Tue, 19 Jan 2021 05:08:18 GMT (envelope-from git) Date: Tue, 19 Jan 2021 05:08:18 GMT Message-Id: <202101190508.10J58Il5085889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Venteicher Subject: git: 2520cd382151 - main - if_vtnet: Only set IFCAP_JUMBO_MTU when jumbo MTU is supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bryanv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2520cd382151a0dd698f23d7eff78f8253cdb657 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2021 05:08:25 -0000 The branch main has been updated by bryanv: URL: https://cgit.FreeBSD.org/src/commit/?id=2520cd382151a0dd698f23d7eff78f8253cdb657 commit 2520cd382151a0dd698f23d7eff78f8253cdb657 Author: Bryan Venteicher AuthorDate: 2021-01-19 04:55:24 +0000 Commit: Bryan Venteicher CommitDate: 2021-01-19 04:55:24 +0000 if_vtnet: Only set IFCAP_JUMBO_MTU when jumbo MTU is supported Reviewed by: grehan (mentor) Differential Revision: https://reviews.freebsd.org/D27912 --- sys/dev/virtio/network/if_vtnet.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 39009a1de3f0..ec1fc8de1a90 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1027,12 +1027,11 @@ vtnet_setup_interface(struct vtnet_softc *sc) vtnet_get_macaddr(sc); ether_ifattach(ifp, sc->vtnet_hwaddr); - if (virtio_with_feature(dev, VIRTIO_NET_F_STATUS)) - ifp->if_capabilities |= IFCAP_LINKSTATE; - /* Tell the upper layer(s) we support long frames. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU; + + if (virtio_with_feature(dev, VIRTIO_NET_F_STATUS)) + ifp->if_capabilities |= IFCAP_LINKSTATE; if (virtio_with_feature(dev, VIRTIO_NET_F_CSUM)) { int gso; @@ -1075,6 +1074,10 @@ vtnet_setup_interface(struct vtnet_softc *sc) IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; } + if (sc->vtnet_max_mtu >= ETHERMTU_JUMBO) + ifp->if_capabilities |= IFCAP_JUMBO_MTU; + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable = ifp->if_capabilities; /*