From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id AF0AD1B1A7 for ; Tue, 23 Jan 2018 00:55:19 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id y26so8331726pfi.10 for ; Mon, 22 Jan 2018 15:55:19 -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=OBtQGh85DE1b9PeOvkr1K5COLXj4GCKZqLjLq/5TmwA=; b=sNwDaY8NemuUMRyHzhyU1AjEhKIHlN/BtbvbkxScQ+KFaA1u5wtMGDXjhGs/lkXLZ+ R0VCDgTADfo7mG2h4bUz4mObKnS5NV0lBFqxS02vKGcjc7Ghnr9FqNLnMdeUwgaScDLH lVKr91F5Hnt2OU+faeEVz3/JDaFdFLtpuLy55JTK1Ct5LzXS2yA3V3+7A4BcmjUJBqKM WmQmV7uKcSX9LcEl/fZk9ZW9UuLScZaRstxbN4TjjRq1nnZ+xTAAWMZ3xukjJFmg0c2W I0j1+kTiG2aKayPrVh+wCo3/S6NM2CezCp+tusy7pyssxKj6I/WxA+Rz+kTtiJFzl+sk 8YGg== 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=OBtQGh85DE1b9PeOvkr1K5COLXj4GCKZqLjLq/5TmwA=; b=MVxAnOfMQHVGutUMlnBuaXU7dcBh6biMDRUqMcnNRst6UNSUtWutsTxsAS15GUml9x mcZBKFGFsjrIp//puKJ6jv4d7tGB8SqFkZOdocSseDwe0dElwJ62Wj36KDjKMFC0Q41B /OYi+OZaPBmGcJvEgcjxm9OfBnoJBcyePRfLrW7WHWr2zlF7Mt2s9o63lTHFPoF5IlvR QB9yAM1Y3sVYqlqO5kSTaCN4rF1Z8OkqSKlZShAw/mb4R+RJmH+t9CRHPZOO6jW5mIxe CudYnlFpuSpGjEZzpTStulG1G6+vchVR7Dto3TW5rNJQQEejZRzTGYFBHteKsHQ1ZUUi sb3A== X-Gm-Message-State: AKwxytdESShp4GC87LkQE920vtLJUK0TWDoC81xzoxBcY7B2rT/c70v4 PjM5EfJkOP4lZTKP+fcMUwcASPN7zSE= X-Google-Smtp-Source: AH8x225O5Lq3j3SWG2TgPI8qGNbiGt2QQSJUe767bSE90knzHHTWsvYH0zUz2Bx29xUVuI9MVeYdMA== X-Received: by 10.99.172.25 with SMTP id v25mr7799909pge.148.1516665318672; Mon, 22 Jan 2018 15:55:18 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id a24sm1623825pff.160.2018.01.22.15.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 15:55:17 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 22 Jan 2018 15:54:56 -0800 Message-Id: <20180122235458.28562-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180122235458.28562-1-stephen@networkplumber.org> References: <20180122235458.28562-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v7 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: Mon, 22 Jan 2018 23:55: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 e53c738db546..a331ed3c5cdc 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_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