[Bridge] [PATCH net-next 0/5] Switchdev: flooding offload option

2018-03-09 Thread Igor Mitsyanko
switchdev-capable hardware only. Switchdev hardware will than take care about flooding to the rest of the ports that it manages. Igor Mitsyanko (5): bridge: initialize port flags with switchdev defaults bridge: propagate BR_ flags updates through sysfs to switchdev bridge: allow switchdev

[Bridge] [PATCH net-next 2/5] bridge: propagate BR_ flags updates through sysfs to switchdev

2018-03-09 Thread Igor Mitsyanko
sysfs interface to configure bridge flags only updates SW copy but does not notify hardware through switchdev interface. Make sure it is. Signed-off-by: Igor Mitsyanko --- net/bridge/br_sysfs_if.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/net/bridge

[Bridge] [RFC PATCH net-next 5/5] bridge: verify "HW only" flags can't be set without HW support

2018-03-09 Thread Igor Mitsyanko
Setting bridge flag BR_FLOOD_OFFLOAD only makes sense if underlying port hardware advertises support for it. Make sure kernel checks that condition before allowing to update the flag value. Signed-off-by: Igor Mitsyanko --- net/bridge/br_private.h | 5 - 1 file changed, 4 insertions(+), 1

[Bridge] [RFC PATCH net-next 4/5] bridge: provide sysfs and netlink interface to set BR_FLOOD_OFFLOAD

2018-03-09 Thread Igor Mitsyanko
Allow to modify BR_FLOOD_OFFLOAD flag value through both sysfs and netlink interface. Signed-off-by: Igor Mitsyanko --- include/uapi/linux/if_link.h | 1 + net/bridge/br_netlink.c | 8 +++- net/bridge/br_sysfs_if.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff

[Bridge] [PATCH net-next 1/5] bridge: initialize port flags with switchdev defaults

2018-03-09 Thread Igor Mitsyanko
Default bridge port flags for switchdev devices can be different from what is used in bridging core. Get default value from switchdev itself on port initialization. Signed-off-by: Igor Mitsyanko --- net/bridge/br_if.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff

[Bridge] [RFC PATCH net-next 3/5] bridge: allow switchdev port to handle flooding by itself

2018-03-09 Thread Igor Mitsyanko
can simply advertise BR_FLOOD_OFFLOAD port flag. Note: current implementation can only handle a single switchdev-capable device in a single port. Frame will be flooded as usual to all ports of any additional switchdev present in a given bridge. Signed-off-by: Igor Mitsyanko --- include/linux

Re: [Bridge] [PATCH net-next 1/5] bridge: initialize port flags with switchdev defaults

2018-03-12 Thread Igor Mitsyanko
On 03/10/2018 08:30 AM, Andrew Lunn wrote: + + ret = switchdev_port_attr_get(dev, &attr); + if (ret) + return BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD | BR_BCAST_FLOOD; Hi Igor Please check if ret == -EOPNOTSUPP and only then use the defaults. A real error should be propaga

Re: [Bridge] [PATCH net-next 1/5] bridge: initialize port flags with switchdev defaults

2018-03-12 Thread Igor Mitsyanko
On 03/10/2018 08:32 AM, Stephen Hemminger wrote: Yes hardware devices may come it with different default values. But the user experience on Linux needs to be consistent. Instead, it makes more sense to me for each device driver using switchdev to program to the values that it sees in the bridge.

Re: [Bridge] [PATCH net-next 2/5] bridge: propagate BR_ flags updates through sysfs to switchdev

2018-03-12 Thread Igor Mitsyanko
On 03/10/2018 08:38 AM, Andrew Lunn wrote: + return 0; + + err = br_switchdev_set_port_flag(p, flags, mask); + if (err) + return err; You might want to consider the br_warn() in br_switchdev_set_port_flag(). Do we want to spam the kernel log? Or should store_f

Re: [Bridge] [RFC PATCH net-next 3/5] bridge: allow switchdev port to handle flooding by itself

2018-03-12 Thread Igor Mitsyanko
On 03/10/2018 08:55 AM, Andrew Lunn wrote: Is this sufficiently granular? There are a few different use cases for flooding: There is no fdb entry in the software switch for the destination MAC address, so flood the packet out all ports of the bridge. The hardware switch might have an entry in it

Re: [Bridge] [PATCH net-next 0/5] Switchdev: flooding offload option

2018-03-12 Thread Igor Mitsyanko
On 03/10/2018 02:08 PM, Andrew Lunn wrote: Hi Igor You don't appear to be adding any user of this. Please also make one of the switchdev drivers actually use this new functionality. Andrew Hi Andrew, a first user is supposed to be drivers/net/wireless/quantenna/qtnfmac wifi driver. I w