Re: [Bridge] [PATCH net-next 01/12] vxlan: Add a function to init switchdev_notifier_vxlan_fdb_info

2018-12-05 Thread David Miller
From: Ido Schimmel Date: Wed, 5 Dec 2018 15:50:23 + > +static struct switchdev_notifier_vxlan_fdb_info > +vxlan_fdb_switchdev_notifier_info(const struct vxlan_dev *vxlan, > + const struct vxlan_fdb *fdb, > + const struct vxlan_rdst

Re: [Bridge] [PATCH net-next v3 0/4] net: bridge: convert multicast to generic rhashtable

2018-12-05 Thread David Miller
From: Nikolay Aleksandrov Date: Wed, 5 Dec 2018 15:14:23 +0200 > The current bridge multicast code uses a custom rhashtable > implementation which predates the generic rhashtable API. Patch 01 > converts it to use the generic kernel rhashtable which simplifies the > code a lot and removes

Re: [Bridge] [PATCH net-next 04/12] bridge: Add br_fdb_clear_offload()

2018-12-05 Thread Nikolay Aleksandrov
On 05/12/2018 17:50, Ido Schimmel wrote: > From: Petr Machata > > When a driver unoffloads all FDB entries en bloc, it's inefficient to > send the switchdev notification one by one. Add a helper that unsets the > offload flag on FDB entries on a given bridge port and VLAN. > > Signed-off-by:

[Bridge] [PATCH net-next 11/12] selftests: mlxsw: vxlan: Test FDB un/marking on VXLAN join/leave

2018-12-05 Thread Ido Schimmel
From: Petr Machata When a VXLAN device is attached to an offloaded bridge, or when a front-panel port is attached to a bridge that already has a VXLAN device, mlxsw should offload the existing offloadable FDB entries. Similarly when VXLAN device is downed, the FDB entries are unoffloaded, and

[Bridge] [PATCH net-next 10/12] mlxsw: spectrum_nve: Un/offload FDB on nve_fid_disable/enable

2018-12-05 Thread Ido Schimmel
From: Petr Machata Any existing NVE FDB entries need to be offloaded when NVE is enabled for a given FID. Recent patches have added fdb_replay op for this, so just invoke it from mlxsw_sp_nve_fid_enable(). When NVE is disabled on a FID, any existing FDB offloaded marks need to be cleared on NVE

[Bridge] [PATCH net-next 09/12] mlxsw: spectrum: Add mlxsw_sp_fid_ops.fdb_clear_offload

2018-12-05 Thread Ido Schimmel
From: Petr Machata If there are any offloaded FDB entries at bridge master of an NVE device at the time that it's un-offloaded, their offloaded marks need to be cleared. How that is done depends on whether the bridge in question is vlan aware. Therefore add a per-FID-type operation. Implement

[Bridge] [PATCH net-next 08/12] mlxsw: spectrum_nve: Add mlxsw_sp_nve_ops.fdb_clear_offload

2018-12-05 Thread Ido Schimmel
From: Petr Machata If there are any offloaded FDB entries at an NVE device at the time that it's un-offloaded, their offloaded marks need to be cleared. How that is done depends on NVE device type, and therefore add a per-NVE-type operation. Implement the operation for the sole NVE device type

[Bridge] [PATCH net-next 12/12] selftests: forwarding: Add PVID test case for VXLAN with VLAN-aware bridges

2018-12-05 Thread Ido Schimmel
When using VLAN-aware bridges with VXLAN, the VLAN that is mapped to the VNI of the VXLAN device is that which is configured as "pvid untagged" on the corresponding bridge port. When these flags are toggled or when the VLAN is deleted entirely, remote hosts should not be able to receive packets

[Bridge] [PATCH net-next 03/12] vxlan: Add vxlan_fdb_clear_offload()

2018-12-05 Thread Ido Schimmel
From: Petr Machata When a driver unoffloads all FDB entries en bloc, it's inefficient to send the switchdev notification one by one. Add a helper that walks the FDB table, unsetting the offload flag on RDST with a given VNI. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel ---

[Bridge] [PATCH net-next 06/12] mlxsw: spectrum_switchdev: Publish mlxsw_sp_switchdev_notifier

2018-12-05 Thread Ido Schimmel
From: Petr Machata The notifier block will need to be passed to vxlan_fdb_replay() in a follow-up patch. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 1 + drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +-

[Bridge] [PATCH net-next 02/12] vxlan: Add vxlan_fdb_replay()

2018-12-05 Thread Ido Schimmel
From: Petr Machata When a VXLAN device becomes relevant to a driver (such as when it is attached to an offloaded bridge), the driver will generally need to walk the existing FDB entries and offload them. Add a function vxlan_fdb_replay() to call a given notifier block for each FDB entry with a

[Bridge] [PATCH net-next 07/12] mlxsw: spectrum_nve: Add mlxsw_sp_nve_ops.fdb_replay

2018-12-05 Thread Ido Schimmel
From: Petr Machata A replay of FDB needs to be performed so that the FDB entries existing at the NVE device are offloaded. How the replay is done depends on NVE device type, and therefore add a per-NVE-type operation. Implement the operation for the sole NVE device type currently supported by

[Bridge] [PATCH net-next 05/12] mlxsw: spectrum: Track NVE type at FIDs

2018-12-05 Thread Ido Schimmel
From: Petr Machata A follow-up patch will add support for replay and for clearing of offload marks. These are NVE type-sensitive operations, and to be able to dispatch them properly, a FID needs to know what NVE type is attached to it. Therefore, track the NVE type at struct mlxsw_sp_fid.

[Bridge] [PATCH net-next 04/12] bridge: Add br_fdb_clear_offload()

2018-12-05 Thread Ido Schimmel
From: Petr Machata When a driver unoffloads all FDB entries en bloc, it's inefficient to send the switchdev notification one by one. Add a helper that unsets the offload flag on FDB entries on a given bridge port and VLAN. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel ---

[Bridge] [PATCH net-next 00/12] mlxsw: Un/offload FDB on NVE detach/attach

2018-12-05 Thread Ido Schimmel
Petr says: When a VXLAN device is attached to a bridge of a driver capable of offloading such, or upped, the FDB entries already present at the device need to be offloaded. Similarly when an offloaded VXLAN device ceases being interesting (it is downed, or detached, or a front-panel port

[Bridge] [PATCH net-next 01/12] vxlan: Add a function to init switchdev_notifier_vxlan_fdb_info

2018-12-05 Thread Ido Schimmel
From: Petr Machata There are currently two places that need to initialize the notifier info structure, and one more is coming next when vxlan_fdb_replay() is introduced. These three instances have / will have very similar code that is easy to abstract away into a named function. Add such

[Bridge] [PATCH net-next v3 4/4] net: bridge: increase multicast's default maximum number of entries

2018-12-05 Thread Nikolay Aleksandrov
bridge's default hash_max was 512 which is rather conservative, now that we're using the generic rhashtable API which autoshrinks let's increase it to 4096 and move it to a define in br_private.h. Signed-off-by: Nikolay Aleksandrov --- v2, v3: no change net/bridge/br_multicast.c | 2 +-

[Bridge] [PATCH net-next v3 3/4] net: bridge: mark hash_elasticity as obsolete

2018-12-05 Thread Nikolay Aleksandrov
Now that the bridge multicast uses the generic rhashtable interface we can drop the hash_elasticity option as that is already done for us and it's hardcoded to a maximum of RHT_ELASTICITY (16 currently). Add a warning about the obsolete option when the hash_elasticity is set. Signed-off-by:

[Bridge] [PATCH net-next v3 1/4] net: bridge: convert multicast to generic rhashtable

2018-12-05 Thread Nikolay Aleksandrov
The bridge multicast code currently uses a custom resizable hashtable which predates the generic rhashtable interface. It has many shortcomings compared and duplicates functionality that is presently available via the generic rhashtable, so this patch removes the custom rhashtable implementation

[Bridge] [PATCH net-next v3 2/4] net: bridge: multicast: use non-bh rcu flavor

2018-12-05 Thread Nikolay Aleksandrov
The bridge multicast code has been using a mix of RCU and RCU-bh flavors sometimes in questionable way. Since we've moved to rhashtable just use non-bh RCU everywhere. In addition this simplifies freeing of objects and allows us to remove some unnecessary callback functions. v3: new patch