From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id E38491B1D8 for ; Fri, 26 Jan 2018 03:02:08 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id r19so6294397pgn.1 for ; Thu, 25 Jan 2018 18:02:08 -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=fbafv0cvQoYC8uzNCNiDTzS9BN//cZ8Y4Les9GKVumM=; b=g+SDCzJymO48mpsDlCVaosRLBcZoAqEIdVIY+iCBNXFNfahD0qKDkt6OBv/M7XOk1C h9RSdhZ2Hy7vK4Nxw1F3aIYQXSGNPF5l+WnKif18v15gZq1umvWS7uVv1GkW/NmKZseO lnUqJhoncBrjv6yK9yN8E1m1S1+lorytVbXnym2Bhyb+jYTyG0bIfBEyimQcxML19kob MYzTXl6RIMZ/4rXTLam0+65vKew4X46u8mqdOvvDUCUmznJvSZM9nqJGjvRX6F5ES59w GIkrIzfU0/03sTJthyWfMukLKoLyOHVDY0MERpdhsgvVEV0KGF0ixa0B4qt47sU3Ecpe HIkQ== 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=fbafv0cvQoYC8uzNCNiDTzS9BN//cZ8Y4Les9GKVumM=; b=A+/UA9GoDNh7q50rDv+AFbsv9TyrFK85mAfg7GfEhE2r5uZL9D3R5yY2zTm0Y4Gy2o 1O1mgmjh28Uj4OQHVv6/S4Rscyy/NsIBw8pJRq9Z71nQ2B9X6U1J2332mEjpVkYTFJCa CaDO95hhAo064ZCDuWck0nli9kVJNROBdLQ8acWCBT5uSFIKNrYrZov6t21JctbWjesr HUHTvcURX8/Li1F5VkXM3y6BQLsjMgs90rAbfd1B2xx/qhQwENfdKcPVE4o2T3fo4zcU Jo97qo/MqFqqQ5RYzlStap7f6w+981NufmZeJ6Vr/bK0ypaUc4O+DXh+N21EY3xBC3+S jQnw== X-Gm-Message-State: AKwxytfPtesY+rLhpQQ9nDAGg2fhVTWoZ1PnaF1qDBcNEIPw070VDbjt gYxy4Ax1RZqViLkBi4J0fGsyqbH9qtw= X-Google-Smtp-Source: AH8x224CXVWsCyAoifzypzuKI+Ui8UNwqzJRcJVpxYi6dxT6wQzLfj3AT3gvw6dtwZMwyI9ENk0euQ== X-Received: by 2002:a17:902:b7cb:: with SMTP id v11-v6mr13039832plz.393.1516932127634; Thu, 25 Jan 2018 18:02:07 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id d5sm22141492pfk.2.2018.01.25.18.02.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 18:02:06 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 25 Jan 2018 18:01:49 -0800 Message-Id: <20180126020151.979-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180126020151.979-1-stephen@networkplumber.org> References: <20180126020151.979-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v8 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: Fri, 26 Jan 2018 02:02:09 -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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index e53c738db546..133a20197b02 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" @@ -1174,14 +1173,14 @@ 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; + memset(&link, 0, sizeof(link)); + switch (get_link_speed(internals)) { case SZEDATA2_LINK_SPEED_10G: link.link_speed = ETH_SPEED_NUM_10G; @@ -1212,13 +1211,11 @@ eth_link_update(struct rte_eth_dev *dev, } } - link.link_status = (link_is_up) ? ETH_LINK_UP : ETH_LINK_DOWN; + 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); - + rte_eth_linkstatus_set(dev, &link); return 0; } -- 2.15.1