Rather than open coding with deprecated rte_atomic64,
use the existing ethdev helpers to get and set link status.

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/net/pfe/pfe_ethdev.c | 32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)

diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index 1efa17539e..1b183ab1f3 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -531,34 +531,6 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev, size_t 
*no_of_elements)
        return NULL;
 }
 
-static inline int
-pfe_eth_atomic_read_link_status(struct rte_eth_dev *dev,
-                               struct rte_eth_link *link)
-{
-       struct rte_eth_link *dst = link;
-       struct rte_eth_link *src = &dev->data->dev_link;
-
-       if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-                               *(uint64_t *)src) == 0)
-               return -1;
-
-       return 0;
-}
-
-static inline int
-pfe_eth_atomic_write_link_status(struct rte_eth_dev *dev,
-                                struct rte_eth_link *link)
-{
-       struct rte_eth_link *dst = &dev->data->dev_link;
-       struct rte_eth_link *src = link;
-
-       if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-                               *(uint64_t *)src) == 0)
-               return -1;
-
-       return 0;
-}
-
 static int
 pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
 {
@@ -570,7 +542,7 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int 
wait_to_complete __rte_unused)
        memset(&old, 0, sizeof(old));
        memset(&link, 0, sizeof(struct rte_eth_link));
 
-       pfe_eth_atomic_read_link_status(dev, &old);
+       rte_eth_linkstatus_get(dev, &old);
 
        /* Read from PFE CDEV, status of link, if file was successfully
         * opened.
@@ -601,7 +573,7 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int 
wait_to_complete __rte_unused)
        link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
        link.link_autoneg = RTE_ETH_LINK_AUTONEG;
 
-       pfe_eth_atomic_write_link_status(dev, &link);
+       rte_eth_linkstatus_set(dev, &link);
 
        PFE_PMD_INFO("Port (%d) link is %s", dev->data->port_id,
                     link.link_status ? "up" : "down");
-- 
2.53.0

Reply via email to