net/mlx5: fix link speed info when link is down
authorXiaoyu Min <jackmin@mellanox.com>
Mon, 5 Aug 2019 08:02:03 +0000 (16:02 +0800)
committerRaslan Darawsheh <rasland@mellanox.com>
Tue, 6 Aug 2019 15:42:12 +0000 (17:42 +0200)
commit6fd05da9efbd387d0f1fdd7824bc5298dff368fe
treebeb0fd3ea7005c5d3977f7a8820ac734a486a867
parentf32a3f5216a33839799932451dde305759082efb
net/mlx5: fix link speed info when link is down

When the link is down, the link speed returned by ethtool is
UINT32_MAX and the link status is 0.

In this case, the DPDK ethdev link speed should be set to
ETH_SPEED_NUM_NONE.
Otherwise since link speed is non-zero but link status is zero, this
is an inconsistent situation and -EAGAIN is returned, which is not right.

Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_ethdev.c