Take advantage of if_baudrate_pf and calculate an effective baud rate on
all platforms (not just amd64) to compute an equivalent IB rate.
This commit is contained in:
parent
989343faad
commit
345a795543
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241697
@ -247,17 +247,21 @@ static inline int iboe_get_rate(struct net_device *dev)
|
|||||||
#else
|
#else
|
||||||
static inline int iboe_get_rate(struct net_device *dev)
|
static inline int iboe_get_rate(struct net_device *dev)
|
||||||
{
|
{
|
||||||
#ifdef __amd64__
|
uintmax_t baudrate;
|
||||||
if (dev->if_baudrate >= IF_Gbps(40ULL))
|
int exp;
|
||||||
|
|
||||||
|
baudrate = dev->if_baudrate;
|
||||||
|
for (exp = dev->if_baudrate_pf; exp > 0; exp--)
|
||||||
|
baudrate *= 10;
|
||||||
|
if (baudrate >= IF_Gbps(40))
|
||||||
return IB_RATE_40_GBPS;
|
return IB_RATE_40_GBPS;
|
||||||
else if (dev->if_baudrate >= IF_Gbps(30ULL))
|
else if (baudrate >= IF_Gbps(30))
|
||||||
return IB_RATE_30_GBPS;
|
return IB_RATE_30_GBPS;
|
||||||
else if (dev->if_baudrate >= IF_Gbps(20ULL))
|
else if (baudrate >= IF_Gbps(20))
|
||||||
return IB_RATE_20_GBPS;
|
return IB_RATE_20_GBPS;
|
||||||
else if (dev->if_baudrate >= IF_Gbps(10ULL))
|
else if (baudrate >= IF_Gbps(10))
|
||||||
return IB_RATE_10_GBPS;
|
return IB_RATE_10_GBPS;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
return IB_RATE_PORT_CURRENT;
|
return IB_RATE_PORT_CURRENT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user