Commit 69054666 authored by Sagiv Ozeri's avatar Sagiv Ozeri Committed by Jason Gunthorpe

RDMA/qedr: Fix incorrect device rate.

Use the correct enum value introduced in commit 12113a35 ("IB/core:
Add HDR speed enum") Prior to this change a 50Gbps port would show 40Gbps.

This patch also cleaned up the redundant redefiniton of ib speeds for
qedr.

Fixes: 12113a35 ("IB/core: Add HDR speed enum")
Signed-off-by: default avatarSagiv Ozeri <sagiv.ozeri@marvell.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 91f57129
...@@ -159,54 +159,47 @@ int qedr_query_device(struct ib_device *ibdev, ...@@ -159,54 +159,47 @@ int qedr_query_device(struct ib_device *ibdev,
return 0; return 0;
} }
#define QEDR_SPEED_SDR (1)
#define QEDR_SPEED_DDR (2)
#define QEDR_SPEED_QDR (4)
#define QEDR_SPEED_FDR10 (8)
#define QEDR_SPEED_FDR (16)
#define QEDR_SPEED_EDR (32)
static inline void get_link_speed_and_width(int speed, u8 *ib_speed, static inline void get_link_speed_and_width(int speed, u8 *ib_speed,
u8 *ib_width) u8 *ib_width)
{ {
switch (speed) { switch (speed) {
case 1000: case 1000:
*ib_speed = QEDR_SPEED_SDR; *ib_speed = IB_SPEED_SDR;
*ib_width = IB_WIDTH_1X; *ib_width = IB_WIDTH_1X;
break; break;
case 10000: case 10000:
*ib_speed = QEDR_SPEED_QDR; *ib_speed = IB_SPEED_QDR;
*ib_width = IB_WIDTH_1X; *ib_width = IB_WIDTH_1X;
break; break;
case 20000: case 20000:
*ib_speed = QEDR_SPEED_DDR; *ib_speed = IB_SPEED_DDR;
*ib_width = IB_WIDTH_4X; *ib_width = IB_WIDTH_4X;
break; break;
case 25000: case 25000:
*ib_speed = QEDR_SPEED_EDR; *ib_speed = IB_SPEED_EDR;
*ib_width = IB_WIDTH_1X; *ib_width = IB_WIDTH_1X;
break; break;
case 40000: case 40000:
*ib_speed = QEDR_SPEED_QDR; *ib_speed = IB_SPEED_QDR;
*ib_width = IB_WIDTH_4X; *ib_width = IB_WIDTH_4X;
break; break;
case 50000: case 50000:
*ib_speed = QEDR_SPEED_QDR; *ib_speed = IB_SPEED_HDR;
*ib_width = IB_WIDTH_4X; *ib_width = IB_WIDTH_1X;
break; break;
case 100000: case 100000:
*ib_speed = QEDR_SPEED_EDR; *ib_speed = IB_SPEED_EDR;
*ib_width = IB_WIDTH_4X; *ib_width = IB_WIDTH_4X;
break; break;
default: default:
/* Unsupported */ /* Unsupported */
*ib_speed = QEDR_SPEED_SDR; *ib_speed = IB_SPEED_SDR;
*ib_width = IB_WIDTH_1X; *ib_width = IB_WIDTH_1X;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment