From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH v2 12/15] thunderx: use _rte_eth_linkstatus_set Date: Fri, 5 Jan 2018 17:06:53 -0800 Message-ID: <20180106010656.9167-13-stephen@networkplumber.org> References: <20180106010656.9167-1-stephen@networkplumber.org> Cc: Stephen Hemminger To: dev@dpdk.org Return-path: Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by dpdk.org (Postfix) with ESMTP id BFD661B1D2 for ; Sat, 6 Jan 2018 02:07:13 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id b96so4082493pli.2 for ; Fri, 05 Jan 2018 17:07:13 -0800 (PST) In-Reply-To: <20180106010656.9167-1-stephen@networkplumber.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use new helper function. Signed-off-by: Stephen Hemminger --- drivers/net/thunderx/nicvf_ethdev.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index d65d3cee727e..e41b379f3c9c 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -43,7 +43,6 @@ #include #include -#include #include #include #include @@ -76,19 +75,6 @@ static void nicvf_dev_stop_cleanup(struct rte_eth_dev *dev, bool cleanup); static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, bool cleanup); -static inline int -nicvf_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 inline void nicvf_set_eth_link_status(struct nicvf *nic, struct rte_eth_link *link) @@ -170,7 +156,8 @@ nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) memset(&link, 0, sizeof(link)); nicvf_set_eth_link_status(nic, &link); } - return nicvf_atomic_write_link_status(dev, &link); + + return _rte_eth_linkstatus_set(dev, &link); } static int -- 2.15.1