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 77EE11B1A7 for ; Tue, 23 Jan 2018 00:55:22 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id o13so3214418pgs.2 for ; Mon, 22 Jan 2018 15:55: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=TbJglnwpAKRJMnsjx+MJGV7CZ6GUt6b9yT2uMyrh9yo=; b=uEnAvBd+2SvwgO73dRAyR7eBXJQmF/40Ic/jxx9MDs04Ap3Nb4KPXcDJWC5YoNEreM jrhAh8MMu0oE6Gbjzv8Tai2lFQHeWoa7H4OW+9B7mx0H4JbnAu0UByY92f0hJuPqdKxs xLLoUYHWtddgc7Qr0B+jj3Bo6adUpZw798mCfQgXoDWtTZORdfeoR3LRWbbfc57Us25k h13OQ8CkpzUbc0GWaEsbBNerbrVk+ZKnoZO2AkU2Ztv/SFgrWRYaw5HCKsVOAtKUZmUI 3VjiOiFQJpbJuwW378sKrrbiBp9f+y8ivVSdQGBRN8ubieVfLkXjH1ffHTW2SCQaqKY0 0wvg== 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=TbJglnwpAKRJMnsjx+MJGV7CZ6GUt6b9yT2uMyrh9yo=; b=JTpeEzbGczJ90+gHUFGGa1MxDZdSRcwpQt2exRMW1uadT4xAJ6RrJXslI/TXvq2tgZ LZcR3zKAy5XGMm8wSJr8k7YwesxUvtuyr65d5NjWmY1BOilNO7PlmCZvIG4OY6crfj6S fnOWxkyomACGvILXjklq41HQt3RvPNzmO8yria/R4TNfAazM0lui/DnGOo/g9o+iLreW /9flbgFlH6hUmAmL/elg8aQ7Fv7Z1DX0u369XK1tcTfb6qw+GZvtCVYv3xKmUK+ulI9q Wr9MPSA4oINJOBjfTz3VQ80cPdNi0O4UYEtnuApDc3KlEUdGPn6/r2ybk1LEHk5nn3+A jJKA== X-Gm-Message-State: AKwxytePsTTLNlhu2/vpctsPv+l9Iv1GWsrVAASRAM9b3ZQiTi3XFVr2 K8Cz0xn6vqhDEMdzJpLpa7PkFXoi2MA= X-Google-Smtp-Source: AH8x224VaDdv0uNQn/XzLkyV8/jQk+TjaHM2xQGiO4yaMNIsCQgBZDlhkphf1vymu+76k9p2qgJ+Ow== X-Received: by 10.99.173.5 with SMTP id g5mr7832598pgf.391.1516665321050; Mon, 22 Jan 2018 15:55: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 a24sm1623825pff.160.2018.01.22.15.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 15:55:20 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 22 Jan 2018 15:54:58 -0800 Message-Id: <20180122235458.28562-16-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 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: Mon, 22 Jan 2018 23:55:22 -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 Reviewed-by: Ferruh Yigit --- 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 e1ff9dcbd713..7d10b70a341a 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -426,10 +426,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 9274defd998e..7e64706d5623 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -379,16 +379,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