Skip to contentSkip to conversation

RDMA/efa: Report link speed according to device attributes

PATCH Applied Michael Margolin 2 participants 2 messages Oct 30, 2024

Subsystems (2)
lore
Share & tools
lore

Michael Margolin

author maintainer
#0 lore raw

PATCH 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.

---
 .../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
index 88a9aee7e743..fe0b6aec7839 100644
@@ -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
index 9e04edb9dbda..c6b89c45fdc9 100644
@@ -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
index 25f02c0d9698..5511355b700d 100644
@@ -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
#1 lore raw
Quoted 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]>