From: Florian Fainelli <f.fainelli@gmail.com>
To: Ido Schimmel <idosch@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
Jiri Pirko <jiri@mellanox.com>,
"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
"ivan.khoronzhuk@linaro.org" <ivan.khoronzhuk@linaro.org>,
"roopa@cumulusnetworks.com" <roopa@cumulusnetworks.com>,
"nikolay@cumulusnetworks.com" <nikolay@cumulusnetworks.com>
Subject: Re: [PATCH net-next 09/14] net: bridge: Propagate MC addresses with VID through switchdev
Date: Fri, 18 Jan 2019 13:48:56 -0800 [thread overview]
Message-ID: <cb28b752-e855-2d63-1c98-61c55bb5a6bd@gmail.com> (raw)
In-Reply-To: <20190118114100.GA4763@splinter>
On 1/18/19 3:41 AM, Ido Schimmel wrote:
> On Thu, Jan 17, 2019 at 11:17:57AM -0800, Florian Fainelli wrote:
>> On 1/17/19 6:05 AM, Ido Schimmel wrote:
>>> On Wed, Jan 16, 2019 at 12:00:57PM -0800, Florian Fainelli wrote:
>>>> In order for bridge port members to get a chance to implement unicast
>>>> and multicast address filtering correctly, which would matter for e.g:
>>>> switch network devices, synchronize the UC and MC lists down to the
>>>> individual bridge port members using switchdev HOST_MDB objects such
>>>> that this does not impact drivers that already have a ndo_set_rx_mode()
>>>> operation which likely already operate in promiscuous mode.
>>>>
>>>> When the bridge has multicast snooping enabled, proper HOST_MDB
>>>> notifications will be sent through br_mdb_notify() already.
>>>
>>> I don't understand the change. HOST_MDB is used to notify underlying
>>> drivers about MDB entries that should be configured to locally receive
>>> packets. This is triggered by the transmission of an IGMP report through
>>> the bridge, for example.
>>>
>>> It seems that you're trying to overload HOST_MDB with multicast address
>>> filtering on bridge ports?
>>
>> I don't really think this is an abuse of HOST_MDB, since in case the
>> bridge has multicast_snooping enabled, and there is e.g: a multicast
>> application bound to the bridge master device, we would get those
>> notifications through HOST_MDB already. This is the same use case that I
>> am addressing here, ndo_set_rx_mode() learns about local multicast
>> addresses that should be programmed, which means there is a multicast
>> application listening on the bridge master device itself.
>>
>> The problem that I want to solve is that with Broadcom b53/bcm_sf2
>> switches, we cannot easily filter/flood multicast for the CPU/management
>> port.
>>
>> We have per-port controls for MC/IPMC flooding, and we also have a
>> separate control for CPU/management port receiving multicast. If either
>> of these two bits/settings are configured, then the CPU port will always
>> receive multicast, even when we should be filtering it in HW. The only
>> way to perform selective reception of multicast to the CPU port is to
>> program a corresponding MDB entry.
>>
>>> Why are you performing this filtering?
>>
>> If I do not filter, then non-bridged ports on which there is no
>> multicast application bound to would be passing up multicast traffic all
>> the way to the CPU port, which then has to be dropped in software. This
>> is not acceptable IMHO because it is a deviation from how a standalone
>> NIC supporting multicast filtering would operate.
>>
>>> Shouldn't you allow all MAC addresses to ingress?
>>
>> I do allow all MC addresses to ingress on the front-panel switch ports
>> (while honoring the multicast_snooping setting), but we have no control
>> over what the CPU/management port should be doing.
>>
>> As I wrote earlier, if we flood to the CPU/management port, because
>> there is at least one switch device port, in the bridge, and that bridge
>> has multicast_snooping disabled, then this could break filtering for
>> other, non-bridged ports. That is really not acceptable IMHO.
>>
>> The reason why I chose switchdev HOST_MDB notification here are two fold:
>>
>> - this is the same use case as with multicast_snooping=1 and we target
>> the CPU port within DSA to resolve that use case, so from the switch
>> driver perspective, there is no difference in the context
>>
>> - this does not impact network device drivers that have a
>> ndo_set_rx_mode() and somehow decide to support things through that API
>> since those would typically have a switchdev_port_attr_set() callback
>
> HOST_MDB was added for a very specific use case. To allow the bridge
> driver to notify underlying switch drivers about MDB entries that should
> be programmed to locally receive packets when multicast is enabled.
> Andrew described it very nicely in merge commit
> 5d37636abd15ace8686a54167b488364ee79e88d
>
> Ingress filtering is something completely different and not applicable
> to bridged ports that should allow every address to ingress.
I actually made a mistake in this patch because there is no need to
iterate over the switch port members and generate a HOST_MDB
notification for each of them because what we want to target is the CPU
port, which DSA internally resolves for us anyway.
What we want to tell the switch HW here is basically: you have a
multicast application bound to the bridge master device, so please let
this MC address go through your CPU/management port. This is effectively
egress filtering at the CPU port side.
Because the bridge has multicast_snooping=false, the switch ports have
been configured to flood MC/IPMC already, but as I wrote, if we do that
for the CPU port, then we "break" non-bridge ports.
It seems to me that this is exactly the same use case that what Andrew
did originally, and drivers that are not pathological like mine can just
decide to ignore that notification and flood everything to the CPU port.
The end results would be the same from an end user perspective.
Do you still think this is too much of a stretch?
>
> switchdev allows to offload the bridge datapath to capable devices, but
> you're abusing to it allow non-bridged ports to perform address
> filtering. Completely unrelated.
>
> Therefore, it seems completely inappropriate to me to use HOST_MDB for
> this reason. This applies to patch #10 as well.
>
> It really sounds like the HW you're working with is not designed to work
> in this mixed state where some ports are bridged and some are expected to
> act as standalone NICs.
That is quite true, the HW that I work with is limited, and does not
really play well with mixed port usage, but with the help of the network
stack and notifications, we can get very close, or even support it.
One thing that I forgot to explain is that the Ethernet MAC connected to
its internal bcm_sf2 switch, because it is only used with an integrated
switch has been greatly simplified, it does not support any type of
filtering and relies on the switch to do that. It effectively operates
in promiscuous mode all the time.
>
> If you're still determined to support this use case, I suggest the
> following. In your driver, program the bridge's address list as MDB
> entries when the first port is enslaved to it. Then, add a new netdev
> event whenever an address is added / removed from this list (in
> __dev_set_rx_mode() ?). Have your driver listen to it and program MDB
> entries accordingly.
>
--
Florian
next prev parent reply other threads:[~2019-01-18 21:49 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 20:00 [PATCH net-next 00/14] net: dsa: management mode for bcm_sf2 Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 01/14] net: bridge: multicast: Propagate br_mc_disabled_update() return Florian Fainelli
2019-01-17 13:47 ` Ido Schimmel
2019-01-17 19:27 ` Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 02/14] net: dsa: b53: Fix default VLAN ID Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 03/14] net: dsa: b53: Properly account for VLAN filtering Florian Fainelli
2019-01-17 16:36 ` Vivien Didelot
2019-01-17 17:48 ` Florian Fainelli
2019-01-17 18:47 ` Vivien Didelot
2019-01-17 19:06 ` Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 04/14] net: systemport: Fix reception of BPDUs Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 05/14] net: dsa: b53: Define registers for IGMP snooping Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 06/14] net: dsa: b53: Add support for MDB Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 07/14] net: dsa: Add ability to program multicast filter for CPU port Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 08/14] net: dsa: Add ndo_vlan_rx_{add,kill}_vid implementation Florian Fainelli
2019-01-16 20:00 ` [PATCH net-next 09/14] net: bridge: Propagate MC addresses with VID through switchdev Florian Fainelli
2019-01-17 14:05 ` Ido Schimmel
2019-01-17 19:17 ` Florian Fainelli
2019-01-18 10:43 ` Ido Schimmel
2019-01-18 11:41 ` Ido Schimmel
2019-01-18 21:48 ` Florian Fainelli [this message]
2019-01-19 13:55 ` Ido Schimmel
2019-01-20 3:22 ` Florian Fainelli
2019-01-21 8:41 ` Ido Schimmel
2019-01-21 8:46 ` Jiri Pirko
2019-01-16 20:00 ` [PATCH net-next 10/14] net: vlan: " Florian Fainelli
2019-01-17 14:49 ` Ido Schimmel
2019-01-17 19:12 ` Florian Fainelli
2019-01-21 9:13 ` Ido Schimmel
2019-01-21 9:17 ` Ilias Apalodimas
2019-01-22 11:30 ` Ivan Khoronzhuk
2019-01-22 11:39 ` Ivan Khoronzhuk
2019-01-16 20:00 ` [PATCH net-next 11/14] net: dsa: Make VLAN filtering use DSA notifiers Florian Fainelli
2019-01-16 20:01 ` [PATCH net-next 12/14] net: dsa: Wire up multicast IGMP snooping attribute notification Florian Fainelli
2019-01-17 18:36 ` Vivien Didelot
2019-01-17 19:07 ` Florian Fainelli
2019-01-16 20:01 ` [PATCH net-next 13/14] net: dsa: b53: Add support for toggling IGMP snooping Florian Fainelli
2019-01-16 20:01 ` [PATCH net-next 14/14] net: dsa: bcm_sf2: Enable management mode 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=cb28b752-e855-2d63-1c98-61c55bb5a6bd@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=ilias.apalodimas@linaro.org \
--cc=ivan.khoronzhuk@linaro.org \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
--cc=vivien.didelot@gmail.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).