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 DC4E4A0093 for ; Tue, 19 May 2020 15:10:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 469271D6A4; Tue, 19 May 2020 15:10:34 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 06FE81D6A4 for ; Tue, 19 May 2020 15:10:32 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id h17so15819327wrc.8 for ; Tue, 19 May 2020 06:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tlsZY5vFnU6wlfn2mfkJcmsQXOho5bWZLs5PZ+7ppd8=; b=M2pcGtANdH2U323O84OLCwO79PFr7LaiDo10k+sKWC+hRkyv2LlAG5Lxg7BPPjmE83 rnhDy2gxCaPc3ZyTCPXIuh/hM+ek+giACIvaHhojwTiRw8KmEvrckWGikmT/QGuEx1/I pNRtGYTwrpGpJtBbflzvgD7Y0FCc57YXoP6LWYU2WB3fvAtbCIm/dNR+EVr8BLJZxV0u XQ8x3FAW7UgxLy7jnvC6OjYJJoFRDNNxWWjpb3JZ9G6pgwfhIPpwPZHq8dHB3J07mlvf z/huoAwtaSMh351rqufeBT8hEQZrvbhFDpdAiqRsYpl3mRJ8GBMAusVS+6+59zRVfhyI CxzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tlsZY5vFnU6wlfn2mfkJcmsQXOho5bWZLs5PZ+7ppd8=; b=Wb1IHAVYqB/n/oaCGawJ2J+UUX9nZqkFRMVHxxj18jFRZQzOMgsYqgb6zcYEkxw4nE 1OKZodMPBYh4OBme7TR+KZBrpvesp2c8z5spSBW1I8M9NXzwHeUYKoafsdxw7TaXb4Zh XRkCLO333WRJgGbXRuzfHUzuwzXazH7tH/mZA0I6PkUfiWDHr7rxpq5y9G3DolUEYr++ llotRNdiEKNl4A567AdJd/5jeI+54XHORlDowBsFr38rkwzRojZKn50awSnSZj44Y6s3 nFY5eCQCyibAWSlWUbmAdBWIoY6OiQl6WP728jtV10TOqcaveDiLv6nztoQHjXEsj3Rl Qh3w== X-Gm-Message-State: AOAM531mBfRq0y3x+MeQwozZndg8W/8DSNpEf7M0i3oqbPxv6qfnarFU FEEt+3vpQXzAkmrw8NWrHPg= X-Google-Smtp-Source: ABdhPJxfNvI482tMdcvXuDYmEbFdRsH6joOAxzRGgw8i7XA7HVlBWQ9DKb67+BArNN/bk8aCpJRn3A== X-Received: by 2002:adf:ea09:: with SMTP id q9mr26508308wrm.399.1589893831705; Tue, 19 May 2020 06:10:31 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id r11sm21946893wro.15.2020.05.19.06.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:10:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Suanming Mou Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 19 May 2020 14:03:44 +0100 Message-Id: <20200519130549.112823-89-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix jump table leak' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 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 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 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@dpdk.org Signed-off-by: Suanming Mou Acked-by: Viacheslav Ovsiienko @@ -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); --