mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-09 07:14:48 +08:00
RDMA/core: Add encode/decode FDR/EDR rates
The cases for FDR/EDR signalling speed, were missing in ib_rate_to_mult and mult_to_ib_rate giving wrong return values when drivers convert static rate to/from inter-packet-delay. Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com> Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
106b886306
commit
e2dda36855
@ -133,6 +133,14 @@ __attribute_const__ int ib_rate_to_mult(enum ib_rate rate)
|
||||
case IB_RATE_60_GBPS: return 24;
|
||||
case IB_RATE_80_GBPS: return 32;
|
||||
case IB_RATE_120_GBPS: return 48;
|
||||
case IB_RATE_14_GBPS: return 6;
|
||||
case IB_RATE_56_GBPS: return 22;
|
||||
case IB_RATE_112_GBPS: return 45;
|
||||
case IB_RATE_168_GBPS: return 67;
|
||||
case IB_RATE_25_GBPS: return 10;
|
||||
case IB_RATE_100_GBPS: return 40;
|
||||
case IB_RATE_200_GBPS: return 80;
|
||||
case IB_RATE_300_GBPS: return 120;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
@ -150,6 +158,14 @@ __attribute_const__ enum ib_rate mult_to_ib_rate(int mult)
|
||||
case 24: return IB_RATE_60_GBPS;
|
||||
case 32: return IB_RATE_80_GBPS;
|
||||
case 48: return IB_RATE_120_GBPS;
|
||||
case 6: return IB_RATE_14_GBPS;
|
||||
case 22: return IB_RATE_56_GBPS;
|
||||
case 45: return IB_RATE_112_GBPS;
|
||||
case 67: return IB_RATE_168_GBPS;
|
||||
case 10: return IB_RATE_25_GBPS;
|
||||
case 40: return IB_RATE_100_GBPS;
|
||||
case 80: return IB_RATE_200_GBPS;
|
||||
case 120: return IB_RATE_300_GBPS;
|
||||
default: return IB_RATE_PORT_CURRENT;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user