Patch "mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed" has been added to the 6.0-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mlxsw-avoid-warnings-when-not-offloaded-fdb-entry-wi.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b9adddf7a807f1b3ac5dbceb328820a52ae12e04
Author: Amit Cohen <amcohen@xxxxxxxxxx>
Date:   Fri Nov 11 18:03:27 2022 +0100

    mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed
    
    [ Upstream commit 30f5312d2c722107364f266cfa98ef4f0857c1fb ]
    
    FDB entries that perform VXLAN encapsulation with an IPv6 underlay hold
    a reference on a resource - the KVDL entry where the IPv6 underlay
    destination IP is stored. For that, the driver maintains two hash tables:
    1. Maps IPv6 to KVDL index
    2. Maps {MAC, FID index} to IPv6 address
    
    When a FDB entry is removed, the second table is used to find the relevant
    IPv6 address and the first table is used to remove the reference count and
    free the index if is not used anymore.
    
    In order for a packet to be forwarded to a single remote VTEP, FDB
    entries need to be configured at both the bridge and VXLAN devices' FDB
    tables. Both entries are squashed into one {MAC, VLAN/VNI} -> IP entry
    in the hardware. Therefore, in case one entry is removed, the entry will
    be removed from the hardware and the remaining entry will be unmarked
    with 'offload' flag since it is not offloaded anymore.
    
    For example, the two FDB entries should be added to allow packets to be
    forwarded via vx10:
    $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff self static dst 2001:db8:5::1
    $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff master static vlan 10
    
    When one entry will be removed, the second one will not be offloaded
    anymore. When the first entry (in VXLAN FDB) will be removed / will not be
    offloaded anymore, the two mappings in IPv6 hash tables will be removed.
    
    In case that the second entry is removed before the first one, unexpected
    warnings[1][2] will be shown in user space as a result of removing the
    first entry. The issue is that not offloaded entry is removed, the driver
    tries to search the relevant entries in the hash tables, does not find them
    and therefore warns.
    
    Do not handle removing of not offloaded VXLAN FDB entries, as they were
    already removed when the offload flag was removed.
    
    [1]:
    WARNING: CPU: 1 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c:914 mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum]
    ...
    Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
    Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum]
    RIP: 0010:mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum]
    ...
    Call Trace:
      <TASK>
      mlxsw_sp_port_fdb_tunnel_uc_op+0x6cf/0x7b0 [mlxsw_spectrum]
      mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum]
      ? finish_task_switch.isra.0+0x8c/0x290
      process_one_work+0x1cd/0x390
      worker_thread+0x48/0x3c0
      ? process_one_work+0x390/0x390
      kthread+0xe0/0x110
      ? kthread_complete_and_exit+0x20/0x20
      ret_from_fork+0x1f/0x30
      </TASK>
    
    [2]:
    WARNING: CPU: 0 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3035 mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum]
    ...
    Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
    Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum]
    RIP: 0010:mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum]
    ...
    Call Trace:
      <TASK>
      ? mlxsw_sp_port_fdb_tun_uc_op6_sfd_write+0x5c1/0x610 [mlxsw_spectrum]
      mlxsw_sp_port_fdb_tunnel_uc_op+0x6ec/0x7b0 [mlxsw_spectrum]
      mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum]
      ? finish_task_switch.isra.0+0x8c/0x290
      process_one_work+0x1cd/0x390
      worker_thread+0x48/0x3c0
      ? process_one_work+0x390/0x390
      kthread+0xe0/0x110
      ? kthread_complete_and_exit+0x20/0x20
      ret_from_fork+0x1f/0x30
      </TASK>
    
    Fixes: 0860c7641634 ("mlxsw: spectrum_nve: Keep track of IPv6 addresses used by FDB entries")
    Signed-off-by: Amit Cohen <amcohen@xxxxxxxxxx>
    Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>
    Signed-off-by: Petr Machata <petrm@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/c186de8cbd28e3eb661e06f31f7f2f2dff30020f.1668184350.git.petrm@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 4efccd942fb8..1290b2d3eae6 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -3470,6 +3470,8 @@ mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp,
 	u16 vid;
 
 	vxlan_fdb_info = &switchdev_work->vxlan_fdb_info;
+	if (!vxlan_fdb_info->offloaded)
+		return;
 
 	bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
 	if (!bridge_device)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux