From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8E18C7D30 for ; Thu, 11 Jan 2018 18:02:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 09:02:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,345,1511856000"; d="scan'208";a="9387426" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by fmsmga002.fm.intel.com with ESMTP; 11 Jan 2018 09:02:43 -0800 To: Stephen Hemminger , dev@dpdk.org References: <20180108174514.14688-1-stephen@networkplumber.org> <20180108174514.14688-5-stephen@networkplumber.org> From: Ferruh Yigit Message-ID: <14bcc85d-9639-285d-27fd-ebeddcbe712e@intel.com> Date: Thu, 11 Jan 2018 17:02:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180108174514.14688-5-stephen@networkplumber.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 04/15] net/vmxnet3: 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: Thu, 11 Jan 2018 17:02:46 -0000 On 1/8/2018 5:45 PM, Stephen Hemminger wrote: > Use new _rte_eth_link_update helper. > Also remove no longer necessary include of rte_atomic.h > > Signed-off-by: Stephen Hemminger <...> > @@ -1130,25 +1079,21 @@ __vmxnet3_dev_link_update(struct rte_eth_dev *dev, > __rte_unused int wait_to_complete) > { > struct vmxnet3_hw *hw = dev->data->dev_private; > - struct rte_eth_link old = { 0 }, link; > + struct rte_eth_link link = { > + .link_speed = ETH_SPEED_NUM_10G, > + .link_duplex = ETH_LINK_FULL_DUPLEX, > + .link_autoneg = ETH_LINK_SPEED_FIXED, > + .link_status = ETH_LINK_DOWN, Link status before this patch was "ETH_LINK_UP", this is changing it to "ETH_LINK_DOWN", intentional? > + }; > uint32_t ret; > > - memset(&link, 0, sizeof(link)); > - vmxnet3_dev_atomic_read_link_status(dev, &old); > - > VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); > ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD); > > - if (ret & 0x1) { > + if (ret & 0x1) > link.link_status = ETH_LINK_UP; > - link.link_duplex = ETH_LINK_FULL_DUPLEX; > - link.link_speed = ETH_SPEED_NUM_10G; > - link.link_autoneg = ETH_LINK_SPEED_FIXED; > - } > - > - vmxnet3_dev_atomic_write_link_status(dev, &link); > > - return (old.link_status == link.link_status) ? -1 : 0; > + return _rte_eth_linkstatus_set(dev, &link); > } > > static int >