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 B15A21B28E for ; Fri, 26 Jan 2018 03:02:10 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id u1so6294472pgr.0 for ; Thu, 25 Jan 2018 18:02:10 -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=7+EKvrPS++9lA9odjijxbiROCd4pqaNJGyErKjXhHKc=; b=fsv/fU2f3ry4kv0+N1lDzsFkoXdWv25LSxFHj6j07Cx+QPF6LwWmTp20voPYKVc/wk TGSyJ2a4o89iyNwawcMLz6vb651tALDrNjg0n8ZfCWMDolpY/RMz8OBEXQ6l+U39bSga Ens7mvO223wh+LhTMmwb+Ycbbjq7TsTGFFXcWWqLVkwntRtlqD1OvhjloERO2B6/iCqA 3akzBDxuGUGeBnn/o95E123Y+O296ptnjoU5e3h7cClP+LjKauftdC1YU1df6hdyrziz JjmxQYjAiuor0zfIxk2p5rIk2IR20V9f4t60v7QVdSR4t6LR2UIWZzWZW2rTPX1EuSll nkOg== 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=7+EKvrPS++9lA9odjijxbiROCd4pqaNJGyErKjXhHKc=; b=Ff97GqGSbn1+w6aUd8yJTx0UV+0oU3dLK0EhutyzJs1RMejq8hbKcpReDHU3Qx+sME pr8TDWclCYeYcBMqyaiz9nWu6IpFmGvCpuusJTrGg7/56+S6L77eAzY9hgd14OJVQcCb llcLImi+UOTba48polT6SS2LnH2fZ0fzT8IOIxtNTJIPC+rBytoA6XpRwjVHVtUqXdWh E69AKIaEhFzK0dHrr1laOTpDfdaohZ/Bk0rY50NXNwue5e4q85bL1E2+li9CX8OoicAw NFH9kb+HjcIBCk6bsC6m8K32p28wsboRtSeWpi01Ma+5IfdVE7qq5ygP2ybySGFqllDi kl5w== X-Gm-Message-State: AKwxyteFB9jvbLf2AVeyr4udgXZoJaPig+oS3PiRRxx0XDvD4PYs4Sqj 9PnM/DiqteUTabBt400RQk2V80x9kA4= X-Google-Smtp-Source: AH8x226VZOjbrvwfAFF2nZEuuTHH650CxA8DejtJRtf3qikn9UCXN/sCa8lv/U3XbqHnoAKRWOlHDA== X-Received: by 10.101.96.67 with SMTP id b3mr14733461pgv.23.1516932129621; Thu, 25 Jan 2018 18:02:09 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 18:02:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 25 Jan 2018 18:01:51 -0800 Message-Id: <20180126020151.979-16-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 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: Fri, 26 Jan 2018 02:02:11 -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 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..b26d18296c8a 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -379,16 +379,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); - 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; + memset(&link, 0, sizeof(link)); + link.link_status = enic_get_link_status(enic); + link.link_duplex = ETH_LINK_FULL_DUPLEX; + link.link_speed = vnic_dev_port_speed(enic->vdev); + + return rte_eth_linkstatus_set(eth_dev, &link); } static void -- 2.15.1