From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6B32A1B29A for ; Thu, 11 Jan 2018 18:07:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 09:07:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,345,1511856000"; d="scan'208";a="19346284" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by orsmga003.jf.intel.com with ESMTP; 11 Jan 2018 09:07:51 -0800 From: Ferruh Yigit To: Bruce Richardson , Konstantin Ananyev , Matej Vido Cc: dev@dpdk.org, Ferruh Yigit , Stephen Hemminger Date: Thu, 11 Jan 2018 17:06:56 +0000 Message-Id: <20180111170658.2809-13-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180111170658.2809-1-ferruh.yigit@intel.com> References: <20180108174514.14688-1-stephen@networkplumber.org> <20180111170658.2809-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v4 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: Thu, 11 Jan 2018 17:07:54 -0000 From: Stephen Hemminger 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 | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 45aebed33..b0fdf30f8 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_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,14 +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_FIXED; + link.link_status = link_is_up ? ETH_LINK_UP : ETH_LINK_DOWN; - rte_atomic64_cmpset((uint64_t *)dev_link, *(uint64_t *)dev_link, - *(uint64_t *)link_ptr); - - return 0; + return _rte_eth_linkstatus_set(dev, &link); } static int -- 2.14.3