patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix flow check hairpin split
@ 2021-01-03 15:18 Dekel Peled
  2021-01-06 21:21 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  2021-01-10 17:32 ` [dpdk-stable] [PATCH v2] " Dekel Peled
  0 siblings, 2 replies; 5+ messages in thread
From: Dekel Peled @ 2021-01-03 15:18 UTC (permalink / raw)
  To: viacheslavo, shahafs, matan; +Cc: dev, stable

Previously, the identification of hairpin queue was done using
mlx5_rxq_get_type() function.
Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(),
and check of the return value conf != NULL.
The case of return value is NULL (queue is not hairpin) was not handled.
As result, non-hairpin flows were wrongly handled.
This patch adds the required check for return value is NULL.

Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f110c6b714..0ba1dc8c70 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -3524,7 +3524,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (queue == NULL)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, queue->index);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (!conf || !!conf->tx_explicit)
 				return 0;
 			queue_action = 1;
 			action_n++;
@@ -3534,7 +3534,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (rss == NULL || rss->queue_num == 0)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, rss->queue[0]);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (!conf || !!conf->tx_explicit)
 				return 0;
 			queue_action = 1;
 			action_n++;
-- 
2.25.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix flow check hairpin split
  2021-01-03 15:18 [dpdk-stable] [PATCH] net/mlx5: fix flow check hairpin split Dekel Peled
@ 2021-01-06 21:21 ` Thomas Monjalon
  2021-01-10 17:32 ` [dpdk-stable] [PATCH v2] " Dekel Peled
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-01-06 21:21 UTC (permalink / raw)
  To: Dekel Peled; +Cc: viacheslavo, shahafs, matan, dev, stable

03/01/2021 16:18, Dekel Peled:
> Previously, the identification of hairpin queue was done using
> mlx5_rxq_get_type() function.
> Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(),
> and check of the return value conf != NULL.
> The case of return value is NULL (queue is not hairpin) was not handled.
> As result, non-hairpin flows were wrongly handled.
> This patch adds the required check for return value is NULL.
> 
> Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
> -			if (conf != NULL && !!conf->tx_explicit)
> +			if (!conf || !!conf->tx_explicit)

The DPDK coding style recommends explicit comparison.
Here it would be:
	if (conf == NULL || conf->tx_explicit != 0)




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

* [dpdk-stable] [PATCH v2] net/mlx5: fix flow check hairpin split
  2021-01-03 15:18 [dpdk-stable] [PATCH] net/mlx5: fix flow check hairpin split Dekel Peled
  2021-01-06 21:21 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
@ 2021-01-10 17:32 ` Dekel Peled
  2021-01-10 17:37   ` Dekel Peled
  2021-01-11 23:28   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  1 sibling, 2 replies; 5+ messages in thread
From: Dekel Peled @ 2021-01-10 17:32 UTC (permalink / raw)
  To: matan, shahafs, viacheslavo; +Cc: stable

Previously, the identification of hairpin queue was done using
mlx5_rxq_get_type() function.
Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(),
and check of the return value conf != NULL.
The case of return value is NULL (queue is not hairpin) was not handled.
As result, non-hairpin flows were wrongly handled.
This patch adds the required check for return value is NULL.

Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

---
v2: update conditions according to coding standards.
---

---
 drivers/net/mlx5/mlx5_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2a4073c126..37502067d4 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -3548,7 +3548,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (queue == NULL)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, queue->index);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (conf == NULL || conf->tx_explicit != 0)
 				return 0;
 			queue_action = 1;
 			action_n++;
@@ -3558,7 +3558,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (rss == NULL || rss->queue_num == 0)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, rss->queue[0]);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (conf == NULL || conf->tx_explicit != 0)
 				return 0;
 			queue_action = 1;
 			action_n++;
-- 
2.25.1


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

* [dpdk-stable] [PATCH v2] net/mlx5: fix flow check hairpin split
  2021-01-10 17:32 ` [dpdk-stable] [PATCH v2] " Dekel Peled
@ 2021-01-10 17:37   ` Dekel Peled
  2021-01-11 23:28   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  1 sibling, 0 replies; 5+ messages in thread
From: Dekel Peled @ 2021-01-10 17:37 UTC (permalink / raw)
  To: matan, shahafs, viacheslavo; +Cc: dev, stable

Previously, the identification of hairpin queue was done using
mlx5_rxq_get_type() function.
Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(),
and check of the return value conf != NULL.
The case of return value is NULL (queue is not hairpin) was not handled.
As result, non-hairpin flows were wrongly handled.
This patch adds the required check for return value is NULL.

Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

---
v2: update conditions according to coding standards.
---

---
 drivers/net/mlx5/mlx5_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2a4073c126..37502067d4 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -3548,7 +3548,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (queue == NULL)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, queue->index);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (conf == NULL || conf->tx_explicit != 0)
 				return 0;
 			queue_action = 1;
 			action_n++;
@@ -3558,7 +3558,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev,
 			if (rss == NULL || rss->queue_num == 0)
 				return 0;
 			conf = mlx5_rxq_get_hairpin_conf(dev, rss->queue[0]);
-			if (conf != NULL && !!conf->tx_explicit)
+			if (conf == NULL || conf->tx_explicit != 0)
 				return 0;
 			queue_action = 1;
 			action_n++;
-- 
2.25.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/mlx5: fix flow check hairpin split
  2021-01-10 17:32 ` [dpdk-stable] [PATCH v2] " Dekel Peled
  2021-01-10 17:37   ` Dekel Peled
@ 2021-01-11 23:28   ` Thomas Monjalon
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-01-11 23:28 UTC (permalink / raw)
  To: Dekel Peled; +Cc: matan, shahafs, viacheslavo, dev, stable

10/01/2021 18:37, Dekel Peled:
> Previously, the identification of hairpin queue was done using
> mlx5_rxq_get_type() function.
> Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(),
> and check of the return value conf != NULL.
> The case of return value is NULL (queue is not hairpin) was not handled.
> As result, non-hairpin flows were wrongly handled.
> This patch adds the required check for return value is NULL.
> 
> Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Applied in next-net-mlx, thanks.




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

end of thread, other threads:[~2021-01-11 23:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 15:18 [dpdk-stable] [PATCH] net/mlx5: fix flow check hairpin split Dekel Peled
2021-01-06 21:21 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2021-01-10 17:32 ` [dpdk-stable] [PATCH v2] " Dekel Peled
2021-01-10 17:37   ` Dekel Peled
2021-01-11 23:28   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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).