From: Florian Fainelli <f.fainelli@gmail.com>
To: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
davem@davemloft.net, grygorii.strashko@ti.com
Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, jiri@mellanox.com,
ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next 4/6] ethernet: eth: add default vid len for all ehternet kind devices
Date: Wed, 27 Feb 2019 20:29:20 -0800 [thread overview]
Message-ID: <30890ef3-7da8-8399-7388-cc22e000a67f@gmail.com> (raw)
In-Reply-To: <20190226184556.16082-5-ivan.khoronzhuk@linaro.org>
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote:
> IVDF - individual virtual device filtering. Allows to set per vlan
> l2 address filters on end real network device (for unicast and for
> multicast) and drop redundant not expected packet income.
>
> If CONFIG_VLAN_8021Q_IVDF is enabled the following changes are
> applied, and only for ethernet network devices.
>
> By default every ethernet netdev needs vid len = 2 bytes to be able to
> hold up to 4096 vids. So set it for every eth device to be correct,
> except vlan devs.
>
> In order to shrink all addresses of devices above vlan, the vid_len
> for vlan dev = 0, as result all suckers sync their addresses to common
> base not taking in to account vid part (vid_len of "to" devices is
> important only). And only vlan device is the source of addresses with
> actual its vid set, propagating it to parent devices while rx_mode().
>
> Also, don't bother those ethernet devices that at this moment are not
> moved to vlan addressing scheme, so while end ethernet device is
> created - set vid_len to 0, thus, while syncing, its address space is
> concatenated to one dimensional like usual, and who needs IVDF - set
> it to NET_8021Q_VID_TSIZE.
>
> There is another decision - is to inherit vid_len or some feature flag
> from end root device in order to all upper devices have vlan extended
> address space only if exact end real device have such capability. But
> I didn't, because it requires more changes and probably I'm not
> familiar with all places where it should be inherited, I would
> appreciate if someone can guid where it's applicable, then it could
> become a little bit more limited.
I would think that a call to vlan_dev_ivdf_set() would be enough to
indicate that the underlying network device driver supports IVDF and
wants to make use of it. The infrastructure itself that you added costs
little memory, it is once the call to vlan_dev_ivdf_set() is made that
the memory consumption increases which is fine, since we want to make
use of that feature.
While I appreciate the thoughts given to making this a configurable
option, I feel that enabling it unconditionally and having the
underlying driver decide would be more manageable.
We have had that conversation before, but let me ask again when we call
dev_{uc,mc}_sync() and ultimately the network device's
ndo_set_rx_mode(), by the time the ndo_set_rx_mode() function is called,
we lost track of the call chain, like which virtual device was it
originating from. If we somehow added a notification information about
the network device stack (and we could use netdevice notifiers for
that), then maybe we don't really need to add all of this code and we
can just derive the necessary bits of information we want by checking:
is this a VLAN network device? It is, okay what's your VLAN ID, etc.?
Either approach would get us our cookie anyway :)
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
[snip]
> @@ -404,8 +405,13 @@ EXPORT_SYMBOL(ether_setup);
> struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
> unsigned int rxqs)
> {
> - return alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_UNKNOWN,
> - ether_setup, txqs, rxqs);
> + struct net_device *dev;
> +
> + dev = alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_UNKNOWN,
> + ether_setup, txqs, rxqs);
You need to check the return value of alloc_netdev_mqs() now, otherwise
you could be doing a NPD in the call right under. Since that is the
default though, do you really need to call vlan_dev_ivdf_set() below?
--
Florian
next prev parent reply other threads:[~2019-02-28 4:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 18:45 [PATCH net-next 0/6] net: add individual virtual device filtering Ivan Khoronzhuk
2019-02-26 18:45 ` [PATCH net-next 1/6] net: core: dev_addr_lists: add VID to device address Ivan Khoronzhuk
2019-02-28 4:24 ` Florian Fainelli
2019-03-01 12:21 ` Ivan Khoronzhuk
2019-02-26 18:45 ` [PATCH net-next 2/6] net: 8021q: vlan_dev: add vid tag to addresses of uc and mc lists Ivan Khoronzhuk
2019-02-28 4:09 ` Florian Fainelli
2019-03-01 12:24 ` Ivan Khoronzhuk
2019-03-02 3:19 ` Florian Fainelli
2019-02-26 18:45 ` [PATCH net-next 3/6] net: 8021q: vlan_dev: add vid tag for vlan device own address Ivan Khoronzhuk
2019-02-28 4:13 ` Florian Fainelli
2019-03-01 12:28 ` Ivan Khoronzhuk
2019-03-02 3:24 ` Florian Fainelli
2019-02-26 18:45 ` [PATCH net-next 4/6] ethernet: eth: add default vid len for all ehternet kind devices Ivan Khoronzhuk
2019-02-28 4:29 ` Florian Fainelli [this message]
2019-03-01 13:11 ` Ivan Khoronzhuk
2019-03-02 3:33 ` Florian Fainelli
2019-02-26 18:45 ` [PATCH net-next 5/6] net: ethernet: ti: cpsw: update mc filtering to use IVDF Ivan Khoronzhuk
2019-02-28 4:17 ` Florian Fainelli
2019-02-26 18:45 ` [PATCH net-next 6/6] net: ethernet: ti: cpsw: add macvlan and ucast/vlan filtering support Ivan Khoronzhuk
2019-02-28 0:23 ` [PATCH net-next 0/6] net: add individual virtual device filtering Florian Fainelli
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=30890ef3-7da8-8399-7388-cc22e000a67f@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=ilias.apalodimas@linaro.org \
--cc=ivan.khoronzhuk@linaro.org \
--cc=jiri@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).