From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8051EA0577; Mon, 13 Apr 2020 15:29:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 203FD1BE9C; Mon, 13 Apr 2020 15:29:23 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 158F42B83; Mon, 13 Apr 2020 15:29:21 +0200 (CEST) From: Suanming Mou To: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Cc: rasland@mellanox.com, dev@dpdk.org, stable@dpdk.org Date: Mon, 13 Apr 2020 21:29:13 +0800 Message-Id: <1586784554-35145-3-git-send-email-suanmingm@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1586784554-35145-1-git-send-email-suanmingm@mellanox.com> References: <1586784554-35145-1-git-send-email-suanmingm@mellanox.com> Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: fix jump table leak issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: stable@dpdk.org Signed-off-by: Suanming Mou Acked-by: Viacheslav Ovsiienko --- 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 0676b6f..e87e30f 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -73,6 +73,10 @@ 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. * @@ -2530,6 +2534,8 @@ struct field_modify_info modify_tcp[] = { 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); DRV_LOG(DEBUG, "existed jump table resource %p: refcnt %d++", (void *)&tbl_data->jump, cnt); -- 1.8.3.1