From: Stephen Hemminger Date: Fri, 26 Jan 2018 02:01:50 +0000 (-0800) Subject: net/octeontx: use link status helper functions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2b4ab4223d5e9c94f5a556c4d3222f372b3f7453;p=dpdk.git net/octeontx: use link status helper functions Use new rte_eth_linkstatus_get/set helper functions to handle link status update. Signed-off-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index f2893faa96..90dd249a6b 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -488,20 +488,6 @@ octeontx_dev_promisc_disable(struct rte_eth_dev *dev) octeontx_port_promisc_set(nic, 0); } -static inline int -octeontx_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 octeontx_port_link_status(struct octeontx_nic *nic) { @@ -573,7 +559,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev, link.link_duplex = ETH_LINK_FULL_DUPLEX; link.link_autoneg = ETH_LINK_AUTONEG; - return octeontx_atomic_write_link_status(dev, &link); + return rte_eth_linkstatus_set(dev, &link); } static int