DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix indexed pool local cache crash
@ 2022-11-09 12:58 Alexander Kozyrev
  2022-11-09 13:34 ` Slava Ovsiienko
  2022-11-09 16:01 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Kozyrev @ 2022-11-09 12:58 UTC (permalink / raw)
  To: dev; +Cc: stable, rasland, viacheslavo, matan, michaelba

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.

Fixes: d15c0946be ("net/mlx5: add indexed pool local cache")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/net/mlx5/mlx5_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 4115a2ad77..b295702fd4 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -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;
-- 
2.18.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/mlx5: fix indexed pool local cache crash
  2022-11-09 12:58 [PATCH] net/mlx5: fix indexed pool local cache crash Alexander Kozyrev
@ 2022-11-09 13:34 ` Slava Ovsiienko
  2022-11-09 16:01 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2022-11-09 13:34 UTC (permalink / raw)
  To: Alexander Kozyrev, dev
  Cc: stable, Raslan Darawsheh, Matan Azrad, Michael Baum

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, November 9, 2022 14:58
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Michael Baum
> <michaelba@nvidia.com>
> Subject: [PATCH] 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.
> 
> Fixes: d15c0946be ("net/mlx5: add indexed pool local cache")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/mlx5: fix indexed pool local cache crash
  2022-11-09 12:58 [PATCH] net/mlx5: fix indexed pool local cache crash Alexander Kozyrev
  2022-11-09 13:34 ` Slava Ovsiienko
@ 2022-11-09 16:01 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2022-11-09 16:01 UTC (permalink / raw)
  To: Alexander Kozyrev, dev; +Cc: stable, Slava Ovsiienko, Matan Azrad, Michael Baum

Hi,

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, November 9, 2022 2:58 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Michael Baum <michaelba@nvidia.com>
> Subject: [PATCH] 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.
> 
> Fixes: d15c0946be ("net/mlx5: add indexed pool local cache")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-09 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 12:58 [PATCH] net/mlx5: fix indexed pool local cache crash Alexander Kozyrev
2022-11-09 13:34 ` Slava Ovsiienko
2022-11-09 16:01 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).