aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/mad.c
diff options
context:
space:
mode:
authorMichael Guralnik <michaelgur@mellanox.com>2018-12-09 11:49:54 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-12-11 14:38:16 -0700
commitd764970bcea34b2d907ef1b9fe29d09b17099552 (patch)
tree443e97e03a0cf4dc5b893a3841e460d0ea29110b /drivers/infiniband/hw/mlx5/mad.c
parentMerge tag 'v4.20-rc6' into rdma.git for-next (diff)
downloadlinux-dev-d764970bcea34b2d907ef1b9fe29d09b17099552.tar.xz
linux-dev-d764970bcea34b2d907ef1b9fe29d09b17099552.zip
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>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/mad.c')
-rw-r--r--drivers/infiniband/hw/mlx5/mad.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c
index a2735f246d5c..00e5d29517ca 100644
--- a/drivers/infiniband/hw/mlx5/mad.c
+++ b/drivers/infiniband/hw/mlx5/mad.c
@@ -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;