Patches #1 and #2 fix two VxLAN related issues. The first patch removes
warnings that can currently be triggered from user space. Second patch
avoids leaking a FID in an error path.
Patch #3 fixes a too strict check that causes certain host routes not to
be promoted to perform GRE decapsulation in hardware.
Last patch avoids a use-after-free when deleting a VLAN device via an
ioctl when it is enslaved to a bridge. I have a patchset for net-next
that reworks this code and makes the driver more robust.
Ido Schimmel (3):
mlxsw: spectrum_nve: Remove easily triggerable warnings
mlxsw: spectrum_switchdev: Avoid leaking FID's reference count
mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl
Nir Dotan (1):
mlxsw: spectrum_router: Relax GRE decap matching check
.../net/ethernet/mellanox/mlxsw/spectrum_nve.c | 4 ++--
.../ethernet/mellanox/mlxsw/spectrum_router.c | 5 +----
.../mellanox/mlxsw/spectrum_switchdev.c | 17 +++++++++++++----
3 files changed, 16 insertions(+), 10 deletions(-)
--
2.19.1
It is possible to trigger a warning in mlxsw in case a flood entry which
mlxsw is not aware of is deleted from the VxLAN device. This is because
mlxsw expects to find a singly linked list where the flood entry is
present in.
Fix by removing these warnings for now.
Will re-add them in the next release after we teach mlxsw to ask for a
dump of FDB entries from the VxLAN device, once it is enslaved to a
bridge mlxsw cares about.
Fixes: 6e6030bd5412 ("mlxsw: spectrum_nve: Implement common NVE core")
Signed-off-by: Ido Schimmel <redacted>
Reviewed-by: Petr Machata <redacted>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
It should never be possible for a user to set a VNI on a FID in case one
is already set. The driver therefore returns an error, but fails to drop
the reference count taken earlier when calling
mlxsw_sp_fid_8021d_lookup().
Drop the reference when this unlikely error is hit.
Fixes: 1c30d1836aeb ("mlxsw: spectrum: Enable VxLAN enslavement to bridges")
Signed-off-by: Ido Schimmel <redacted>
Reviewed-by: Jiri Pirko <redacted>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
From: Nir Dotan <redacted>
GRE decap offload is configured when local routes prefix correspond to the
local address of one of the offloaded GRE tunnels. The matching check was
found to be too strict, such that for a flat GRE configuration, in which
the overlay and underlay traffic share the same non-default VRF, decap flow
was not offloaded.
Relax the check for decap flow offloading. A match occurs if the local
address of the tunnel matches the local route address while both share the
same VRF table.
Fixes: 4607f6d26950 ("mlxsw: spectrum_router: Support IPv4 underlay decap")
Signed-off-by: Nir Dotan <redacted>
Signed-off-by: Ido Schimmel <redacted>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
When deleting a VLAN device using an ioctl the netdev is unregistered
before the VLAN filter is updated via ndo_vlan_rx_kill_vid(). It can
lead to a use-after-free in mlxsw in case the VLAN device is deleted
while being enslaved to a bridge.
The reason for the above is that when mlxsw receives the CHANGEUPPER
event, it wrongly assumes that the VLAN device is no longer its upper
and thus destroys the internal representation of the bridge port despite
the reference count being non-zero.
Fix this by checking if the VLAN device is our upper using its real
device. In net-next I'm going to remove this trick and instead make
mlxsw completely agnostic to the order of the events.
Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
Signed-off-by: Ido Schimmel <redacted>
Reviewed-by: Petr Machata <redacted>
---
.../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
@@ -296,7 +296,13 @@ static boolmlxsw_sp_bridge_port_should_destroy(conststructmlxsw_sp_bridge_port*bridge_port){-structmlxsw_sp*mlxsw_sp=mlxsw_sp_lower_get(bridge_port->dev);+structnet_device*dev=bridge_port->dev;+structmlxsw_sp*mlxsw_sp;++if(is_vlan_dev(dev))+mlxsw_sp=mlxsw_sp_lower_get(vlan_dev_real_dev(dev));+else+mlxsw_sp=mlxsw_sp_lower_get(dev);/* In case ports were pulled from out of a bridged LAG, then*it'spossiblethereferencecountisn'tzero,yetthebridge
Patches #1 and #2 fix two VxLAN related issues. The first patch removes
warnings that can currently be triggered from user space. Second patch
avoids leaking a FID in an error path.
Patch #3 fixes a too strict check that causes certain host routes not to
be promoted to perform GRE decapsulation in hardware.
Last patch avoids a use-after-free when deleting a VLAN device via an
ioctl when it is enslaved to a bridge. I have a patchset for net-next
that reworks this code and makes the driver more robust.