Re: [Bridge] [PATCH net-next] bridge: use struct_size() helper

2019-02-08 Thread David Miller
From: "Gustavo A. R. Silva" Date: Thu, 7 Feb 2019 18:58:56 -0600 > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct

[Bridge] [PATCH net-next 16/16] net: Remove switchdev_ops

2019-02-08 Thread Florian Fainelli
Now that we have converted all possible callers to using a switchdev notifier for attributes we do not have a need for implementing switchdev_ops anymore, and this can be removed from all drivers the net_device structure. Signed-off-by: Florian Fainelli ---

Re: [Bridge] [PATCH net-next 15/16] net: switchdev: Replace port attr set SDO with a notification

2019-02-08 Thread Florian Fainelli
On 2/8/19 4:32 PM, Florian Fainelli wrote: > Drop switchdev_ops.switchdev_port_attr_set. Drop the uses of this field > from all clients, which were migrated to use switchdev notification in > the previous patches. > > Add a new function switchdev_port_attr_notify() that sends the switchdev >

[Bridge] [PATCH net-next 15/16] net: switchdev: Replace port attr set SDO with a notification

2019-02-08 Thread Florian Fainelli
Drop switchdev_ops.switchdev_port_attr_set. Drop the uses of this field from all clients, which were migrated to use switchdev notification in the previous patches. Add a new function switchdev_port_attr_notify() that sends the switchdev notifications SWITCHDEV_PORT_ATTR_SET. Drop

[Bridge] [PATCH net-next 13/16] net: mscc: ocelot: Handle SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare ocelot to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing ocelot_port_attr_set()

[Bridge] [PATCH net-next 12/16] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare mlxsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing mlxsw_sp_port_attr_set()

[Bridge] [PATCH net-next 14/16] staging: fsl-dpaa2: ethsw: Handle SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare ethsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing swdev_port_attr_set()

[Bridge] [PATCH net-next 11/16] net: dsa: Handle SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare DSA to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing dsa_slave_port_attr_set()

[Bridge] [PATCH net-next 09/16] switchdev: Add SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
In preparation for allowing switchdev enabled drivers to veto specific attribute settings from within the context of the caller, introduce a new switchdev notifier type for port attributes. Suggested-by: Ido Schimmel Signed-off-by: Florian Fainelli --- include/net/switchdev.h | 9 + 1

[Bridge] [PATCH net-next 10/16] rocker: Handle SWITCHDEV_PORT_ATTR_SET

2019-02-08 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare rocker to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing rocker_port_attr_set

[Bridge] [PATCH net-next 07/16] net: Remove SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT

2019-02-08 Thread Florian Fainelli
Now that we have converted the bridge code and the drivers to check for bridge port(s) flags at the time we try to set them, there is no need for a get() -> set() sequence anymore and SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT therefore becomes unused. Signed-off-by: Florian Fainelli ---

[Bridge] [PATCH net-next 08/16] net: Get rid of switchdev_port_attr_get()

2019-02-08 Thread Florian Fainelli
With the bridge no longer calling switchdev_port_attr_get() to obtain the supported bridge port flags from a driver but instead trying to set the bridge port flags directly and relying on driver to reject unsupported configurations, we can effectively get rid of switchdev_port_attr_get() entirely

[Bridge] [PATCH net-next 05/16] rocker: Check bridge flags during prepare phase

2019-02-08 Thread Florian Fainelli
In preparation for getting rid of switchdev_port_attr_get(), have rocker check for the bridge flags being set through switchdev_port_attr_set() with the SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS attribute identifier. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rocker/rocker_main.c | 40

[Bridge] [PATCH net-next 06/16] net: bridge: Stop calling switchdev_port_attr_get()

2019-02-08 Thread Florian Fainelli
Now that all switchdev drivers have been converted to checking the bridge port flags during the prepare phase of the switchdev_port_attr_set(), we can move straight to trying to set the desired flag through SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS. Signed-off-by: Florian Fainelli ---

[Bridge] [PATCH net-next 04/16] net: dsa: Add setter for SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS

2019-02-08 Thread Florian Fainelli
In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT, add support for a function that processes the SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS attribute and returns not supported for any flag set, since DSA does not currently support toggling those bridge port attributes (yet).

[Bridge] [PATCH net-next 02/16] mlxsw: spectrum: Check bridge flags during prepare phase

2019-02-08 Thread Florian Fainelli
In preparation for getting rid of switchdev_port_attr_get(), have mlxsw check for the bridge flags being set through switchdev_port_attr_set() with the SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS attribute identifier. Signed-off-by: Florian Fainelli ---

[Bridge] [PATCH net-next 03/16] staging: fsl-dpaa2: ethsw: Check bridge port flags during set

2019-02-08 Thread Florian Fainelli
In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT, have ethsw check that the bridge port flags that are being set are supported. Signed-off-by: Florian Fainelli --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[Bridge] [PATCH net-next 01/16] Documentation: networking: switchdev: Update port parent ID section

2019-02-08 Thread Florian Fainelli
Update the section about switchdev drivers having to implement a switchdev_port_attr_get() function to return SWITCHDEV_ATTR_ID_PORT_PARENT_ID since that is no longer valid after commit bccb30254a4a ("net: Get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID"). Fixes: bccb30254a4a ("net: Get rid of

[Bridge] [PATCH net-next 00/16] net: Remove switchdev_ops

2019-02-08 Thread Florian Fainelli
Hi all, This patch series finishes by the removal of switchdev_ops. To get there we need to do a few things: - get rid of the one and only call to switchdev_port_attr_get() which is used to fetch the device's bridge port flags capabilities, instead we can just check what flags are being

[Bridge] [PATCH net-next] bridge: use struct_size() helper

2019-02-08 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; struct boo entry[]; }; size = sizeof(struct foo) +

Re: [Bridge] [PATCH net-next v3 11/12] net: dsa: Implement ndo_get_port_parent_id()

2019-02-08 Thread Vivien Didelot
Hi Florian, On Tue, 5 Feb 2019 15:53:25 -0800, Florian Fainelli wrote: > DSA implements SWITCHDEV_ATTR_ID_PORT_PARENT_ID and we want to get rid > of switchdev_ops eventually, ease that migration by implementing a > ndo_get_port_parent_id() function which returns what >