net/mlx5: fix indexed pool local cache crash
PATCH 1/1 net/mlx5: fix indexed pool local cache crash
Local cache for an indexed pool is not initialized in the situation when all the indices are allocated on one CPU core and freed on another one. That leads to a crash once we try to check its reference counter. Check that the local cache is initialized before accessing this counter.
--- drivers/net/mlx5/mlx5_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_utils.c +1 -1
@@ -479,7 +479,7 @@ _mlx5_ipool_free_cache(struct mlx5_indexed_pool *pool, int cidx, uint32_t idx)mlx5_ipool_lock (pool); gc = pool->gc;if (ilc->lc != gc) { -if (!(--ilc->lc->ref_cnt)) +if (ilc->lc && !(--ilc->lc->ref_cnt)) olc = ilc->lc; gc->ref_cnt++; ilc->lc = gc;
Signature · 1 line
2.18.2
Quoted 14 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Wednesday, November 9, 2022 14:58
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Michael Baum <[email protected]>
Subject: [PATCH] net/mlx5: fix indexed pool local cache crashLocal cache for an indexed pool is not initialized in the situation when all the indices are allocated on one CPU core and freed on another one. That leads to a crash once we try to check its reference counter. Check that the local cache is initialized before accessing this counter.
Quoted 4 lines
Fixes d15c0946be ("net/mlx5: add indexed pool local cache")Signed-off-by Alexander Kozyrev <[email protected]>
Hi,
Quoted 14 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Wednesday, November 9, 2022 2:58 PM
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Michael Baum <[email protected]>
Subject: [PATCH] net/mlx5: fix indexed pool local cache crashLocal cache for an indexed pool is not initialized in the situation when all the indices are allocated on one CPU core and freed on another one. That leads to a crash once we try to check its reference counter. Check that the local cache is initialized before accessing this counter.
Quoted 4 lines
Fixes d15c0946be ("net/mlx5: add indexed pool local cache")Signed-off-by Alexander Kozyrev <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh