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 C246DA0527 for ; Wed, 25 Nov 2020 10:03:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B227FC95E; Wed, 25 Nov 2020 10:03:08 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by dpdk.org (Postfix) with ESMTP id 55E6AC958 for ; Wed, 25 Nov 2020 10:03:06 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id w24so1405743wmi.0 for ; Wed, 25 Nov 2020 01:03:06 -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=LYJ92a8tRdh2Smmp0b7z+/sxdTvBExx8GWPLOiGmgD4=; b=LfITF25e2i+o/Zdb6evGkKsVQE0ib/psQE0z0f1GDtiL2HkhUODfRk8TPWY2gOWOSZ OYhBGAiwwh6BwlHm1IoCyNKXoP9kZNuzDnpZWECie4Fu5iSKNz0ei3i2t4NpE2d20ICk YmAAfEjTpkVcS7toz0PkpintD5MEV30wsAx1yoEwnXaCVKerSepEh/fa6As9WvAqiupr EVqYdyboenbheSTGNSSxNKkCHjcI8tqaP+F/fBeUos7rEmskjktzqmWNcmJZ6b8KFCuw kWgAvMILv0Lnm7b//lzSO5y1LpdgDQ+6c3WwLm24CwVgLPyikwViWcdzvai9w8oYYIUN 3u7Q== 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=LYJ92a8tRdh2Smmp0b7z+/sxdTvBExx8GWPLOiGmgD4=; b=qceyuMSImRNV+P2OXZiILPgEvPKoKCqkKijqCeQtGMt2LfXdhGKYF9PQgFuNCGqaYl E3xKk7eIJtJJ72BLsv3t/roZORGB0pawJTARRjMvnLUtvp7nReR3Y7lvSjedKpbvUbDy ll0J9e3LiSQhSJ25NT5SjR0isd7ecD7aisbtjUda2XUrBFeczE8iaUXYaZF00yiA/vSJ FxdQBovZ9AVae8A1yEfRVAkVClOpKUSPgPQLTH80oP2Oj+hAKNJC7NG7Z5JglCe3AH62 yIG2JHspAwAgH2BpTJoJTS4je9AlUgUhOhiS7fw8k9xqsmsrD9J6jEVpEMvuGfhaMcaI 9reQ== X-Gm-Message-State: AOAM530Ovzb2Gs70TSnCQzN4IbUj5/zRytFaPzuzUovK54lBd3kZox1c YFg3Kbb87EV6j6R/Kw261QY= X-Google-Smtp-Source: ABdhPJxI7n3OTK5hEUMcxZ2wuzT9GKxvOaUtPkRus7RANjg6W/jtwNmliVc7pzTYhenPUW/KFp/ifg== X-Received: by 2002:a7b:c05a:: with SMTP id u26mr2744035wmc.159.1606294985070; Wed, 25 Nov 2020 01:03:05 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 189sm2882376wmb.18.2020.11.25.01.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 01:03:04 -0800 (PST) From: luca.boccassi@gmail.com To: Xiaoyu Min Cc: Matan Azrad , dpdk stable Date: Wed, 25 Nov 2020 09:02:45 +0000 Message-Id: <20201125090258.21457-3-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201125090258.21457-1-luca.boccassi@gmail.com> References: <20201117111416.1961049-42-luca.boccassi@gmail.com> <20201125090258.21457-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix RSS queue type validation' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/26/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. 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/5dddc14e74efb55760af7dced98dc45a4d7ddd5a Thanks. Luca Boccassi --- >From 5dddc14e74efb55760af7dced98dc45a4d7ddd5a Mon Sep 17 00:00:00 2001 From: Xiaoyu Min Date: Mon, 16 Nov 2020 10:07:59 +0800 Subject: [PATCH] net/mlx5: fix RSS queue type validation [ upstream commit 765633655c76292cf24cee3641e7f87e96a3e0d6 ] When the RSS queues' types are not uniformed, i.e, mixed with normal Rx queue and hairpin queue, PMD accept this flow after commit[1] instead of rejecting it. This because commit[1] creates Rx queue object as DevX type via DevX API instead of IBV type via Verbs, in which the latter will check the queues' type when creating Verbs ind table but the former doesn't check when creating DevX ind table. However, in any case, logically PMD should check whether the input configuration of RSS action is reasonable or not, which should include queues' type check as well as the others. So add the check of RSS queues' type in validation function to fix issue. [1]: commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations") Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin") Signed-off-by: Xiaoyu Min Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index b05dbaf9a1..b2e457faec 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1121,6 +1121,7 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, struct mlx5_priv *priv = dev->data->dev_private; const struct rte_flow_action_rss *rss = action->conf; int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); + enum mlx5_rxq_type rxq_type = MLX5_RXQ_TYPE_UNDEFINED; unsigned int i; if (action_flags & MLX5_FLOW_FATE_ACTIONS) @@ -1179,6 +1180,8 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, "No queues configured"); for (i = 0; i != rss->queue_num; ++i) { + struct mlx5_rxq_ctrl *rxq_ctrl; + if (rss->queue[i] >= priv->rxqs_n) return rte_flow_error_set (error, EINVAL, @@ -1188,6 +1191,15 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, &rss->queue[i], "queue is not configured"); + rxq_ctrl = container_of((*priv->rxqs)[rss->queue[i]], + struct mlx5_rxq_ctrl, rxq); + if (i == 0) + rxq_type = rxq_ctrl->type; + if (rxq_type != rxq_ctrl->type) + return rte_flow_error_set + (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION_CONF, + &rss->queue[i], + "combining hairpin and regular RSS queues is not supported"); } if (attr->egress) return rte_flow_error_set(error, ENOTSUP, -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-24 16:50:36.667402998 +0000 +++ 0003-net-mlx5-fix-RSS-queue-type-validation.patch 2020-11-24 16:50:36.541495723 +0000 @@ -1 +1 @@ -From 765633655c76292cf24cee3641e7f87e96a3e0d6 Mon Sep 17 00:00:00 2001 +From 5dddc14e74efb55760af7dced98dc45a4d7ddd5a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 765633655c76292cf24cee3641e7f87e96a3e0d6 ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index c4071cd939..ad891d6758 100644 +index b05dbaf9a1..b2e457faec 100644 @@ -37,2 +38 @@ -@@ -1411,6 +1411,7 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev, - { +@@ -1121,6 +1121,7 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, @@ -40,0 +41 @@ + int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); @@ -44,2 +45,2 @@ - if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT && -@@ -1476,6 +1477,8 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev, + if (action_flags & MLX5_FLOW_FATE_ACTIONS) +@@ -1179,6 +1180,8 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, @@ -54 +55 @@ -@@ -1485,6 +1488,15 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev, +@@ -1188,6 +1191,15 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action, @@ -68,2 +69,2 @@ - return 0; - } + if (attr->egress) + return rte_flow_error_set(error, ENOTSUP,