net/mlx5: fix wire vport hint
PATCH 1/1 net/mlx5: fix wire vport hint
In order to optimize number of hops in the steering tables there was the hint field of source vport in the matcher. If this hint was provided for the wire port the actual vport match, used by kernel, was not set in the matcher metadata register field. This could led to not creating the rule in hardware and E-Switch malfunction if kernel used non-zero metadata value for the wire vport.
This patch always sets the match for the vport metadata register value besides the hint.
--- drivers/net/mlx5/mlx5_flow_dv.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/mlx5/mlx5_flow_dv.c +9 -5
@@ -7964,11 +7964,15 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher, priv->pf_bond < 0 && attr->transfer)flow_dv_translate_item_source_vport (matcher, key, priv->vport_id, mask); - else - flow_dv_translate_item_meta_vport - (matcher, key, - priv->vport_meta_tag, - priv->vport_meta_mask); +/* +* We should always set the vport metadata register, +* otherwise the SW steering library can drop +* the rule if wire vport metadata value is not zero, +* it depends on kernel configuration. +*/ +flow_dv_translate_item_meta_vport (matcher, key, + priv->vport_meta_tag, + priv->vport_meta_mask); }else {flow_dv_translate_item_source_vport (matcher, key, priv->vport_id, mask);
Signature · 1 line
2.18.1
Hi,
Quoted 17 lines
-----Original Message-----
From: Viacheslav Ovsiienko <[email protected]>
Sent: Wednesday, January 27, 2021 3:53 PM
To: [email protected]
Cc: Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix wire vport hintIn order to optimize number of hops in the steering tables there was the hint field of source vport in the matcher. If this hint was provided for the wire port the actual vport match, used by kernel, was not set in the matcher metadata register field. This could led to not creating the rule in hardware and E-Switch malfunction if kernel used non-zero metadata value for the wire vport.
Quoted 8 lines
This patch always sets the match for the vport metadata register value besides the hint.
Fixes aaf34de5d801 ("net/mlx5: add wire vport hint")Signed-off-by Viacheslav Ovsiienko <[email protected]>---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh