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 2C622A0524 for ; Fri, 5 Feb 2021 12:22:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2666B1606C3; Fri, 5 Feb 2021 12:22:21 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id AB2284067B for ; Fri, 5 Feb 2021 12:22:19 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id l12so7308085wry.2 for ; Fri, 05 Feb 2021 03:22:19 -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=49Ark/JuuVn0lzRCfyF9peHvbdTMvcf8a2SwAlOXeCM=; b=XNUtBri1xz1Y3+p4lpVFuhNx0dbOTfg6qw6KiGVgXVrKEXk7unrS7kVzMbhM3/Fw4C +YUV01DKu4iZoU+geMtzDSIzxvx3Rt7CPqlMJFxR/sazUGp0cEGV7AO7BmJndsU4topK NizjgLbJ8aZfIblINDbENmLDILJhDfVPRsLXMqSBYqVBNw63O7ddvNw+JSESaFzmFneg oUr4tQ6+fM5ZLxsNQmbnZdNm3YR7Yw5pE1vsYCwmfCg8rQcX5DVTCvVEqSGycPa6AlLW gxaRTV0A66z/ZcfK9KD5uwZPbPoNh12F+zjcwqqREMwf1A9HDYvj86xMbGwQSaoOe0A5 wXOw== 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=49Ark/JuuVn0lzRCfyF9peHvbdTMvcf8a2SwAlOXeCM=; b=jqm84vl26KpcVzmtj0qQrmtSIeR6bEPuo3DG0ylqpZ3lUG1UKOBsKYjKgyy73qh/NK AnoX3/3IGvzLfhVCyZBlNDQi55J0CBbPfD4AkTzzWOwT/n2FnKLIW61zsVb3yhuqTFU3 xAUXWQf9LR0l/aU2haWJ3hOYpJWW9ZMXxWZuYPzhC7eFm/qrCbqHYYg2I6kZZNNmI7tm aMlRvkEtEElyte6ZfauZOnRY+Yr+kz5zhVs9bTeu4hr+k8ZMGDp+kJb9nn4rlFZ9nNNJ xoydGJ7mFdEM7MPRSW3y8Xbxh9aVJQez1aODcNP0fTuVKMfijWF1X+kcs/LHccKN8eQy 78Lw== X-Gm-Message-State: AOAM530Uqfh/z2WV0k36eJ6t1d8ihzq6QeOEz9AWnYnPVnm85Bws0y2g MIJOrbRVM4qDw7NMGGCTI0M= X-Google-Smtp-Source: ABdhPJwI7D0lIPnjkQXgZLWLEFF9Hg7UiHglkb7t5ySLPchq/uZIJn3CDk4XuWYDMfL2zTtx/3pvnw== X-Received: by 2002:a05:6000:1372:: with SMTP id q18mr4435101wrz.280.1612524139509; Fri, 05 Feb 2021 03:22:19 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id a24sm7585589wmj.23.2021.02.05.03.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:22:18 -0800 (PST) From: luca.boccassi@gmail.com To: Gregory Etelson Cc: Viacheslav Ovsiienko , dpdk stable Date: Fri, 5 Feb 2021 11:15:40 +0000 Message-Id: <20210205111920.1272063-54-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 Direct Verbs flow descriptor allocation' 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/ac07d94045b17b52ae9048804b2cbe81432e55aa Thanks. Luca Boccassi --- >From ac07d94045b17b52ae9048804b2cbe81432e55aa Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Tue, 8 Dec 2020 10:17:05 +0200 Subject: [PATCH] net/mlx5: fix Direct Verbs flow descriptor allocation [ upstream commit 3ab5a3a7acafdf35ad4b8b1e7805ce7663c786c6 ] Initialize flow descriptor tunnel member during flow creation. Prevent access to stale data and pointers when flow descriptor is reallocated after release. Fix flow index validation. Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource") Fixes: 8bb81f2649b1 ("net/mlx5: use thread specific flow workspace") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index e9badb800e..f61943f193 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -6232,8 +6232,9 @@ flow_dv_prepare(struct rte_eth_dev *dev, "not enough memory to create flow handle"); return NULL; } - MLX5_ASSERT(wks->flow_idx + 1 < RTE_DIM(wks->flows)); + MLX5_ASSERT(wks->flow_idx < RTE_DIM(wks->flows)); dev_flow = &wks->flows[wks->flow_idx++]; + memset(dev_flow, 0, sizeof(*dev_flow)); dev_flow->handle = dev_handle; dev_flow->handle_idx = handle_idx; /* @@ -6245,12 +6246,6 @@ flow_dv_prepare(struct rte_eth_dev *dev, */ dev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param) - MLX5_ST_SZ_BYTES(fte_match_set_misc4); - /* - * The matching value needs to be cleared to 0 before using. In the - * past, it will be automatically cleared when using rte_*alloc - * API. The time consumption will be almost the same as before. - */ - memset(dev_flow->dv.value.buf, 0, MLX5_ST_SZ_BYTES(fte_match_param)); dev_flow->ingress = attr->ingress; dev_flow->dv.transfer = attr->transfer; return dev_flow; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:31.697864897 +0000 +++ 0054-net-mlx5-fix-Direct-Verbs-flow-descriptor-allocation.patch 2021-02-05 11:18:28.790690807 +0000 @@ -1 +1 @@ -From 3ab5a3a7acafdf35ad4b8b1e7805ce7663c786c6 Mon Sep 17 00:00:00 2001 +From ac07d94045b17b52ae9048804b2cbe81432e55aa Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3ab5a3a7acafdf35ad4b8b1e7805ce7663c786c6 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index c31737652c..7c2b389c63 100644 +index e9badb800e..f61943f193 100644 @@ -25 +26 @@ -@@ -6230,8 +6230,9 @@ flow_dv_prepare(struct rte_eth_dev *dev, +@@ -6232,8 +6232,9 @@ flow_dv_prepare(struct rte_eth_dev *dev, @@ -36 +37 @@ -@@ -6243,12 +6244,6 @@ flow_dv_prepare(struct rte_eth_dev *dev, +@@ -6245,12 +6246,6 @@ flow_dv_prepare(struct rte_eth_dev *dev,