net/sfc: fix link status when port is not started
Fixes: 886f8d8a05
("net/sfc: retrieve link info")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
This commit is contained in:
parent
f08a237783
commit
9b098c525b
@ -188,14 +188,17 @@ sfc_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
|
||||
|
||||
sfc_log_init(sa, "entry");
|
||||
|
||||
if (sa->state != SFC_ADAPTER_STARTED)
|
||||
return 0;
|
||||
|
||||
retry:
|
||||
EFX_STATIC_ASSERT(sizeof(*dev_link) == sizeof(rte_atomic64_t));
|
||||
*(int64_t *)&old_link = rte_atomic64_read((rte_atomic64_t *)dev_link);
|
||||
|
||||
if (wait_to_complete) {
|
||||
if (sa->state != SFC_ADAPTER_STARTED) {
|
||||
sfc_port_link_mode_to_info(EFX_LINK_UNKNOWN, ¤t_link);
|
||||
if (!rte_atomic64_cmpset((volatile uint64_t *)dev_link,
|
||||
*(uint64_t *)&old_link,
|
||||
*(uint64_t *)¤t_link))
|
||||
goto retry;
|
||||
} else if (wait_to_complete) {
|
||||
efx_link_mode_t link_mode;
|
||||
|
||||
if (efx_port_poll(sa->nic, &link_mode) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user