]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/mlx5: Add other_eswitch support for devx destruction
authorPatrisious Haddad <phaddad@nvidia.com>
Wed, 29 Oct 2025 15:42:57 +0000 (17:42 +0200)
committerLeon Romanovsky <leon@kernel.org>
Sun, 9 Nov 2025 10:21:38 +0000 (05:21 -0500)
When building a devx object destruction command for steering objects add
consideration for other_eswitch argument to allow proper destruction for
objects that were created with it.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20251029-support-other-eswitch-v1-5-98bb707b5d57@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/devx.c

index 8b506417ad2fbef8b4754f195b99e5bfbf8f4061..d31d7f3005c646a8aa0fae5e0cdec91bd0cea505 100644 (file)
@@ -1225,6 +1225,11 @@ static void devx_obj_build_destroy_cmd(void *in, void *out, void *din,
                         MLX5_GET(create_flow_table_in,  in, other_vport));
                MLX5_SET(destroy_flow_table_in, din, vport_number,
                         MLX5_GET(create_flow_table_in,  in, vport_number));
+               MLX5_SET(destroy_flow_table_in, din, other_eswitch,
+                        MLX5_GET(create_flow_table_in,  in, other_eswitch));
+               MLX5_SET(destroy_flow_table_in, din, eswitch_owner_vhca_id,
+                        MLX5_GET(create_flow_table_in, in,
+                                 eswitch_owner_vhca_id));
                MLX5_SET(destroy_flow_table_in, din, table_type,
                         MLX5_GET(create_flow_table_in,  in, table_type));
                MLX5_SET(destroy_flow_table_in, din, table_id, *obj_id);
@@ -1237,6 +1242,11 @@ static void devx_obj_build_destroy_cmd(void *in, void *out, void *din,
                         MLX5_GET(create_flow_group_in, in, other_vport));
                MLX5_SET(destroy_flow_group_in, din, vport_number,
                         MLX5_GET(create_flow_group_in, in, vport_number));
+               MLX5_SET(destroy_flow_group_in, din, other_eswitch,
+                        MLX5_GET(create_flow_group_in, in, other_eswitch));
+               MLX5_SET(destroy_flow_group_in, din, eswitch_owner_vhca_id,
+                        MLX5_GET(create_flow_group_in, in,
+                                 eswitch_owner_vhca_id));
                MLX5_SET(destroy_flow_group_in, din, table_type,
                         MLX5_GET(create_flow_group_in, in, table_type));
                MLX5_SET(destroy_flow_group_in, din, table_id,
@@ -1251,6 +1261,10 @@ static void devx_obj_build_destroy_cmd(void *in, void *out, void *din,
                         MLX5_GET(set_fte_in,  in, other_vport));
                MLX5_SET(delete_fte_in, din, vport_number,
                         MLX5_GET(set_fte_in, in, vport_number));
+               MLX5_SET(delete_fte_in, din, other_eswitch,
+                        MLX5_GET(set_fte_in,  in, other_eswitch));
+               MLX5_SET(delete_fte_in, din, eswitch_owner_vhca_id,
+                        MLX5_GET(set_fte_in, in, eswitch_owner_vhca_id));
                MLX5_SET(delete_fte_in, din, table_type,
                         MLX5_GET(set_fte_in, in, table_type));
                MLX5_SET(delete_fte_in, din, table_id,