From owner-dev-commits-src-all@freebsd.org Tue Jan 19 05:08:21 2021 Return-Path: Delivered-To: dev-commits-src-all@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 0C03D4E5489; Tue, 19 Jan 2021 05:08:21 +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 4DKc9w3dQdz4XW0; Tue, 19 Jan 2021 05:08:20 +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 5E0F220B3D; Tue, 19 Jan 2021 05:08:15 +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 10J58F02085826; Tue, 19 Jan 2021 05:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10J58FdV085825; Tue, 19 Jan 2021 05:08:15 GMT (envelope-from git) Date: Tue, 19 Jan 2021 05:08:15 GMT Message-Id: <202101190508.10J58FdV085825@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: 25dbc30ef5c9 - main - if_vtnet: Remove at attach PROMISC handling 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: 25dbc30ef5c99d8251fd7c43075295ca01049c89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2021 05:08:21 -0000 The branch main has been updated by bryanv: URL: https://cgit.FreeBSD.org/src/commit/?id=25dbc30ef5c99d8251fd7c43075295ca01049c89 commit 25dbc30ef5c99d8251fd7c43075295ca01049c89 Author: Bryan Venteicher AuthorDate: 2021-01-19 04:55:24 +0000 Commit: Bryan Venteicher CommitDate: 2021-01-19 04:55:24 +0000 if_vtnet: Remove at attach PROMISC handling This may have been required in an early, early, early version of the specification but I cannot find any reference to it, and a promiscuous default seems very odd so remove this code. Reviewed by: grehan (mentor) Differential Revision: https://reviews.freebsd.org/D27909 --- sys/dev/virtio/network/if_vtnet.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index f20a798a16ed..4a26e403071d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -201,7 +201,6 @@ static int vtnet_ctrl_mq_cmd(struct vtnet_softc *, uint16_t); static int vtnet_ctrl_rx_cmd(struct vtnet_softc *, uint8_t, int); static int vtnet_set_promisc(struct vtnet_softc *, int); static int vtnet_set_allmulti(struct vtnet_softc *, int); -static void vtnet_attach_disable_promisc(struct vtnet_softc *); static void vtnet_rx_filter(struct vtnet_softc *); static void vtnet_rx_filter_mac(struct vtnet_softc *); static int vtnet_exec_vlan_filter(struct vtnet_softc *, int, uint16_t); @@ -570,8 +569,6 @@ static int vtnet_attach_completed(device_t dev) { - vtnet_attach_disable_promisc(device_get_softc(dev)); - return (0); } @@ -3351,28 +3348,6 @@ vtnet_set_allmulti(struct vtnet_softc *sc, int on) return (vtnet_ctrl_rx_cmd(sc, VIRTIO_NET_CTRL_RX_ALLMULTI, on)); } -/* - * The device defaults to promiscuous mode for backwards compatibility. - * Turn it off at attach time if possible. - */ -static void -vtnet_attach_disable_promisc(struct vtnet_softc *sc) -{ - struct ifnet *ifp; - - ifp = sc->vtnet_ifp; - - VTNET_CORE_LOCK(sc); - if ((sc->vtnet_flags & VTNET_FLAG_CTRL_RX) == 0) { - ifp->if_flags |= IFF_PROMISC; - } else if (vtnet_set_promisc(sc, 0) != 0) { - ifp->if_flags |= IFF_PROMISC; - device_printf(sc->vtnet_dev, - "cannot disable default promiscuous mode\n"); - } - VTNET_CORE_UNLOCK(sc); -} - static void vtnet_rx_filter(struct vtnet_softc *sc) {