Skip to content

Commit 4106a75

Browse files
mikijoyjgunthorpe
authored andcommitted
IB/mlx5: Report CapabilityMask2 in ib_query_port
CapabilityMask2 exists when IB_PORT_CAP_MASK2_SUP is set in the original capability mask. In such cases, query its value and report it in query port. 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 a5a5d19 commit 4106a75

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

drivers/infiniband/hw/mlx5/mad.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ 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)
572+
props->port_cap_flags2 =
573+
be16_to_cpup((__be16 *)(out_mad->data + 60));
574+
571575
/* Check if extended speeds (EDR/FDR/...) are supported */
572576
if (props->port_cap_flags & IB_PORT_EXTENDED_SPEEDS_SUP) {
573577
ext_active_speed = out_mad->data[62] >> 4;

drivers/infiniband/hw/mlx5/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,9 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,
12281228
props->subnet_timeout = rep->subnet_timeout;
12291229
props->init_type_reply = rep->init_type_reply;
12301230

1231+
if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP)
1232+
props->port_cap_flags2 = rep->cap_mask2;
1233+
12311234
err = mlx5_query_port_link_width_oper(mdev, &ib_link_width_oper, port);
12321235
if (err)
12331236
goto out;

include/linux/mlx5/driver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ struct mlx5_hca_vport_context {
749749
u64 node_guid;
750750
u32 cap_mask1;
751751
u32 cap_mask1_perm;
752-
u32 cap_mask2;
753-
u32 cap_mask2_perm;
752+
u16 cap_mask2;
753+
u16 cap_mask2_perm;
754754
u16 lid;
755755
u8 init_type_reply; /* bitmask: see ib spec 14.2.5.6 InitTypeReply */
756756
u8 lmc;

0 commit comments

Comments
 (0)