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 F2FBF1B21A for ; Mon, 8 Jan 2018 18:45:40 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id i5so6001962pgq.11 for ; Mon, 08 Jan 2018 09:45:40 -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=V1yefIL4WCuKjytntxpITkBqX7Rau6qGhWJDq1e2y+/u+K1IyNOwh6Nbgi/RrzA0zP weEF7FhcqdRlGXzL4iNHhPsKTB6c1CUvNfXn8FgP1IOreQMK3KSXJF5osWc6jm18nOvc kXUuAovtuttYtDlrFBPG17K0heJWWdjVK9sWLHdHJkl4vRS/liLF/zgB41iLxLU5z5s+ tmCawFENqTZDXsH4X9XaQP7xj4GJwBeh4Z73S4KQqKcDn6HmLKtzARPxvo8qBOPSiOAx 3oyUEepJMjaW7GppoVHn9dcPk4RnBpEHZVEbs2C/QDsB7o+E4DQtJEfP2f0VXNAnmC4P xWtw== 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=HWVrlNX5rctb0Hp0aTA8Hl8p+H0sVzVrBLXlkK4LcSnsi1LBCysx17zcpa7lG3oI8f fZxSZHvrXY7GmjSnyJztJ+Zkw9xNmJxOpybuUNW4Fg7qO4BTRS3FlTUDSKsvlpbMVp6/ tJSsVEXV12DaexdyCK43ZGOagrfUlUcS7zuChMtWt3iA3xnuZfRlfy+XGX9Btv75r7iD eT9W7TTOelWX1y73/g8ekBjthMojlXgSPH8SKZIYf+pRuOwsnMNchWWhBY8Au96TZZa7 wIvwvxlKNCmzxSA9wCoh6Px1Gup5XHn+plbFnn1qY2PXvc3xV4fLaVO1bKsJZeYM83f0 H2vg== X-Gm-Message-State: AKGB3mK5sEhrUsFfNEHtJ/u31kOBOdyIuMxnJdejii61/pthXjZl9lZi B5uJ4Epit1BtR2qmwF1A/P2GD1Smw4k= X-Google-Smtp-Source: ACJfBosxCtI5V3TODhzkJIEcyMV+iu9bN/kcVKXR0oO1uuVQsL9KLQ8Yx7t97XszEshP59+IZcpOLA== X-Received: by 10.84.240.9 with SMTP id y9mr5640052plk.332.1515433539780; Mon, 08 Jan 2018 09:45:39 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id j14sm10933142pfh.94.2018.01.08.09.45.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:45:38 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 8 Jan 2018 09:45:12 -0800 Message-Id: <20180108174514.14688-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108174514.14688-1-stephen@networkplumber.org> References: <20180108174514.14688-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v3 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, 08 Jan 2018 17:45:41 -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