net/iavf: use link status helper functions
authorRobin Zhang <robinx.zhang@intel.com>
Sun, 27 Sep 2020 07:26:19 +0000 (07:26 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 9 Oct 2020 11:17:43 +0000 (13:17 +0200)
Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_ethdev.c

index d451762..ec19abb 100644 (file)
@@ -665,12 +665,7 @@ iavf_dev_link_update(struct rte_eth_dev *dev,
        new_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
                                ETH_LINK_SPEED_FIXED);
 
-       if (rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link,
-                               *(uint64_t *)&dev->data->dev_link,
-                               *(uint64_t *)&new_link) == 0)
-               return -1;
-
-       return 0;
+       return rte_eth_linkstatus_set(dev, &new_link);
 }
 
 static int