Skip to content

Commit ab7d228

Browse files
PatrisiousHaddadrleon
authored andcommitted
net/mlx5: Query ADV_RDMA capabilities
Query ADV_RDMA capabilities which provide information for advanced RDMA related features. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/e3e6ede03ea31cd201078dcdd4e407608e4a5a87.1740574103.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent f9deed0 commit ab7d228

4 files changed

Lines changed: 54 additions & 1 deletion

File tree

drivers/net/ethernet/mellanox/mlx5/core/fw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
287287
return err;
288288
}
289289

290+
if (MLX5_CAP_GEN(dev, adv_rdma)) {
291+
err = mlx5_core_get_caps_mode(dev, MLX5_CAP_ADV_RDMA,
292+
HCA_CAP_OPMOD_GET_CUR);
293+
if (err)
294+
return err;
295+
}
296+
290297
return 0;
291298
}
292299

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ static const int types[] = {
17951795
MLX5_CAP_ADV_VIRTUALIZATION,
17961796
MLX5_CAP_CRYPTO,
17971797
MLX5_CAP_SHAMPO,
1798+
MLX5_CAP_ADV_RDMA,
17981799
};
17991800

18001801
static void mlx5_hca_caps_free(struct mlx5_core_dev *dev)

include/linux/mlx5/device.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,7 @@ enum mlx5_cap_type {
12511251
MLX5_CAP_GENERAL_2 = 0x20,
12521252
MLX5_CAP_PORT_SELECTION = 0x25,
12531253
MLX5_CAP_ADV_VIRTUALIZATION = 0x26,
1254+
MLX5_CAP_ADV_RDMA = 0x28,
12541255
/* NUM OF CAP Types */
12551256
MLX5_CAP_NUM
12561257
};
@@ -1384,6 +1385,10 @@ enum mlx5_qcam_feature_groups {
13841385
MLX5_GET(adv_virtualization_cap, \
13851386
mdev->caps.hca[MLX5_CAP_ADV_VIRTUALIZATION]->cur, cap)
13861387

1388+
#define MLX5_CAP_ADV_RDMA(mdev, cap) \
1389+
MLX5_GET(adv_rdma_cap, \
1390+
mdev->caps.hca[MLX5_CAP_ADV_RDMA]->cur, cap)
1391+
13871392
#define MLX5_CAP_FLOWTABLE_PORT_SELECTION(mdev, cap) \
13881393
MLX5_CAP_PORT_SELECTION(mdev, flow_table_properties_port_selection.cap)
13891394

include/linux/mlx5/mlx5_ifc.h

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
19931993
u8 max_geneve_tlv_options[0x8];
19941994
u8 reserved_at_568[0x3];
19951995
u8 max_geneve_tlv_option_data_len[0x5];
1996-
u8 reserved_at_570[0x9];
1996+
u8 reserved_at_570[0x1];
1997+
u8 adv_rdma[0x1];
1998+
u8 reserved_at_572[0x7];
19971999
u8 adv_virtualization[0x1];
19982000
u8 reserved_at_57a[0x6];
19992001

@@ -13076,6 +13078,44 @@ struct mlx5_ifc_load_vhca_state_out_bits {
1307613078
u8 reserved_at_40[0x40];
1307713079
};
1307813080

13081+
struct mlx5_ifc_adv_rdma_cap_bits {
13082+
u8 rdma_transport_manager[0x1];
13083+
u8 rdma_transport_manager_other_eswitch[0x1];
13084+
u8 reserved_at_2[0x1e];
13085+
13086+
u8 rcx_type[0x8];
13087+
u8 reserved_at_28[0x2];
13088+
u8 ps_entry_log_max_value[0x6];
13089+
u8 reserved_at_30[0x6];
13090+
u8 qp_max_ps_num_entry[0xa];
13091+
13092+
u8 mp_max_num_queues[0x8];
13093+
u8 ps_user_context_max_log_size[0x8];
13094+
u8 message_based_qp_and_striding_wq[0x8];
13095+
u8 reserved_at_58[0x8];
13096+
13097+
u8 max_receive_send_message_size_stride[0x10];
13098+
u8 reserved_at_70[0x10];
13099+
13100+
u8 max_receive_send_message_size_byte[0x20];
13101+
13102+
u8 reserved_at_a0[0x160];
13103+
13104+
struct mlx5_ifc_flow_table_prop_layout_bits rdma_transport_rx_flow_table_properties;
13105+
13106+
struct mlx5_ifc_flow_table_prop_layout_bits rdma_transport_tx_flow_table_properties;
13107+
13108+
struct mlx5_ifc_flow_table_fields_supported_2_bits rdma_transport_rx_ft_field_support_2;
13109+
13110+
struct mlx5_ifc_flow_table_fields_supported_2_bits rdma_transport_tx_ft_field_support_2;
13111+
13112+
struct mlx5_ifc_flow_table_fields_supported_2_bits rdma_transport_rx_ft_field_bitmask_support_2;
13113+
13114+
struct mlx5_ifc_flow_table_fields_supported_2_bits rdma_transport_tx_ft_field_bitmask_support_2;
13115+
13116+
u8 reserved_at_800[0x3800];
13117+
};
13118+
1307913119
struct mlx5_ifc_adv_virtualization_cap_bits {
1308013120
u8 reserved_at_0[0x3];
1308113121
u8 pg_track_log_max_num[0x5];

0 commit comments

Comments
 (0)