From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 3F9C37CB6 for ; Fri, 14 Jul 2017 20:30:56 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id q85so49116016pfq.1 for ; Fri, 14 Jul 2017 11:30:56 -0700 (PDT) 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=kthq1MauftBd8UUEIlWyU5LN3ZDo3+2qiXvPMEx0NmY=; b=s4oF3p6Kf46nSgDAmfQY4g7uxHF3wqbE7LrK+y2Ad1bOGvcuIi+T0YooeItHETnphm U9VAyXdHEdWBSNi7q80HRppH2VkibapAe30DsZlAtzoUTO2v7c2kjJt8s9IZwl50NK+U kWq7HNXhHpUy4JijpSvGnOCb/SK+eh5Dd0VC0S6x9DxLaN6tEFMcrzRn+Rrf3reg/72b 9G4gt2Lp2MtTLHoaXU8fFws9wpPkof+8OnltuCIOgCett7MzzJUm6OpzyIZuQc70RMlD oguNaabd2wcVKpc28Pv1zpWj7ujhC5z7AjCPVEm6w6+IpvzPvhoUhV/aAkH7+WJ9Z9ik uDgw== 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=kthq1MauftBd8UUEIlWyU5LN3ZDo3+2qiXvPMEx0NmY=; b=VlZ/FghlYLBuFrfiEzxZjm15cxl/aKviIHaUVlQxoFHR3CEuc8+Pe2/YtPL0VmiBEK vwomELx0SeInc2p3dsmavotghJZToukPXM7Y8G20C7Aofw9TVDP6eFIjO0/OZocDpHGX mrRMJU+MKtqRuDe+e4YBqGUNJAQQ+SnaSOClKdFdftMiIA45yDrSCE4bg/1yMjF5/sTK P2W4UR/r60ZJ/4cg0ImM1UHlfC+dfGPasAdUO5H1Tx8KDzvTSHGUkrIki5uM91OSHJTJ ZMufPhIfr6bGeNVrjBCPsckPML/X4r3uFXLJlYRqo+DWnk/xOwVPW+aDggidBhO8PFGb iO7A== X-Gm-Message-State: AIVw112VtF9Azpu1+fEq3h+BofEz6pJTLK05Uu+QygtV7hwGy1K9IdGR NkUaYLyzR4duUgLHwwRa2g== X-Received: by 10.98.46.131 with SMTP id u125mr6697453pfu.238.1500057055287; Fri, 14 Jul 2017 11:30:55 -0700 (PDT) Received: from xeon-e3.wavecable.com (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id r9sm22711163pfi.114.2017.07.14.11.30.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 11:30:54 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 14 Jul 2017 11:30:27 -0700 Message-Id: <20170714183027.16021-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170714183027.16021-1-stephen@networkplumber.org> References: <20170714183027.16021-1-stephen@networkplumber.org> Subject: [dpdk-dev] [RFC 14/14] enic: use _rte_eth_link_update 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, 14 Jul 2017 18:30:56 -0000 This driver was not doing atomic update of link status information. And the return value was different than others. Signed-off-by: Stephen Hemminger --- drivers/net/enic/enic_ethdev.c | 5 ++--- drivers/net/enic/enic_main.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index da8fec2d00ae..d2644ce608a5 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -418,10 +418,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_link_update(eth_dev, &link); } /* diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 40dbec7fa2d5..e629ee0b3a35 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -409,16 +409,16 @@ 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; + int link_status = enic_get_link_status(enic); - 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 = link_status; + link.link_duplex = ETH_LINK_FULL_DUPLEX; + link.link_speed = vnic_dev_port_speed(enic->vdev); + + return _rte_eth_link_update(eth_dev, &link); } static void -- 2.11.0