From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by dpdk.org (Postfix) with ESMTP id 05E391B1AA for ; Sat, 6 Jan 2018 02:07:17 +0100 (CET) Received: by mail-pl0-f67.google.com with SMTP id b12so4075639plm.3 for ; Fri, 05 Jan 2018 17:07:17 -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=Men86gMwOFRvlWMcfWN/hQrQsG68sqDsRknG/T1vLJQ=; b=01zSIYzIGmC8/iEMArpqRaMfh4nWq2WOVzgZoWPW+6/KIfnK1vwBPmuoXMoyl39w0r 3UC+hYA5mX358a2KdbHdC8yGccwV3zr54tpalOU24dJA9ICqfxfavqUKSBlc1pbK2Vgt gKO0TMGA7icVlv6L0KSsiaP9yIXBjq+0U/Ueg+ybq3gKPKNS+zutl4slXO5ibMx25aJE aefiHIbiiDEMa8JfCWvQQCfL4WWPSNwmP+aAldGhX8pjR+eCctmu78IJYVAtcU3c8DFI Rm7m1GLHpicGliIZMxdKkvNaRnRn1Smn1Sfxs7gqE0iUaPemZ6uix2MExi1EVZdmpBip gkvQ== 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=Men86gMwOFRvlWMcfWN/hQrQsG68sqDsRknG/T1vLJQ=; b=fgqoaSVoJchsO/7SeQAQkO7F5ynOsBshIdL8T0hFHfdbWlQMlCDmhiQ1oJUJ3K8+Fd y2jj1Dm16amh2yypPOAdcCK/D+75Zp8GPZNTMrdMqPWMg5svfGicMCEXDiIV3Va77zK3 pUff3+xJZXnRRj2mEJ6hW0UmZNbFEIh1ShCdQdp4ptruBMbZCjJ2iM81vBNBGCOV+Rol Dd7PGyMVUWqNHY/GTzJIb3uH80mQDsh4BUJlteGHb7gCSMxLCzl0TWCkGQZHVeD537R/ 0cmZXCSBC/Iz4mNAPk6EED3CddDwU4kB6RD65bLzkfqsu42VzR5zhYgvkxOsfzPrdlfB gzCg== X-Gm-Message-State: AKGB3mJqWi/JKBakt6BnKABJ+MAIW46boUA7lKlDVe+8fNcGshJ2cWCF c1b90DSdOl8H9FFxXIVR0PIioMgxMhk= X-Google-Smtp-Source: ACJfBot3X2jnRPzocmXsrhzwcXVdRYC7g+y98BEHdgXkkoMifSoOQlMDhO0UoXdlbInec90EDigQjQ== X-Received: by 10.159.230.5 with SMTP id u5mr4975007plq.169.1515200836694; Fri, 05 Jan 2018 17:07:16 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id p14sm12385018pgn.37.2018.01.05.17.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 17:07:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 5 Jan 2018 17:06:56 -0800 Message-Id: <20180106010656.9167-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180106010656.9167-1-stephen@networkplumber.org> References: <20180106010656.9167-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v2 15/15] 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: Sat, 06 Jan 2018 01:07:18 -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 | 16 +++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 669dbf3363fd..fbeb9955d722 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..f6238d4373a8 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -413,16 +413,14 @@ 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; + return _rte_eth_linkstatus_set(eth_dev, &link); } static void -- 2.15.1