Patch "net/mlx5e: Check the number of elements before walk TC rhashtable" has been added to the 6.6-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

    net/mlx5e: Check the number of elements before walk TC rhashtable

to the 6.6-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:
     net-mlx5e-check-the-number-of-elements-before-walk-t.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 54a4bf1895dd8835e3563dd06381c3e54887ef4f
Author: Jianbo Liu <jianbol@xxxxxxxxxx>
Date:   Thu Oct 12 02:00:44 2023 +0000

    net/mlx5e: Check the number of elements before walk TC rhashtable
    
    [ Upstream commit 4e25b661f484df54b6751b65f9ea2434a3b67539 ]
    
    After IPSec TX tables are destroyed, the flow rules in TC rhashtable,
    which have the destination to IPSec, are restored to the original
    one, the uplink.
    
    However, when the device is in switchdev mode and unload driver with
    IPSec rules configured, TC rhashtable cleanup is done before IPSec
    cleanup, which means tc_ht->tbl is already freed when walking TC
    rhashtable, in order to restore the destination. So add the checking
    before walking to avoid unexpected behavior.
    
    Fixes: d1569537a837 ("net/mlx5e: Modify and restore TC rules for IPSec TX rules")
    Signed-off-by: Jianbo Liu <jianbol@xxxxxxxxxx>
    Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
index 13b5916b64e22..d5d33c3b3aa2a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
@@ -152,7 +152,7 @@ void mlx5_esw_ipsec_restore_dest_uplink(struct mlx5_core_dev *mdev)
 
 	xa_for_each(&esw->offloads.vport_reps, i, rep) {
 		rpriv = rep->rep_data[REP_ETH].priv;
-		if (!rpriv || !rpriv->netdev)
+		if (!rpriv || !rpriv->netdev || !atomic_read(&rpriv->tc_ht.nelems))
 			continue;
 
 		rhashtable_walk_enter(&rpriv->tc_ht, &iter);




[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