From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 676891B04C for ; Mon, 8 Jan 2018 16:26:22 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 03B2120C7F; Mon, 8 Jan 2018 10:26:22 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 08 Jan 2018 10:26:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=EFthMNO7YHKR9kT3TjrdeBxsLP +hFWDv8QwsQODdAoU=; b=EMvPUuUtq3kgar6W7F9gLmpdlpvFKN6/CaJlcHsoOr S4FrwYmPtfOg2hgphSvUmSPWW0Sf2WNX6vfTuJdyndeyzu6KUWIgWUnvmx6lSodN dPxiqyPVQDUy+avG4PFy2BSksrbpqXN567scVTN8F1pCF7Iu/cgAQCryMSBnfxSO w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=EFthMN O7YHKR9kT3TjrdeBxsLP+hFWDv8QwsQODdAoU=; b=VFq/KT+wKi2vJvRcIqXrhg ADI3iovs+3Junt0Qrz2IXR114gzTiAjMvVp+TXT+cjxuolYAaBFbenSRnITGPTy9 FFMDRfLSNzdI3F7xjcoYsFfXfkan/HsNtCUN2Yq+1B4TB/zk9v0AR4xzGsEHk25H q/0g8NPnTlFUfx9IXfTs0xjCFVW0Z+yyV4nJzT3V7BXW6+q0rNRVAYqKfHMxikhX aA4Es5xgu+DNl/ewiFkwM9GrlFNI2c3nw/CitM88/XTYQgkqsjceCOGDZmR2GAhW yFjLRhQ6HqXtEmszEtHTQGTIjsKG4M4dMY08C6XXbj/1vLZMGHrnMEO80snpA2BQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A86F2246CC; Mon, 8 Jan 2018 10:26:21 -0500 (EST) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, stephen@networkplumber.org Date: Mon, 08 Jan 2018 16:25:58 +0100 Message-ID: <10754669.Ct3CSZPRVh@xps> In-Reply-To: <1506673b-52b0-cf16-38c4-6e55420e22f9@intel.com> References: <20180105173855.25473-1-thomas@monjalon.net> <1506673b-52b0-cf16-38c4-6e55420e22f9@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 15:26:22 -0000 08/01/2018 13:31, Ferruh Yigit: > 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? Yes. These are virtual ports, so fixed/autoneg does not really makes sense. I think autoneg is more fuzzy so more appropriate :) Anyway, the value is not changed, because ETH_LINK_SPEED_FIXED = ETH_LINK_AUTONEG = 1