[dpdk-stable] patch 'net/mlx5: fix jump table leak' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:44 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From d3c99e41b1b2a9166da2ce228045ab26b58c6583 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm at mellanox.com>
Date: Mon, 13 Apr 2020 21:29:13 +0800
Subject: [PATCH] net/mlx5: fix jump table leak

[ upstream commit fe2c412ca935fb6e14605795243b85aac5778455 ]

Currently, when translate jump action, the table reference will be
increased all the time. But when release the jump action, the table
resource reference will only be decreased when jump action is released.
It means for jump action which was referenced more than one time, the
increased table reference only decrease one time when jump action is
released.

Add table release when the jump action was not new created.

Fixes: 684b9a1b1f5c ("net/mlx5: support jump action")

Signed-off-by: Suanming Mou <suanmingm at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 1f53aad40f..0f438bfc3b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -70,6 +70,10 @@ union flow_dv_attr {
 	uint32_t attr;
 };
 
+static int
+flow_dv_tbl_resource_release(struct rte_eth_dev *dev,
+			     struct mlx5_flow_tbl_resource *tbl);
+
 /**
  * Initialize flow attributes structure according to flow items' types.
  *
@@ -2397,6 +2401,8 @@ flow_dv_jump_tbl_resource_register
 		DRV_LOG(DEBUG, "new jump table resource %p: refcnt %d++",
 			(void *)&tbl_data->jump, cnt);
 	} else {
+		/* old jump should not make the table ref++. */
+		flow_dv_tbl_resource_release(dev, &tbl_data->tbl);
 		assert(tbl_data->jump.action);
 		DRV_LOG(DEBUG, "existed jump table resource %p: refcnt %d++",
 			(void *)&tbl_data->jump, cnt);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:48.093165793 +0100
+++ 0089-net-mlx5-fix-jump-table-leak.patch	2020-05-19 14:04:44.284649605 +0100
@@ -1,8 +1,10 @@
-From fe2c412ca935fb6e14605795243b85aac5778455 Mon Sep 17 00:00:00 2001
+From d3c99e41b1b2a9166da2ce228045ab26b58c6583 Mon Sep 17 00:00:00 2001
 From: Suanming Mou <suanmingm at mellanox.com>
 Date: Mon, 13 Apr 2020 21:29:13 +0800
 Subject: [PATCH] net/mlx5: fix jump table leak
 
+[ upstream commit fe2c412ca935fb6e14605795243b85aac5778455 ]
+
 Currently, when translate jump action, the table reference will be
 increased all the time. But when release the jump action, the table
 resource reference will only be decreased when jump action is released.
@@ -13,7 +15,6 @@
 Add table release when the jump action was not new created.
 
 Fixes: 684b9a1b1f5c ("net/mlx5: support jump action")
-Cc: stable at dpdk.org
 
 Signed-off-by: Suanming Mou <suanmingm at mellanox.com>
 Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
@@ -22,10 +23,10 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index 0676b6f203..e87e30f65f 100644
+index 1f53aad40f..0f438bfc3b 100644
 --- a/drivers/net/mlx5/mlx5_flow_dv.c
 +++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -73,6 +73,10 @@ union flow_dv_attr {
+@@ -70,6 +70,10 @@ union flow_dv_attr {
  	uint32_t attr;
  };
  
@@ -36,13 +37,13 @@
  /**
   * Initialize flow attributes structure according to flow items' types.
   *
-@@ -2530,6 +2534,8 @@ flow_dv_jump_tbl_resource_register
+@@ -2397,6 +2401,8 @@ flow_dv_jump_tbl_resource_register
  		DRV_LOG(DEBUG, "new jump table resource %p: refcnt %d++",
  			(void *)&tbl_data->jump, cnt);
  	} else {
 +		/* old jump should not make the table ref++. */
 +		flow_dv_tbl_resource_release(dev, &tbl_data->tbl);
- 		MLX5_ASSERT(tbl_data->jump.action);
+ 		assert(tbl_data->jump.action);
  		DRV_LOG(DEBUG, "existed jump table resource %p: refcnt %d++",
  			(void *)&tbl_data->jump, cnt);
 -- 


More information about the stable mailing list