From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by dpdk.org (Postfix) with ESMTP id 9043F1B3D6 for ; Tue, 16 Jan 2018 19:38:22 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id y27so3930112pgc.5 for ; Tue, 16 Jan 2018 10:38:22 -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=7j/aTr/PUEbT/fotih/WMZP3i0wxsGOG7qvt8dYfnBw=; b=XAYsLiIcs2HVpARfwL7l6JlPZbCOkR7OxF8IuciZDwVY4HkIeiVJsbIy6XtT40FpMJ kNKuUtVgnRNyD12aycxmttfshDOsB2QBaeZiZeg+9AgjzYqTPBza+S/tYwSq1UylVVr6 FZpqg/oTiMKoF+asrIkfkv0oaS1jJYLoT8BED552Mr1Y2eMpKJqUxERUSszBlUJaeiXI Vvj1rSMkK1Q2wkejcZEKykeJHQLax/1M/12KHQ7qDDoiW4Iece3xI5ZbT6NN7VXIHBIO 2PmnEABR71L2inCdfZNqge3l7wD2hZBYaKuO6w3oSU5bZJNhKGvUPdaCN/LrrRhMhNdW KoeQ== 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=7j/aTr/PUEbT/fotih/WMZP3i0wxsGOG7qvt8dYfnBw=; b=tYf6ShOFneNFQmY3LE8zGhclrKbC8Gn07HYJvaMCiwt8JzSojEt6wP2LrZryIqgYYe XTwu8tLUIBgmy33aWZFys/IAsGT3M371Gz98oMQIWOQ08EpDzJUywDltrZjN/OzPmjg2 TmQhBaQ+SMHacqwJjPwzvOZiShJqpBfFvAaQYebb5Lrlz+6gpMstCdWk88zRqrExeSfM KZk12wwLWSTyTBRfXD5IlmFkwQuFJrxDJG7xtSk8zobU0R76xrooWjmZKYjbJahopE1H 2ZS0jKLj3NIoHsX+th3QIrFXY2L39Piw9IhQgTkV+EjTSkE/ySPAMZvKQcBa/m6kH1qG lXyA== X-Gm-Message-State: AKwxytdIDftr3Pdb4JxY9x/d8xv4kRnqEUtdNbbZH3TsXaKPCYfUmMc+ /U7zPwa2NnkeiAh9RX4uxEtnpesj29U= X-Google-Smtp-Source: ACJfBot0f+LVgHrj3I4Fh6/TA8eYGZn1vuiwaSPWU8qmCp++XWHsS6Z353r261PCxZEyrYvhkm/OgQ== X-Received: by 10.101.85.15 with SMTP id f15mr19940852pgr.153.1516127901365; Tue, 16 Jan 2018 10:38:21 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id 77sm4560351pfc.187.2018.01.16.10.38.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 10:38:20 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jan 2018 10:37:55 -0800 Message-Id: <20180116183755.24542-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116183755.24542-1-stephen@networkplumber.org> References: <20180116183755.24542-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v5 15/15] net/enic: 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: Tue, 16 Jan 2018 18:38:23 -0000 This driver was not doing atomic update of link status information. And the return value was different than others. The hardware also does not do autonegotiation (at least on Linux). Signed-off-by: Stephen Hemminger --- drivers/net/enic/enic_ethdev.c | 5 ++--- drivers/net/enic/enic_main.c | 17 ++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 669dbf3363fd..68b625468b63 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -446,10 +446,9 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev) ENICPMD_FUNC_TRACE(); enic_disable(enic); + memset(&link, 0, sizeof(link)); - rte_atomic64_cmpset((uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)ð_dev->data->dev_link, - *(uint64_t *)&link); + rte_eth_linkstatus_set(eth_dev, &link); } /* diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 8af0ccd3cdcf..7674263c38cc 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -413,16 +413,15 @@ enic_free_consistent(void *priv, int enic_link_update(struct enic *enic) { struct rte_eth_dev *eth_dev = enic->rte_dev; - int ret; - int link_status = 0; + struct rte_eth_link link = { + .link_status = enic_get_link_status(enic), + .link_duplex = ETH_LINK_FULL_DUPLEX, + .link_speed = vnic_dev_port_speed(enic->vdev), + .link_autoneg = ETH_LINK_FIXED, + }; - link_status = enic_get_link_status(enic); - ret = (link_status == enic->link_status); - enic->link_status = link_status; - eth_dev->data->dev_link.link_status = link_status; - eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; - eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev); - return ret; + rte_eth_linkstatus_set(eth_dev, &link); + return 0; } static void -- 2.15.1