net/mlx5: fix the wrong representor ID checking for sample
PATCH 1/1 net/mlx5: fix the wrong representor ID checking for sample
The representor definition was introduced in the latest code. For non-representor port, like PF port, use the 0xffff instead of -1.
This patch updates the representor id checking during splitting sample flow.
--- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/mlx5/mlx5.h +1 -1
@@ -1331,7 +1331,7 @@ struct mlx5_priv {uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */ uint32_t vport_meta_mask;/* Used for vport index field match mask. */ -int32_t representor_id;/* -1 if not a representor. */ +uint16_t representor_id;/* UINT16_MAX if not a representor. */ int32_t pf_bond;/* >=0, representor owner PF index in bonding. */ unsigned int if_index;/* Associated kernel network device index. */ /* RX/TX queues. */
drivers/net/mlx5/mlx5_flow.c +2 -2
@@ -5900,8 +5900,8 @@ flow_create_split_sample(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ACTION ,NULL ,"no memory to split " "sample flow"); -/* The representor_id is -1 for uplink. */ - fdb_tx = (attr->transfer && priv->representor_id !=-1 ); +/* The representor_id is UINT16_MAX for uplink. */ + fdb_tx = (attr->transfer && priv->representor_id !=UINT16_MAX );/* * When reg_c_preserve is set, metadata registers Cx preserve * their value even through packet duplication.
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -5524,7 +5524,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags,"E-Switch must has a dest " "port for mirroring");if (!priv->config.hca_attr.reg_c_preserve && - priv->representor_id !=-1 ) + priv->representor_id !=UINT16_MAX ) *fdb_mirror_limit =1 ; }/* Continue validation for Xcap actions.*/
Signature · 1 line
2.18.1
Hi,
Quoted 14 lines
-----Original Message-----
From: Jiawei(Jonny) Wang <[email protected]>
Sent: Tuesday, June 29, 2021 10:00 AM
To: Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>; Shahaf Shuler <[email protected]>; Xueming(Steven) Li <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix the wrong representor ID checking for sampleThe representor definition was introduced in the latest code. For non-representor port, like PF port, use the
0xffffinstead of -1.
Quoted 7 lines
This patch updates the representor id checking during splitting sample flow.
Fixes cb95feefdd03 ("net/mlx5: support sub-function representor")Signed-off-by Jiawei Wang <[email protected]>Acked-by Xueming Li <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh