hn_dev_link_update() returns without updating the cached link when
the link status has not changed. A speed change alone is never
reported, and if the link is down at port start, the cached speed
and duplex stay zero.

Always update the cached link, and only log when the status changes.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: [email protected]

Signed-off-by: Shrey Khandelwal <[email protected]>
---
 .mailmap                       | 1 +
 drivers/net/netvsc/hn_ethdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/.mailmap b/.mailmap
index 2e348c3bce..131b9f86cb 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1558,6 +1558,7 @@ Shlomi Gridish <[email protected]>
 Shougang Wang <[email protected]>
 Shraddha Joshi <[email protected]>
 Shreesh Adiga <[email protected]>
+Shrey Khandelwal <[email protected]>
 Shreyansh Jain <[email protected]>
 Shrikrishna Khare <[email protected]>
 Shu Shen <[email protected]>
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index e4fdf89873..5dc91f9503 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -298,11 +298,9 @@ hn_dev_link_update(struct rte_eth_dev *dev,
        else
                link.link_status = RTE_ETH_LINK_DOWN;
 
-       if (old.link_status == link.link_status)
-               return 0;
-
-       PMD_INIT_LOG(DEBUG, "Port %d is %s", dev->data->port_id,
-                    (link.link_status == RTE_ETH_LINK_UP) ? "up" : "down");
+       if (old.link_status != link.link_status)
+               PMD_INIT_LOG(DEBUG, "Port %d is %s", dev->data->port_id,
+                            (link.link_status == RTE_ETH_LINK_UP) ? "up" : 
"down");
 
        return rte_eth_linkstatus_set(dev, &link);
 }
-- 
2.55.0

Reply via email to