Orabug:
24449061
The ipd is calculated wrongly because it compares the active speed enum
with the value return from ib_rate_to_mult. Thus, this patch converts the
PSIF Active speed enum to a multiple of the base rate of SDR (2.5 Gbps).
Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
}
}
+/* psif_port_speed to mult - convert the IB speed definition to a
+ * multiple of the base rate of 2.5 Gbps. E.g, PSIF_SPEED_EDR will
+ * be converted to 10, as 25 Gbps is 10 * 2.5 Gbps.
+ */
+const int psif_port_speed_to_mult(enum psif_port_speed speed)
+{
+ switch (speed) {
+ default:
+ case PSIF_PORT_SPEED_FIELD_MAX:
+ case PSIF_SPEED_SDR:
+ return 1;
+ case PSIF_SPEED_DDR:
+ return 2;
+ case PSIF_SPEED_QDR:
+ return 4;
+ case PSIF_SPEED_FDR10:
+ return 4;
+ case PSIF_SPEED_FDR:
+ return 5;
+ case PSIF_SPEED_EDR:
+ return 10;
+ }
+}
/* TBD: IB datastructure dump functions - remove/replace? */
enum ib_mtu sif2ib_path_mtu(enum psif_path_mtu mtu);
enum psif_path_mtu ib2sif_path_mtu(enum ib_mtu mtu);
enum kernel_ulp_type sif_find_kernel_ulp_caller(void);
+const int psif_port_speed_to_mult(enum psif_port_speed speed);
/* TBD: IB datastructure dump functions - remove/replace? */
const char *ib_event2str(enum ib_event_type e);
int path = ib_rate_to_mult(static_rate);
int link;
u8 active_speed = sdev->port[port - 1].active_speed;
+ int active_mult = psif_port_speed_to_mult((enum psif_port_speed)active_speed);
u8 active_width = sdev->port[port - 1].active_width;
if (static_rate == IB_RATE_PORT_CURRENT) {
return -EDEADLK;
}
- /* 2^active_width * active_speed */
- link = (1 << active_width)*active_speed;
+ /* 2^active_width * mult SDR of active speed */
+ link = (1 << active_width)*active_mult;
if (path >= link)
*ipd = 0;