From: Vladimir Oltean <olteanv@gmail.com>
To: Michael Walle <michael@walle.cc>
Cc: "Jakub Kicinski" <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, "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: Re: [PATCH v2 net 5/6] net: enetc: don't disable VLAN filtering in IFF_PROMISC mode
Date: Mon, 1 Mar 2021 17:08:52 +0200 [thread overview]
Message-ID: <20210301150852.ejyouycigwu6o5ht@skbuf> (raw)
In-Reply-To: <bfb5a084bfb17f9fdd0ea05ba519441b@walle.cc>
On Mon, Mar 01, 2021 at 03:36:15PM +0100, Michael Walle wrote:
> Ok, I see, so your proposed behavior is backed by the standards. But
> OTOH there was a summary by Markus of the behavior of other drivers:
> https://lore.kernel.org/netdev/20201119153751.ix73o5h4n6dgv4az@ipetronik.com/
> And a conclusion by Jakub:
> https://lore.kernel.org/netdev/20201112164457.6af0fbaf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/#t
> And a propsed core change to disable vlan filtering with promisc mode.
> Do I understand you correctly, that this shouldn't be done either?
>
> Don't get me wrong, I don't vote against or in favor of this patch.
> I just want to understand the behavior.
So you can involuntarily ignore a standard, or you can ignore it
deliberately. I can't force anyone to not ignore it in the latter case,
but indeed, now that I tried to look it up, I personally don't think
that promiscuity should disable VLAN filtering unless somebody comes up
with a good reason for which Linux should basically disregard IEEE 802.3.
In particular, Jakub seems to have been convinced in that thread by no
other argument except that other drivers ignore the standards too, which
I'm not sure is a convincing enough argument.
In my opinion, the fact that some drivers disable VLAN filtering should
be treated like a marginal condition, similar to how, when you set the
MTU on an interface to N octets, it might happen that it accepts packets
larger than N octets, but it isn't guaranteed.
> I haven't had time to actually test this, but what if you do:
> - don't load the 8021q module (or don't enable kernel support)
> - enable promisc
> (1)
> - load 8021q module
> (2)
> - add a vlan interface
> (3)
> - add another vlan interface
> (4)
>
> What frames would you actually receive on the base interface
> in (1), (2), (3), (4) and what is the user expectation?
> I'd say its the same every time. (IIRC there is already some
> discrepancy due to the VLAN filter hardware offloading)
The default value is:
ethtool -k eno0 | grep rx-vlan-filter
rx-vlan-filter: off
so we receive all VLAN-tagged packets by default in enetc, unless VLAN
filtering is turned on.
> > I chose option 2 because it was way simpler and was just as correct.
>
> Fair, but it will also put additional burden to the user to also
> disable the vlan filtering, right?. Otherwise it would just work. And
> it will waste CPU cycles for unwanted frames.
> Although your new patch version contains a new "(yet)" ;)
True, nobody said it's optimal, but you can't make progress if you
always try to do things optimally the first time (but at least you
should do something that's not wrong).
Adding the dev_uc_add, dev_mc_add and vlan_vid_add calls to
net/sched/cls_flower.c doesn't seem an impossible task (especially since
all of them are refcounted, it should be pretty simple to avoid strange
interactions with other layers such as 8021q), but nonetheless, it just
wasn't (and still isn't) high enough on my list of priorities.
next prev parent reply other threads:[~2021-03-01 15:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 12:18 [PATCH v2 net 0/6] Fixes for NXP ENETC driver Vladimir Oltean
2021-02-25 12:18 ` [PATCH v2 net 1/6] net: enetc: don't overwrite the RSS indirection table when initializing Vladimir Oltean
2021-02-25 12:18 ` [PATCH v2 net 2/6] net: enetc: initialize RFS/RSS memories for unused ports too Vladimir Oltean
2021-02-27 13:19 ` Michael Walle
2021-02-25 12:18 ` [PATCH v2 net 3/6] net: enetc: take the MDIO lock only once per NAPI poll cycle Vladimir Oltean
2021-02-25 22:52 ` Andrew Lunn
2021-02-25 23:00 ` Vladimir Oltean
2021-02-25 23:08 ` Vladimir Oltean
2021-02-25 12:18 ` [PATCH v2 net 4/6] net: enetc: fix incorrect TPID when receiving 802.1ad tagged packets Vladimir Oltean
2021-02-25 12:18 ` [PATCH v2 net 5/6] net: enetc: don't disable VLAN filtering in IFF_PROMISC mode Vladimir Oltean
2021-02-26 23:28 ` Jakub Kicinski
2021-02-26 23:42 ` Vladimir Oltean
2021-02-26 23:49 ` Jakub Kicinski
2021-02-27 0:16 ` Vladimir Oltean
2021-02-27 0:45 ` Jakub Kicinski
2021-02-27 0:49 ` Vladimir Oltean
2021-02-27 13:18 ` Michael Walle
2021-02-28 22:48 ` Vladimir Oltean
2021-03-01 14:36 ` Michael Walle
2021-03-01 15:08 ` Vladimir Oltean [this message]
2021-03-01 16:26 ` Markus Blöchl
2021-03-01 17:02 ` Vladimir Oltean
2021-03-01 20:17 ` Jakub Kicinski
2021-02-25 12:18 ` [PATCH v2 net 6/6] net: enetc: force the RGMII speed and duplex instead of operating in inband mode Vladimir Oltean
2021-02-25 17:14 ` Russell King - ARM Linux admin
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=20210301150852.ejyouycigwu6o5ht@skbuf \
--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