DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix validate RSS queues types
@ 2020-11-16  2:07 Xiaoyu Min
  2020-11-17 11:49 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoyu Min @ 2020-11-16  2:07 UTC (permalink / raw)
  To: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko; +Cc: dev, Xiaoyu Min, stable

From: Xiaoyu Min <jackmin@nvidia.com>

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
reject it.

This because commit[1] create 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 create verbs ind table but the formmer doesn't check when
create 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.

Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin")
Cc: stable@dpdk.org

[1]:
commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 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 324349ed19..8f2efc7493 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1595,6 +1595,9 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  NULL, "No queues configured");
 	for (i = 0; i != rss->queue_num; ++i) {
+		enum mlx5_rxq_type rxq_type = MLX5_RXQ_TYPE_UNDEFINED;
+		struct mlx5_rxq_ctrl *rxq_ctrl;
+
 		if (rss->queue[i] >= priv->rxqs_n)
 			return rte_flow_error_set
 				(error, EINVAL,
@@ -1604,6 +1607,15 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev,
 			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");
 	}
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix validate RSS queues types
  2020-11-16  2:07 [dpdk-dev] [PATCH] net/mlx5: fix validate RSS queues types Xiaoyu Min
@ 2020-11-17 11:49 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-11-17 11:49 UTC (permalink / raw)
  To: Xiaoyu Min, Matan Azrad, Shahaf Shuler, Slava Ovsiienko
  Cc: dev, Jack Min, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaoyu Min
> Sent: Monday, November 16, 2020 4:08 AM
> To: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Jack Min <jackmin@nvidia.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix validate RSS queues types
> 
> From: Xiaoyu Min <jackmin@nvidia.com>
> 
> 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
> reject it.
> 
> This because commit[1] create 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 create verbs ind table but the formmer doesn't check when
> create 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.
> 
> Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin")
> Cc: stable@dpdk.org
> 
> [1]:
> commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")
> 
> Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-17 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  2:07 [dpdk-dev] [PATCH] net/mlx5: fix validate RSS queues types Xiaoyu Min
2020-11-17 11:49 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).