Skip to content

Commit

Permalink
IB/mlx5: Add 2X width support to query_port
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Guralnik authored and Jason Gunthorpe committed Dec 11, 2018
1 parent 28ab1bb commit d764970
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/infiniband/hw/mlx5/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,14 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u8 port,
props->max_vl_num = out_mad->data[37] >> 4;
props->init_type_reply = out_mad->data[41] >> 4;

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

if (props->port_cap_flags2 & IB_PORT_LINK_WIDTH_2X_SUP)
props->active_width = out_mad->data[31] & 0x1f;
}

/* Check if extended speeds (EDR/FDR/...) are supported */
if (props->port_cap_flags & IB_PORT_EXTENDED_SPEEDS_SUP) {
ext_active_speed = out_mad->data[62] >> 4;
Expand Down
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,8 @@ static void translate_active_width(struct ib_device *ibdev, u8 active_width,

if (active_width & MLX5_IB_WIDTH_1X)
*ib_width = IB_WIDTH_1X;
else if (active_width & MLX5_IB_WIDTH_2X)
*ib_width = IB_WIDTH_2X;
else if (active_width & MLX5_IB_WIDTH_4X)
*ib_width = IB_WIDTH_4X;
else if (active_width & MLX5_IB_WIDTH_8X)
Expand Down

0 comments on commit d764970

Please sign in to comment.