From c3482deb7c5d5867fa8c631607421d78ae2829ed Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 9 Mar 2018 17:56:31 +0000 Subject: [PATCH] net/avf: fix link autoneg value Intention of the logic is: If ETH_LINK_SPEED_FIXED is set in dev_conf, set link_autoneg to ETH_LINK_FIXED, else set it to ETH_LINK_AUTONEG ETH_LINK_SPEED_FIXED value is 1, and ETH_LINK_FIXED is 0; Current logic is broken, fix it according above values. Fixes: 48de41ca11f0 ("net/avf: enable link status update") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit Acked-by: Qi Zhang --- drivers/net/avf/avf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index 4df661705a..4442c3cd82 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -608,7 +608,7 @@ avf_dev_link_update(struct rte_eth_dev *dev, new_link.link_duplex = ETH_LINK_FULL_DUPLEX; new_link.link_status = vf->link_up ? ETH_LINK_UP : ETH_LINK_DOWN; - new_link.link_autoneg = !!(dev->data->dev_conf.link_speeds & + new_link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); if (rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link, -- 2.20.1