RDMA/efa: Report link speed according to device attributes
Subsystems (2)
Michael Margolin
maintainerPATCH 1/1 RDMA/efa: Report link speed according to device attributes
Set port link speed and width based on max bandwidth acquired from the device instead of using constant 100 Gbps. Use a default value in case the device didn't set the field.
Reviewed-by Daniel Kranzdorf <[email protected]>
Reviewed-by Firas Jahjah <[email protected]>
Signed-off-by Michael Margolin <[email protected]>
--- .../infiniband/hw/efa/efa_admin_cmds_defs.h | 9 ++++ drivers/infiniband/hw/efa/efa_com_cmd.c | 1 + drivers/infiniband/hw/efa/efa_com_cmd.h | 1 + drivers/infiniband/hw/efa/efa_verbs.c | 45 ++++++++++++++++++- 4 files changed, 54 insertions(+), 2 deletions(-)
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h +9 -0
@@ -718,6 +718,15 @@ struct efa_admin_feature_device_attr_desc {/* Unique global ID for an EFA device */ u64 guid; + +/* The device maximum link speed in Gbit/sec */ +u16 max_link_speed_gbps; + +/* MBZ */ +u16 reserved0; + +/* MBZ */ +u32 reserved1; };struct efa_admin_feature_queue_attr_desc {
drivers/infiniband/hw/efa/efa_com_cmd.c +1 -0
@@ -467,6 +467,7 @@ int efa_com_get_device_attr(struct efa_com_dev *edev, result->max_rdma_size = resp.u.device_attr.max_rdma_size; result->device_caps = resp.u.device_attr.device_caps; result->guid = resp.u.device_attr.guid; + result->max_link_speed_gbps = resp.u.device_attr.max_link_speed_gbps;if (result->admin_api_version <1 ) { ibdev_err_ratelimited(
drivers/infiniband/hw/efa/efa_com_cmd.h +1 -0
@@ -142,6 +142,7 @@ struct efa_com_get_device_attr_result {u16 max_wr_rdma_sge;u16 max_tx_batch;u16 min_sq_depth; +u16 max_link_speed_gbps;u8 db_bar; };
drivers/infiniband/hw/efa/efa_verbs.c +43 -2
67 lines not on this page · raw message
Signature · 1 line
2.40.1
Leon Romanovsky
AppliedQuoted 5 lines · Michael Margolin
Set port link speed and width based on max bandwidth acquired from the device instead of using constant 100 Gbps. Use a default value in case the device didn't set the field.
Applied, thanks!
[1/1] RDMA/efa: Report link speed according to device attributes
https://git.kernel.org/rdma/rdma/c/1103579d6e32a9
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>