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 0DE391B220 for ; Mon, 8 Jan 2018 18:45:42 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id t67so6002089pgc.5 for ; Mon, 08 Jan 2018 09:45:42 -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=GwJT0lKkMCV3SgkQaaZcXTBwC8zDvPiT+2h/0JpqG0cdWJ/9HRGXDt5SnKxei2gNEr kLnbVKLo7q6u8MQTQzJPPnuhSLrGSJ8ygh/NgBV0Q/3L/8PmzRe6CKlzvlw13pMaRbsQ gtHD67BbD2M3fa/Qf8tXsmovujQg1inc3pi+M5bctLpWJS+ddNG/a11B3839zDFKWpwJ DTslcWpFlbNFfT01wtk7ovcWQDisc/OImNbD7DIGUFlohE8iPJP0nLHg7p+ESy8vmKuR Xk53bSonfCs3TuLfMAc/9OIom0bj2GTaSpxdcX6iBIVpSBSsiqkh3TdXOc+j9ZhVFMUL /iYQ== 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=gbujQdej+M1K4fceemme04n/4AtBBO9/6rvOMdI90Ki4s1OBRfWfc4ALdmFej2WhgL FLXmO2J95Hybv1fFfICyHWWNZ0ncf2MbZQmWX/+2BvbD3B89xG7kplGjhciRp1daNYgv Xkplj02c6h0EHgl13cQpHH2DeVOhgQ0fA/n7A7OEQxN1GuT1fpqcMGfxSR1piWXmJTfS 9S8PAgjHmx1wFt6UMAZDYlt8t/J+mHC/zI3oZ7Vhgku14dH0WwVp6WVre0pEIQK9oYSf k/Ueb/9Y36OwqBtdbzmG0NGppEIjeoGERKGzPiITg8GSQEHV022GFT103FN+iZySZrGQ rLiw== X-Gm-Message-State: AKGB3mL4Er2egwWFMlMXdTbi52hneyTFDI6JA9+zkB/CN6Z8xqBdgDCJ EdFkIJH2G0YzMZf2Y3lHR5gOIeMhLSY= X-Google-Smtp-Source: ACJfBot0JPi6kK1YDjmARkZOHlEuVE+q8CSWz5/T2ZeceB9ua55nnrD7WHU0WQBMbHkzyUukQH15LQ== X-Received: by 10.159.204.131 with SMTP id t3mr12869186plo.381.1515433541794; Mon, 08 Jan 2018 09:45:41 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:45:41 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 8 Jan 2018 09:45:14 -0800 Message-Id: <20180108174514.14688-16-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 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, 08 Jan 2018 17:45:43 -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