patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority
@ 2020-08-11 12:20 Gregory Etelson
  2020-08-11 17:57 ` Luca Boccassi
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Etelson @ 2020-08-11 12:20 UTC (permalink / raw)
  To: stable; +Cc: getelson, rasland, luca.boccassi, Ori Kam

[ upstream commit 750ff30a8fde522477babb0d4fcdc6fb9eb21fde ]

PMD flow priority is different from application flow priority.  Flow
rules with higher match granularity assigned higher PMD priority. Also
PMD splits internally RSS flows according to flow RSS layer.

Final PMD flow rule priority derived from the last match item network
level, after PMD adjusts flow rule, where L4 match gets the highest
priority and L2 the lowest.

The patch adjusts tunnels flow rule priority calculation for PMDs
running verb API.

Fixes: 4a78c88e3bae ("net/mlx5: fix Verbs flow tunnel")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 7ac6a25e43..0c5e56e409 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -1478,6 +1478,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
 	uint64_t priority = attr->priority;
 	uint32_t subpriority = 0;
 	struct mlx5_priv *priv = dev->data->dev_private;
+	struct rte_flow *flow = dev_flow->flow;
 
 	if (priority == MLX5_FLOW_PRIO_RSVD)
 		priority = priv->config.flow_prio - 1;
@@ -1596,25 +1597,33 @@ flow_verbs_translate(struct rte_eth_dev *dev,
 		case RTE_FLOW_ITEM_TYPE_VXLAN:
 			flow_verbs_translate_item_vxlan(dev_flow, items,
 							item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_VXLAN;
 			break;
 		case RTE_FLOW_ITEM_TYPE_VXLAN_GPE:
 			flow_verbs_translate_item_vxlan_gpe(dev_flow, items,
 							    item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_VXLAN_GPE;
 			break;
 		case RTE_FLOW_ITEM_TYPE_GRE:
 			flow_verbs_translate_item_gre(dev_flow, items,
 						      item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_GRE;
 			break;
 		case RTE_FLOW_ITEM_TYPE_MPLS:
 			flow_verbs_translate_item_mpls(dev_flow, items,
 						       item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_MPLS;
 			break;
 		default:
-- 
2.25.1


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

* Re: [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority
  2020-08-11 12:20 [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority Gregory Etelson
@ 2020-08-11 17:57 ` Luca Boccassi
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Boccassi @ 2020-08-11 17:57 UTC (permalink / raw)
  To: Gregory Etelson, stable; +Cc: rasland, Ori Kam

On Tue, 2020-08-11 at 15:20 +0300, Gregory Etelson wrote:
> [ upstream commit 750ff30a8fde522477babb0d4fcdc6fb9eb21fde ]
> 
> PMD flow priority is different from application flow priority.  Flow
> rules with higher match granularity assigned higher PMD priority. Also
> PMD splits internally RSS flows according to flow RSS layer.
> 
> Final PMD flow rule priority derived from the last match item network
> level, after PMD adjusts flow rule, where L4 match gets the highest
> priority and L2 the lowest.
> 
> The patch adjusts tunnels flow rule priority calculation for PMDs
> running verb API.
> 
> Fixes: 4a78c88e3bae ("net/mlx5: fix Verbs flow tunnel")
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_verbs.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)

Thank you, applied and pushed.

-- 
Kind regards,
Luca Boccassi

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

* [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority
@ 2020-08-11 11:48 Gregory Etelson
  0 siblings, 0 replies; 3+ messages in thread
From: Gregory Etelson @ 2020-08-11 11:48 UTC (permalink / raw)
  To: stable; +Cc: getelson, rasland, Ori Kam

[ upstream commit 750ff30a8fde522477babb0d4fcdc6fb9eb21fde ]

PMD flow priority is different from application flow priority.  Flow
rules with higher match granularity assigned higher PMD priority. Also
PMD splits internally RSS flows according to flow RSS layer.

Final PMD flow rule priority derived from the last match item network
level, after PMD adjusts flow rule, where L4 match gets the highest
priority and L2 the lowest.

The patch adjusts tunnels flow rule priority calculation for PMDs
running verb API.

Fixes: 4a78c88e3bae ("net/mlx5: fix Verbs flow tunnel")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 7ac6a25e43..0c5e56e409 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -1478,6 +1478,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
 	uint64_t priority = attr->priority;
 	uint32_t subpriority = 0;
 	struct mlx5_priv *priv = dev->data->dev_private;
+	struct rte_flow *flow = dev_flow->flow;
 
 	if (priority == MLX5_FLOW_PRIO_RSVD)
 		priority = priv->config.flow_prio - 1;
@@ -1596,25 +1597,33 @@ flow_verbs_translate(struct rte_eth_dev *dev,
 		case RTE_FLOW_ITEM_TYPE_VXLAN:
 			flow_verbs_translate_item_vxlan(dev_flow, items,
 							item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_VXLAN;
 			break;
 		case RTE_FLOW_ITEM_TYPE_VXLAN_GPE:
 			flow_verbs_translate_item_vxlan_gpe(dev_flow, items,
 							    item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_VXLAN_GPE;
 			break;
 		case RTE_FLOW_ITEM_TYPE_GRE:
 			flow_verbs_translate_item_gre(dev_flow, items,
 						      item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_GRE;
 			break;
 		case RTE_FLOW_ITEM_TYPE_MPLS:
 			flow_verbs_translate_item_mpls(dev_flow, items,
 						       item_flags);
-			subpriority = MLX5_PRIORITY_MAP_L2;
+			subpriority = flow->rss.level >= 2 ?
+					MLX5_PRIORITY_MAP_L2 :
+					MLX5_PRIORITY_MAP_L4;
 			item_flags |= MLX5_FLOW_LAYER_MPLS;
 			break;
 		default:
-- 
2.25.1


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 12:20 [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority Gregory Etelson
2020-08-11 17:57 ` Luca Boccassi
  -- strict thread matches above, loose matches on Subject: below --
2020-08-11 11:48 Gregory Etelson

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