From mboxrd@z Thu Jan 1 00:00:00 1970 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 122E91B1C1 for ; Sat, 6 Jan 2018 02:07:15 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id 62so4072306pld.7 for ; Fri, 05 Jan 2018 17:07:15 -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=+2hE82GUCFuKJA+/cnNiKgLN3qvUvbgz1Rb7yHHcnGQ=; b=nSSbnd61k5QaeDefKKhFe+jRUwgsQtjzBXiTJ0Bt/Ce3DikR6Et9Q05NAtwgvgJSkw wlL4m57n7bP/Om9eqD/BXiFu5CUNTO88AGlgpdW3f467yY8GB9BbKjqHlI0mneAR1IcE No2rBYbqpo3FWr5teEnqJlV+q+yWINAycZyfPuwBOM6XR2MqUD8new5SeF2x9TnoKeiz yzC93XlrtQsvSaJz40WUq4s4gbZXIU85acP0/IuiFrDVGgNyk5wf8TP3Cb7ZCD/hvsSF SGZqlDPbitkCrNz1MvAhyeiDP8vN7NL0LHDNTBuApK9sJOBx2lhiNwOe1pklmlfCbHe9 JkTQ== 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=+2hE82GUCFuKJA+/cnNiKgLN3qvUvbgz1Rb7yHHcnGQ=; b=tm26BXaV1YMKWWyojyxD0GRVEiCslmDD1lM0w36PYu3eK/S1+OYDN6aFp5EmzhqDa4 SVdsqp88u8+PPsmXrTTHtLqLyhINRhg8LFIkFUSJIh6+a7bqiB1fLfd/9xbyhMk56TjD 561rA2os6egyIB1J+swBxaiNbjeW+mMDpJCGGaKb4b9EpMwWrbdKRBBeqrcEOLCbWaL3 bgfgBziKOt4vKxRxYvQ+jsf6UYHqlRh0GilUtEAdzvAXPqweIUIXFd/V+NwkhkAdHsCf htfNAi+RpNOYwdCErVHgeEpc1UveBbU3mleNBxn3jX1TZSKn6BUg2MM/xtgnB3AxRErl /uRA== X-Gm-Message-State: AKGB3mIQq+EDIabMxJEUZtGUHLuvSE5oskcuwJ15tlFwgIp5AVSj3B3T QR2vcp/2dhKD81xEVMBsn40VXgsE0DI= X-Google-Smtp-Source: ACJfBotwF9x2OzickZIEGcHl/O6x/A8wtiEgCOXgBaa3kpveZ2t9D922RMpD0gHEjICIZPBVMyqp2g== X-Received: by 10.84.247.145 with SMTP id o17mr4735763pll.261.1515200833960; Fri, 05 Jan 2018 17:07:13 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id p14sm12385018pgn.37.2018.01.05.17.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 17:07:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 5 Jan 2018 17:06:54 -0800 Message-Id: <20180106010656.9167-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180106010656.9167-1-stephen@networkplumber.org> References: <20180106010656.9167-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v2 13/15] 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: Sat, 06 Jan 2018 01:07:15 -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 | 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 74f151c4ad8e..bb8df1fbd191 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,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_SPEED_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.15.1