From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A43D8A0524 for ; Fri, 5 Feb 2021 12:37:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E7A2188949; Fri, 5 Feb 2021 12:37:10 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id CFDD5188949 for ; Fri, 5 Feb 2021 12:37:09 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id 190so5767145wmz.0 for ; Fri, 05 Feb 2021 03:37:09 -0800 (PST) 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=UtdojMPgpYSGFpVu6ScTYL0U11TsArlHph55gzIcE94=; b=PsXLG+gV+ennrVEqi32DAUJ8fRkds0c+Mqtoxq9/gZPCtNETabFuoJ+5Hvc3xpZ82x 6lue3i7gMZqQ3/MkCu6pKsQ/Aci4h9dEwuu30YEXhdVYEPwVG/cOcEIlL0ZbgTE2gSax hZLkIk1lrvW9WBr0iM8iklWcFsuGgQJz1k+gteHP3sbMcBhbut3gwk0SfNNTW0xfg9xA 8FEy25ySZaYxh/ziBQ0d71mJ9USpQrGkblkEhEdzQcm3HSi6CT+rWtKD3neFrdigQhyw eEvEN2LBCU/2SXNKHsGFORJdKqRZ9HDs63fXUJ+kizxFABDWUw8OrvC86dr2K86b17/4 A05g== 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=UtdojMPgpYSGFpVu6ScTYL0U11TsArlHph55gzIcE94=; b=MN6TFdOdkzTXKl8Nh39rH3I/WcwgEBrqXS6ajae8lPZoRgbE1DY16jEN5vI8JwI//M YKKZHLPZDaiidfcMuwkQ9BXJAd/3mZUCdXH+0V6e5cys3IeIcNnI0AMt2SloynxE72gJ KECgsPcGP+OU2f/UtfFUztXi+nPA49oC7slelzTbai4jE4u/Rm3Qv/T0PPobdhM12f/Y dnqSJ8eoOfSAHD6y+o5PgQsOaYmIaYhxq1mtzOyUfGAplNaBgYVfarSnc8lIsUg8RKot XoBsnoYJ4G68lb3APUWP44yVcu7nKj7LY4kTz7qHVxaUZHmGAVgGCydn69H6CsSCw/Sd hg5Q== X-Gm-Message-State: AOAM531VwVD0s0bKGt5nCiwrwb4kx3NFA8ydHPJQfmH4ul4VpE7ezdWs oLmDMpQg+27qgK8fOMQX1VQ= X-Google-Smtp-Source: ABdhPJxBhvvvPT2IsjqNOsUKJJAduYGctNlY/YSe70DVOlez+psKihbRTi3Gs25G/rMTbahz9WCE0g== X-Received: by 2002:a1c:9e4d:: with SMTP id h74mr3211635wme.103.1612525029586; Fri, 05 Feb 2021 03:37:09 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j14sm13717679wrd.36.2021.02.05.03.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:37:08 -0800 (PST) From: luca.boccassi@gmail.com To: Dekel Peled Cc: Matan Azrad , dpdk stable Date: Fri, 5 Feb 2021 11:18:31 +0000 Message-Id: <20210205111920.1272063-225-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix flow split combined with counter' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a Thanks. Luca Boccassi --- >From 79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Sun, 17 Jan 2021 11:40:46 +0200 Subject: [PATCH] net/mlx5: fix flow split combined with counter [ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ] Currently, for a flow containing a count action, if flow is split to sub-flows, a new counter will be created for each sub-flow. However only the counter created for the last sub-flow will be queried on flow query and cleared on flow removal. This behavior is wrong, causing a leak of resources. Need to create just one counter per flow, and use it for all sub-flows. This patch adds the required check to make sure a counter is created just once per flow, and used by all sub-flows. Fixes: fa2d01c87d2b ("net/mlx5: support flow aging") Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 407e76e7b1..ab9aaab4ec 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -10235,17 +10235,22 @@ flow_dv_translate(struct rte_eth_dev *dev, handle->dvh.modify_hdr->action; } if (action_flags & MLX5_FLOW_ACTION_COUNT) { - flow->counter = - flow_dv_translate_create_counter(dev, - dev_flow, count, age); - - if (!flow->counter) - return rte_flow_error_set + /* + * Create one count action, to be used + * by all sub-flows. + */ + if (!flow->counter) { + flow->counter = + flow_dv_translate_create_counter + (dev, dev_flow, count, + age); + if (!flow->counter) + return rte_flow_error_set (error, rte_errno, - RTE_FLOW_ERROR_TYPE_ACTION, - NULL, - "cannot create counter" - " object."); + RTE_FLOW_ERROR_TYPE_ACTION, + NULL, "cannot create counter" + " object."); + } dev_flow->dv.actions[actions_n] = (flow_dv_counter_get_by_idx(dev, flow->counter, NULL))->action; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:39.083446225 +0000 +++ 0225-net-mlx5-fix-flow-split-combined-with-counter.patch 2021-02-05 11:18:29.190698423 +0000 @@ -1 +1 @@ -From 63f4d5693ed8459f8867a23d0b87cf9c60983767 Mon Sep 17 00:00:00 2001 +From 79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 5e34cbeea9..012d5893ba 100644 +index 407e76e7b1..ab9aaab4ec 100644 @@ -30 +31 @@ -@@ -10681,17 +10681,22 @@ flow_dv_translate(struct rte_eth_dev *dev, +@@ -10235,17 +10235,22 @@ flow_dv_translate(struct rte_eth_dev *dev,