Re: [PATCH v1] IB/core: Add generic function to extract IB speed from netdev

Moni Shoua
2017-06-08T05:43:41Z

>> >
>> > +void ib_get_speed(struct net_device *netdev, u8 *speed, u8 *width)
>> > +{
>> > + int rc;
>> > + u32 netdev_speed = SPEED_UNKNOWN;
>> > +
>
> [1]
>
I think it should be clear that this function is good only for RoCE
If you pass struct ib_device* instead of struct net_device* you can
check link layer and return bad status of it is not Ethernet
The net_device will be obtained via get_netdev() hook.
Consider adding _eth_ to the name of the function (e.g. ib_get_etht_speed)