Skip to content

Commit d764970

Browse files
mikijoyjgunthorpe
authored andcommitted
IB/mlx5: Add 2X width support to query_port
Report to the user 2x width over MAD interface. Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 28ab1bb commit d764970

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/infiniband/hw/mlx5/mad.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,14 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u8 port,
568568
props->max_vl_num = out_mad->data[37] >> 4;
569569
props->init_type_reply = out_mad->data[41] >> 4;
570570

571-
if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP)
571+
if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP) {
572572
props->port_cap_flags2 =
573573
be16_to_cpup((__be16 *)(out_mad->data + 60));
574574

575+
if (props->port_cap_flags2 & IB_PORT_LINK_WIDTH_2X_SUP)
576+
props->active_width = out_mad->data[31] & 0x1f;
577+
}
578+
575579
/* Check if extended speeds (EDR/FDR/...) are supported */
576580
if (props->port_cap_flags & IB_PORT_EXTENDED_SPEEDS_SUP) {
577581
ext_active_speed = out_mad->data[62] >> 4;

drivers/infiniband/hw/mlx5/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,8 @@ static void translate_active_width(struct ib_device *ibdev, u8 active_width,
11081108

11091109
if (active_width & MLX5_IB_WIDTH_1X)
11101110
*ib_width = IB_WIDTH_1X;
1111+
else if (active_width & MLX5_IB_WIDTH_2X)
1112+
*ib_width = IB_WIDTH_2X;
11111113
else if (active_width & MLX5_IB_WIDTH_4X)
11121114
*ib_width = IB_WIDTH_4X;
11131115
else if (active_width & MLX5_IB_WIDTH_8X)

0 commit comments

Comments
 (0)