mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
IB/mlx5: Expose XDR speed through MAD
Under MAD query port, Report NDR speed when NDR is supported in the port capability mask. Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Reviewed-by: Mark Zhang <markzhang@nvidia.com> Link: https://lore.kernel.org/r/d30bdec2a66a8a2edd1d84ee61453c58cf346b43.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
703289ce43
commit
561b4a3ac6
|
@ -619,6 +619,19 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u32 port,
|
|||
}
|
||||
}
|
||||
|
||||
/* Check if extended speeds 2 (XDR/...) are supported */
|
||||
if (props->port_cap_flags & IB_PORT_CAP_MASK2_SUP &&
|
||||
props->port_cap_flags2 & IB_PORT_EXTENDED_SPEEDS2_SUP) {
|
||||
ext_active_speed = (out_mad->data[56] >> 4) & 0x6;
|
||||
|
||||
switch (ext_active_speed) {
|
||||
case 2:
|
||||
if (props->port_cap_flags2 & IB_PORT_LINK_SPEED_XDR_SUP)
|
||||
props->active_speed = IB_SPEED_XDR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If reported active speed is QDR, check if is FDR-10 */
|
||||
if (props->active_speed == 4) {
|
||||
if (dev->port_caps[port - 1].ext_port_cap &
|
||||
|
|
|
@ -277,6 +277,8 @@ enum ib_port_capability_mask2_bits {
|
|||
IB_PORT_LINK_WIDTH_2X_SUP = 1 << 4,
|
||||
IB_PORT_LINK_SPEED_HDR_SUP = 1 << 5,
|
||||
IB_PORT_LINK_SPEED_NDR_SUP = 1 << 10,
|
||||
IB_PORT_EXTENDED_SPEEDS2_SUP = 1 << 11,
|
||||
IB_PORT_LINK_SPEED_XDR_SUP = 1 << 12,
|
||||
};
|
||||
|
||||
#define OPA_CLASS_PORT_INFO_PR_SUPPORT BIT(26)
|
||||
|
|
Loading…
Reference in a new issue