From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by dpdk.org (Postfix) with ESMTP id 2A3841B37C for ; Tue, 16 Jan 2018 19:38:20 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id k68so2300102pga.3 for ; Tue, 16 Jan 2018 10:38:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w0ZfWX2gAb176R6FQUmUmmU72ko3PVuiIPsh56sGRVs=; b=f8hbIf6+oHgIL0YtPTzpyEGm7XbC2rFg5D9kpHdEqoRYFXMLTn+5v5H0/zoqtLyDSC V55CmcOjIgMfyg1rf2SI+gVWofYEsNy9K1RapqA7SzZiWTZjLsyDu6ttZEUPxArIx0Ec IP/u4xEviMpM2kcfZ0VMv63ZONAMzwcIrYKFM93u6uJw/Z1Avrd8Z1GUYJ1haFwDWMFJ S5aAQ+y9zHmleK38g7ZBh6yeu9buola3vI8q7ybnfjTTOdd7cA27bIVeBG7ulnKjBnjc 5XZCUrj0mSQtYYWzErNEiyBK2OmDEq0HFZkUraDbH/RubEpmoUvmSum9yTwbl27RDa4F Bq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w0ZfWX2gAb176R6FQUmUmmU72ko3PVuiIPsh56sGRVs=; b=KvtaA0v4ZCeH2+i33YmFco9FnhvMDOrpmrwVZsZ/x53Jw4sxp9BPBQuKFrE2IZWBuZ g4dhJKN+wqjXAfQJ1mEMeqtZ9TJ/Fn1OEjtzIGtmcTyoQlWM6WnPlkoA1SZWrrYDA9HF /kXKypIcIjjbOv+ffmvRJ5TsWB+TSfSxJ/dXSVqHh30C+wuqpdwbbCJLYUYcxdKCZ5D9 hIBZiP0NRdKboM04frTXm7C9nHIUFdN5Jtg/nsRLQlNdeWAxwUczNv0pL1CxRWb6eiAG iBASEhTPNlpcrJN0vBI5Nq2wTnhqg/zZYGgco68xbwVQx5oGNFawxearTkjfyAK0i+hd r37w== X-Gm-Message-State: AKGB3mK+qV06GnGVnr0O8Vva4DEIdS6BLBv6a4NvH2yMtnC5FGS9z/vb V69I4sj2aX3JJPrbHl+P1aFOnVgcub8= X-Google-Smtp-Source: ACJfBotCZZ+F0a7NOQf//hZO429whkanJijhmZrgBF4R8RKR5eGhntqd0H8/u4S3SRU/bhyf/TYpmg== X-Received: by 10.98.186.25 with SMTP id k25mr35307882pff.28.1516127899021; Tue, 16 Jan 2018 10:38:19 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id 77sm4560351pfc.187.2018.01.16.10.38.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 10:38:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jan 2018 10:37:53 -0800 Message-Id: <20180116183755.24542-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116183755.24542-1-stephen@networkplumber.org> References: <20180116183755.24542-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v5 13/15] net/szedata: use _rte_eth_linkstatus_set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 18:38:20 -0000 Yet another driver which was not returing correct value on link change. Since this driver can't be built on x86 could not even do a compile test. Signed-off-by: Stephen Hemminger --- drivers/net/szedata2/rte_eth_szedata2.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 74f151c4ad8e..c902e29d8ff2 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -50,7 +50,6 @@ #include #include #include -#include #include "rte_eth_szedata2.h" #include "szedata2_iobuf.h" @@ -1173,14 +1172,15 @@ static int eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) { - struct rte_eth_link link; - struct rte_eth_link *link_ptr = &link; - struct rte_eth_link *dev_link = &dev->data->dev_link; struct pmd_internals *internals = (struct pmd_internals *) dev->data->dev_private; const volatile struct szedata2_ibuf *ibuf; uint32_t i; bool link_is_up = false; + struct rte_eth_link link = { + .link_duplex = ETH_LINK_FULL_DUPLEX, + .link_autoneg = ETH_LINK_SPEED_FIXED, + }; switch (get_link_speed(internals)) { case SZEDATA2_LINK_SPEED_10G: @@ -1197,9 +1197,6 @@ eth_link_update(struct rte_eth_dev *dev, break; } - /* szedata2 uses only full duplex */ - link.link_duplex = ETH_LINK_FULL_DUPLEX; - for (i = 0; i < szedata2_ibuf_count; i++) { ibuf = ibuf_ptr_by_index(internals->pci_rsc, i); /* @@ -1212,13 +1209,9 @@ eth_link_update(struct rte_eth_dev *dev, } } - link.link_status = (link_is_up) ? ETH_LINK_UP : ETH_LINK_DOWN; - - link.link_autoneg = ETH_LINK_SPEED_FIXED; - - rte_atomic64_cmpset((uint64_t *)dev_link, *(uint64_t *)dev_link, - *(uint64_t *)link_ptr); + link.link_status = link_is_up ? ETH_LINK_UP : ETH_LINK_DOWN; + rte_eth_linkstatus_set(dev, &link); return 0; } -- 2.15.1