This driver was not doing atomic update of link status information. And the return value was different than others. The hardware also does not do autonegotiation (at least on Linux).
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- drivers/net/enic/enic_ethdev.c | 5 ++--- drivers/net/enic/enic_main.c | 17 ++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 669dbf3363fd..68b625468b63 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -446,10 +446,9 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev) ENICPMD_FUNC_TRACE(); enic_disable(enic); + memset(&link, 0, sizeof(link)); - rte_atomic64_cmpset((uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)&link); + rte_eth_linkstatus_set(eth_dev, &link); } /* diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 8af0ccd3cdcf..7674263c38cc 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -413,16 +413,15 @@ enic_free_consistent(void *priv, int enic_link_update(struct enic *enic) { struct rte_eth_dev *eth_dev = enic->rte_dev; - int ret; - int link_status = 0; + struct rte_eth_link link = { + .link_status = enic_get_link_status(enic), + .link_duplex = ETH_LINK_FULL_DUPLEX, + .link_speed = vnic_dev_port_speed(enic->vdev), + .link_autoneg = ETH_LINK_FIXED, + }; - link_status = enic_get_link_status(enic); - ret = (link_status == enic->link_status); - enic->link_status = link_status; - eth_dev->data->dev_link.link_status = link_status; - eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; - eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev); - return ret; + rte_eth_linkstatus_set(eth_dev, &link); + return 0; } static void -- 2.15.1