From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E37BAA0547
	for <public@inbox.dpdk.org>; Tue,  9 Feb 2021 11:36:48 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B6B0C40147;
	Tue,  9 Feb 2021 11:36:48 +0100 (CET)
Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com
 [209.85.221.45])
 by mails.dpdk.org (Postfix) with ESMTP id 9539F160714
 for <stable@dpdk.org>; Tue,  9 Feb 2021 11:36:45 +0100 (CET)
Received: by mail-wr1-f45.google.com with SMTP id 7so21045864wrz.0
 for <stable@dpdk.org>; Tue, 09 Feb 2021 02:36:45 -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=hUh20yS6CuDqNWPPD/fMFB56wzUJjUc8X24pQW8j6dQ=;
 b=dr7dZZl7LPcqOr41WVhO+Rf87QWRBZSPGzl0HTfb2nduNQ+8iN/Bt23qgSlFosv0GM
 zBOK7sJs5u3UflQXN4u+/zSOkVzPMXIsPtvVYfVv/SJYBsoysp1ph9apDrS+7gBJB9FC
 toYfLIjnrR+jTQWMHZxwo0alJ5bT+fUr5y/NmejTRZFSj29uHEiQ16Jdw9znt30t6bbW
 5rFuT5DXQW4qqu06Knl1RdRqyuecHOhBofkzcbztFeZYip7AOM0WH7VijAnBQIBZKk26
 mScyfGwxaj8u8nDoH0Yedmw8uK7T1z0o8n6OKRlQaFBAHjPv17HrXb3L+Xh9Ma+VsUcS
 zgeQ==
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=hUh20yS6CuDqNWPPD/fMFB56wzUJjUc8X24pQW8j6dQ=;
 b=B97EjgzuLv9E/Tzc0iEL3JcFD7g0t/3gP/VoMvkYA2YtrZePP26qDJHVhq2qFTvxPR
 p65FPRxYu/pEp/NprEtaupseI0FdtB41NruTwvtb4Mi8scs6e4oKWqFUFMmVvxhtQqoF
 UuOparwXvZWgIISy7b4V94gWp+PgTWIpSBbC85oCP68UMuK72V+YkVc7nvwd+lkzk7uY
 RomGxedTyx6z1gCTzQwDafZDqoNRo+nivK3B1UgvEEC3ZHtrsHTYCwDucAQMoNHqgLIv
 DQPTaK39nkxFrE2sBEhmBwkdgi0Fzqu0331fQ1v+C+PGN2Mj0aywijEDO3EzwsmEB52S
 WfsQ==
X-Gm-Message-State: AOAM532puaPk5IU3J2YuWZnkCAN9OX/2pC+H/zEO5XvticxSxPVa0a7g
 D53WvsxAXzuwSjj4cV5f5E8=
X-Google-Smtp-Source: ABdhPJyVZQUD/rQrvxwAxj/Bq1WSoPLgsXhAuQg3/RXsPZGQgRUyGDzU0yVDZsMz0DkXMUtCWa/oXg==
X-Received: by 2002:a5d:5910:: with SMTP id v16mr25625924wrd.29.1612867005338; 
 Tue, 09 Feb 2021 02:36:45 -0800 (PST)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id a17sm37092452wrx.63.2021.02.09.02.36.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 09 Feb 2021 02:36:44 -0800 (PST)
From: luca.boccassi@gmail.com
To: Dekel Peled <dekelp@nvidia.com>
Cc: Matan Azrad <matan@nvidia.com>,
	dpdk stable <stable@dpdk.org>
Date: Tue,  9 Feb 2021 10:35:23 +0000
Message-Id: <20210209103529.466775-25-luca.boccassi@gmail.com>
X-Mailer: git-send-email 2.29.2
In-Reply-To: <20210209103529.466775-1-luca.boccassi@gmail.com>
References: <20210205111920.1272063-1-luca.boccassi@gmail.com>
 <20210209103529.466775-1-luca.boccassi@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] patch 'net/mlx5: fix shared RSS capability check' 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 <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

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/11/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/39c65c5cb1567c287e46492ff4f978f401d63c54

Thanks.

Luca Boccassi

---
>From 39c65c5cb1567c287e46492ff4f978f401d63c54 Mon Sep 17 00:00:00 2001
From: Dekel Peled <dekelp@nvidia.com>
Date: Wed, 3 Feb 2021 12:08:42 +0200
Subject: [PATCH] net/mlx5: fix shared RSS capability check

[ upstream commit ae8fdc8067c77496bc07680d42f8aa7f6be34a5b ]

Existing code to create shared RSS action doesn't fully check
driver capabilities.
Using older driver, if DevX capabilities are insufficient,
the IBV operations are used.
In this case the ind_table_modify operation is not supported, and
shared RSS action can't be modified after creation.

This patch adds check of driver capability, and fails the validation
for shared RSS action in case it is insufficient.

Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 481a3a7498..3fdc3ffe16 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -11772,6 +11772,10 @@ __flow_dv_action_rss_update(struct rte_eth_dev *dev, uint32_t idx,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "invalid shared action to update");
+	if (priv->obj_ops.ind_table_modify == NULL)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+					  "cannot modify indirection table");
 	queue = mlx5_malloc(MLX5_MEM_ZERO,
 			    RTE_ALIGN_CEIL(queue_size, sizeof(void *)),
 			    0, SOCKET_ID_ANY);
@@ -12654,6 +12658,20 @@ flow_dv_action_validate(struct rte_eth_dev *dev,
 	RTE_SET_USED(conf);
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_RSS:
+		/*
+		 * priv->obj_ops is set according to driver capabilities.
+		 * When DevX capabilities are
+		 * sufficient, it is set to devx_obj_ops.
+		 * Otherwise, it is set to ibv_obj_ops.
+		 * ibv_obj_ops doesn't support ind_table_modify operation.
+		 * In this case the shared RSS action can't be used.
+		 */
+		if (priv->obj_ops.ind_table_modify == NULL)
+			return rte_flow_error_set
+					(err, ENOTSUP,
+					 RTE_FLOW_ERROR_TYPE_ACTION,
+					 NULL,
+					 "shared RSS action not supported");
 		return mlx5_validate_action_rss(dev, action, err);
 	case RTE_FLOW_ACTION_TYPE_AGE:
 		if (!priv->sh->aso_age_mng)
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-09 10:34:58.928002018 +0000
+++ 0025-net-mlx5-fix-shared-RSS-capability-check.patch	2021-02-09 10:34:57.938584546 +0000
@@ -1 +1 @@
-From ae8fdc8067c77496bc07680d42f8aa7f6be34a5b Mon Sep 17 00:00:00 2001
+From 39c65c5cb1567c287e46492ff4f978f401d63c54 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ae8fdc8067c77496bc07680d42f8aa7f6be34a5b ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index d162cf0999..76696b7b62 100644
+index 481a3a7498..3fdc3ffe16 100644
@@ -29 +30 @@
-@@ -13000,6 +13000,10 @@ __flow_dv_action_rss_update(struct rte_eth_dev *dev, uint32_t idx,
+@@ -11772,6 +11772,10 @@ __flow_dv_action_rss_update(struct rte_eth_dev *dev, uint32_t idx,
@@ -40 +41 @@
-@@ -13882,6 +13886,20 @@ flow_dv_action_validate(struct rte_eth_dev *dev,
+@@ -12654,6 +12658,20 @@ flow_dv_action_validate(struct rte_eth_dev *dev,