From: Vladimir Oltean <olteanv@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org
Cc: "Michael Walle" <michael@walle.cc>,
"Claudiu Manoil" <claudiu.manoil@nxp.com>,
"Alexandru Marginean" <alexandru.marginean@nxp.com>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>,
"Markus Blöchl" <Markus.Bloechl@ipetronik.com>
Subject: [PATCH net 5/6] net: enetc: don't disable VLAN filtering in IFF_PROMISC mode
Date: Thu, 25 Feb 2021 13:23:56 +0200 [thread overview]
Message-ID: <20210225112357.3785911-6-olteanv@gmail.com> (raw)
In-Reply-To: <20210225112357.3785911-1-olteanv@gmail.com>
From: Vladimir Oltean <vladimir.oltean@nxp.com>
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/
So we should avoid that and delete the bogus logic in enetc.
Fixes: 7070eea5e95a ("enetc: permit configuration of rx-vlan-filter with ethtool")
Cc: Markus Blöchl <Markus.Bloechl@ipetronik.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/freescale/enetc/enetc_pf.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 62ba4bf56f0d..49681a0566ed 100644
--- 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 net_device *ndev)
{
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 net_device *ndev)
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 */
--
2.25.1
next prev parent reply other threads:[~2021-02-25 11:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 11:23 [PATCH net 0/6] Fixes for NXP ENETC driver Vladimir Oltean
2021-02-25 11:23 ` [PATCH net 1/6] net: enetc: don't overwrite the RSS indirection table when initializing Vladimir Oltean
2021-02-25 11:23 ` [PATCH net 2/6] net: enetc: initialize RFS/RSS memories for unused ports too Vladimir Oltean
2021-02-25 11:23 ` [PATCH net 3/6] net: enetc: take the MDIO lock only once per NAPI poll cycle Vladimir Oltean
2021-02-25 11:23 ` [PATCH net 4/6] net: enetc: fix incorrect TPID when receiving 802.1ad tagged packets Vladimir Oltean
2021-02-25 11:23 ` Vladimir Oltean [this message]
2021-02-25 11:23 ` [PATCH net 6/6] net: enetc: force the RGMII speed and duplex instead of operating in inband mode Vladimir Oltean
2021-02-25 11:29 ` Russell King - ARM Linux admin
2021-02-25 12:13 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210225112357.3785911-6-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=Markus.Bloechl@ipetronik.com \
--cc=alexandru.marginean@nxp.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).