Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3514238pxf; Mon, 15 Mar 2021 11:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEfYtW/paVSfo8255sTjIVB4snW1lvPF3QT7MP2bgJiP/Piq1iXIuZY+omhvMDa2VwNwBH X-Received: by 2002:a17:907:119b:: with SMTP id uz27mr24746330ejb.464.1615832022511; Mon, 15 Mar 2021 11:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832022; cv=none; d=google.com; s=arc-20160816; b=HYFx2NV1W7TxHp8wlUBRi5KAwqOvk8rRZLKJlBNB1fPEWvcUCDRe4p4BjO07bLLJ9O gByslqgVuQHgpJrcurIgiXCep6bkiQYuOZlXRQTQmmVZBgacMzY/+ExaYgnq5Hd5wd1f cy3gyt12qzMJo/h7Dvab1iPfOOvNUg40brsVqCqfsavjVWJhPQyajwxCbktP0YsYja5o t9AloV3/DmVGxBc6RSLdZhHU3zYLispfHm9+Nar3eexCnI2/T93O0YhlYaMuOs/BAHhB hYUApfAdltSO1/d8j3+OzdeP3vGuVpJfQrN+cz2I+OaGm2a1X3g3T8C2AhCpal3shDff R0SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CaZkFKYTdMluGOCmjxYrLypEgwYLw9HhWfpOs+tk6i0=; b=ucBaIMxSbVU1gomgiwz4UcE5VZhJkvbll2XI/c/xWhSI133RCleumIXL2R+mSDbvx8 fjsZpfgE8j6d9XusfxcFpTc20wTBvUxWycVUx+87W8V4RB9Miqw+q5BG1GVV5LQzetzk 3PrUnRREvNHo3waB9LTnG/k/m3nztfLX51zyRBQ2bdFxs0tOzcauXX1HI0cYsf6U5LQw vPD51bXFdJIrV8IEeIW/m9I4HMuq4E6J8nEjAnvQiMtR1OvKhEcCCv0Ww7/zD5lEi4TF Se4oj/yrzFNtFoRvVIANlV64MkSVTgEzFm8BNoOQJwMW9Us3+nDLadQh44W0yjI5RNNz D25Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UatkTrI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si11403369edx.595.2021.03.15.11.13.20; Mon, 15 Mar 2021 11:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UatkTrI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235911AbhCOOLw (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbhCON5l (ORCPT ); Mon, 15 Mar 2021 09:57:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 20FEE64F0D; Mon, 15 Mar 2021 13:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816661; bh=KyhRkJu76SQjITrL0Y+C/w9/g1Uj7Z66XJy9r1h2G1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UatkTrI3mPOs6HsZSIbSlypRfWFd+Jsxw3gcpX7uqEZ3ojX+rZU2U9oEOSsPW0Nli Vh2cXO9gXot/N/h7TAH99+0xJBXFlzSKIyc/81DYmK8QxVYHPc4ds/627g7gTtr78V lSmOlRDYLbdBfNivGtis0D6Gnb0rb+PNfYebKZIY= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Markus=20Bl=C3=B6chl?= , Vladimir Oltean , "David S. Miller" Subject: [PATCH 5.10 040/290] net: enetc: dont disable VLAN filtering in IFF_PROMISC mode Date: Mon, 15 Mar 2021 14:52:13 +0100 Message-Id: <20210315135543.278204175@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Vladimir Oltean commit a74dbce9d4541888fe0d39afe69a3a95004669b4 upstream. Quoting from the blamed commit: In promiscuous mode, it is more intuitive that all traffic is received, including VLAN tagged traffic. It appears that it is necessary to set the flag in PSIPVMR for that to be the case, so VLAN promiscuous mode is also temporarily enabled. On exit from promiscuous mode, the setting made by ethtool is restored. Intuitive or not, there isn't any definition issued by a standards body which says that promiscuity has anything to do with VLAN filtering - it only has to do with accepting packets regardless of destination MAC address. In fact people are already trying to use this misunderstanding/bug of the enetc driver as a justification to transform promiscuity into something it never was about: accepting every packet (maybe that would be the "rx-all" netdev feature?): https://lore.kernel.org/netdev/20201110153958.ci5ekor3o2ekg3ky@ipetronik.com/ This is relevant because there are use cases in the kernel (such as tc-flower rules with the protocol 802.1Q and a vlan_id key) which do not (yet) use the vlan_vid_add API to be compatible with VLAN-filtering NICs such as enetc, so for those, disabling rx-vlan-filter is currently the only right solution to make these setups work: https://lore.kernel.org/netdev/CA+h21hoxwRdhq4y+w8Kwgm74d4cA0xLeiHTrmT-VpSaM7obhkg@mail.gmail.com/ The blamed patch has unintentionally introduced one more way for this to work, which is to enable IFF_PROMISC, however this is non-portable because port promiscuity is not meant to disable VLAN filtering. Therefore, it could invite people to write broken scripts for enetc, and then wonder why they are broken when migrating to other drivers that don't handle promiscuity in the same way. Fixes: 7070eea5e95a ("enetc: permit configuration of rx-vlan-filter with ethtool") Cc: Markus Blöchl Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/enetc/enetc_pf.c | 5 ----- 1 file changed, 5 deletions(-) --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -190,7 +190,6 @@ static void enetc_pf_set_rx_mode(struct { struct enetc_ndev_priv *priv = netdev_priv(ndev); struct enetc_pf *pf = enetc_si_priv(priv->si); - char vlan_promisc_simap = pf->vlan_promisc_simap; struct enetc_hw *hw = &priv->si->hw; bool uprom = false, mprom = false; struct enetc_mac_filter *filter; @@ -203,16 +202,12 @@ static void enetc_pf_set_rx_mode(struct psipmr = ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0); uprom = true; mprom = true; - /* Enable VLAN promiscuous mode for SI0 (PF) */ - vlan_promisc_simap |= BIT(0); } else if (ndev->flags & IFF_ALLMULTI) { /* enable multi cast promisc mode for SI0 (PF) */ psipmr = ENETC_PSIPMR_SET_MP(0); mprom = true; } - enetc_set_vlan_promisc(&pf->si->hw, vlan_promisc_simap); - /* first 2 filter entries belong to PF */ if (!uprom) { /* Update unicast filters */