[PATCH v5 36/45] net/sxe2: use primary VSI ID for representor VSI

liujie5 at linkdatatechnology.com liujie5 at linkdatatechnology.com
Fri Aug 28 05:26:39 CEST 2026


From: Jie Liu <liujie5 at linkdatatechnology.com>

repr_priv_data->repr_vf_vsi_id is assigned with a ternary that falls
back to the backup (dpdk) VSI ID when the kernel VSI ID is invalid.
The V3 implementation assigns it directly from
repr_vf_primary_vsi_id.

Align with the V3 implementation by assigning repr_vf_vsi_id from
repr_vf_primary_vsi_id.

Fixes: 635084db5d57 ("net/sxe2: support VF representors")
Cc: stable at dpdk.org
Cc: stephen at networkplumber.org
Signed-off-by: Jie Liu <liujie5 at linkdatatechnology.com>
---
 drivers/net/sxe2/sxe2_switchdev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_switchdev.c b/drivers/net/sxe2/sxe2_switchdev.c
index d0304ccc94..81ced7b855 100644
--- a/drivers/net/sxe2/sxe2_switchdev.c
+++ b/drivers/net/sxe2/sxe2_switchdev.c
@@ -323,11 +323,7 @@ int32_t sxe2_switchdev_repr_private_data_init(struct rte_eth_dev *dev,
 	repr_priv_data->repr_vf_backup_vsi_id =
 		parent_adapter->repr_ctxt.repr_vf_id[repr_id].dpdk_vsi_id;
 
-	repr_priv_data->repr_vf_vsi_id =
-		parent_adapter->repr_ctxt.repr_vf_id[repr_id].kernel_vsi_id !=
-		SXE2_INVALID_VSI_ID ?
-		parent_adapter->repr_ctxt.repr_vf_id[repr_id].kernel_vsi_id :
-		parent_adapter->repr_ctxt.repr_vf_id[repr_id].dpdk_vsi_id;
+	repr_priv_data->repr_vf_vsi_id = repr_priv_data->repr_vf_primary_vsi_id;
 
 	adapter->repr_priv_data = repr_priv_data;
 	goto l_end;
-- 
2.52.0



More information about the dev mailing list