Re: [PATCH resend net-next 2/2] net: bridge: switchdev: include local flag in FDB notifications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 14, 2021 at 07:52:56PM +0300, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> 
> As explained in bugfix commit 6ab4c3117aec ("net: bridge: don't notify
> switchdev for local FDB addresses") as well as in this discussion:
> https://lore.kernel.org/netdev/20210117193009.io3nungdwuzmo5f7@skbuf/
> 
> the switchdev notifiers for FDB entries managed to have a zero-day bug,
> which was that drivers would not know what to do with local FDB entries,
> because they were not told that they are local. The bug fix was to
> simply not notify them of those addresses.
> 
> Let us now add the 'is_local' bit to bridge FDB entries, and make all
> drivers ignore these entries by their own choice.
> 
> Co-developed-by: Tobias Waldekranz <tobias@xxxxxxxxxxxxxx>
> Signed-off-by: Tobias Waldekranz <tobias@xxxxxxxxxxxxxx>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>

Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>

One comment below

> diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
> index c390f84adea2..a5e601e41cb9 100644
> --- a/net/bridge/br_switchdev.c
> +++ b/net/bridge/br_switchdev.c
> @@ -114,13 +114,12 @@ br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type)
>  		.addr = fdb->key.addr.addr,
>  		.vid = fdb->key.vlan_id,
>  		.added_by_user = test_bit(BR_FDB_ADDED_BY_USER, &fdb->flags),
> +		.is_local = test_bit(BR_FDB_LOCAL, &fdb->flags),
>  		.offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags),
>  	};
>  
>  	if (!fdb->dst)
>  		return;

Do you plan to eventually remove this check so that entries pointing to
the bridge device itself will be notified? For example:

# bridge fdb add 00:01:02:03:04:05 dev br0 self local

> -	if (test_bit(BR_FDB_LOCAL, &fdb->flags))
> -		return;
>  
>  	switch (type) {
>  	case RTM_DELNEIGH:



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux