patches for DPDK stable branches
 help / color / mirror / Atom feed
* [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

* Re: [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, 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 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

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 11:48 [dpdk-stable] [PATCH 19.11] net/mlx5: fix tunnel flow priority Gregory Etelson
2020-08-11 12:20 Gregory Etelson
2020-08-11 17:57 ` Luca Boccassi

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git