From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A4F331B052 for ; Mon, 8 Jan 2018 13:31:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 04:31:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,330,1511856000"; d="scan'208";a="8715945" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by orsmga007.jf.intel.com with ESMTP; 08 Jan 2018 04:31:05 -0800 To: Thomas Monjalon , dev@dpdk.org Cc: stephen@networkplumber.org References: <20180105173855.25473-1-thomas@monjalon.net> From: Ferruh Yigit Message-ID: <1506673b-52b0-cf16-38c4-6e55420e22f9@intel.com> Date: Mon, 8 Jan 2018 12:31:04 +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: <20180105173855.25473-1-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] ethdev: fix link autonegotiation value 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 12:31:08 -0000 On 1/5/2018 5:38 PM, Thomas Monjalon wrote: > There are 3 kind of link data in ethdev: > - capabilities (rte_eth_dev_info) > - configuration (rte_eth_conf) > - status (rte_eth_link) > > A bit-field is used for capabilities (rte_eth_dev_info.speed_capa) and > configuration (rte_eth_conf.link_speeds). > Bits are defined in ETH_LINK_SPEED_*. > > Some numerical (ETH_SPEED_NUM_*) and boolean (ETH_LINK_*) values > are used for the link status (rte_eth_link.*). > > There was a mistake in the comment of rte_eth_link.link_autoneg, > suggesting ETH_LINK_SPEED_[AUTONEG/FIXED] which are 0/1, > instead of ETH_LINK_[AUTONEG/FIXED] which are 1/0. > > The drivers are fixed to use ETH_LINK_[AUTONEG/FIXED]. > > Fixes: 82113036e4e5 ("ethdev: redesign link speed config") > > Suggested-by: Andrew Rybchenko > Signed-off-by: Thomas Monjalon <...> > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c > index 5a86752f9..3efb451a2 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -124,7 +124,7 @@ static struct rte_eth_link pmd_link = { > .link_speed = ETH_SPEED_NUM_10G, > .link_duplex = ETH_LINK_FULL_DUPLEX, > .link_status = ETH_LINK_DOWN, > - .link_autoneg = ETH_LINK_SPEED_FIXED, > + .link_autoneg = ETH_LINK_AUTONEG, > }; > > static int <...> > diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c > index c21c29e79..5c5464c8d 100644 > --- a/drivers/net/softnic/rte_eth_softnic.c > +++ b/drivers/net/softnic/rte_eth_softnic.c > @@ -522,7 +522,7 @@ pmd_ethdev_register(struct rte_vdev_device *vdev, > soft_dev->data->dev_private = dev_private; > soft_dev->data->dev_link.link_speed = hard_speed; > soft_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; > - soft_dev->data->dev_link.link_autoneg = ETH_LINK_SPEED_FIXED; > + soft_dev->data->dev_link.link_autoneg = ETH_LINK_AUTONEG; > soft_dev->data->dev_link.link_status = ETH_LINK_DOWN; > soft_dev->data->mac_addrs = ð_addr; > soft_dev->data->promiscuous = 1; > static void <...> > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c > index b988d1b41..fa1206c26 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -1143,7 +1143,7 @@ __vmxnet3_dev_link_update(struct rte_eth_dev *dev, > 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; > + link.link_autoneg = ETH_LINK_AUTONEG; > } > > vmxnet3_dev_atomic_write_link_status(dev, &link); These three drivers changes from "fixed" to "autoneg", intentional?