From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id E5446558B for ; Sun, 27 Mar 2016 11:55:13 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id l68so69189923wml.0 for ; Sun, 27 Mar 2016 02:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=bNYTr/QrNGP4OnlFOxpHUFyFvYJ7EJg/MRA76R9Qgks=; b=UQ5v7HiIDhTPefeWkbA/k3eP9QtQfTPaadzT5y8eGUsxEEwgAyYxQ18lrG73wFwoKf E61h5NTVVAJAwTDrQyC2/DTm/5xgEqnirDksWI7SFTDTp9LKJ4uPNitFYhnmzbu7PU90 xs70mBlROxxfZ+eitkviocGZI6oVgO9ziCWtQEDIjPNZpmPV+kUBJhlS+lsjYXdLazqA DY4mJ3IHobnnkAeamWw0sjs6J+PrkrP4AF7BpUjHCCxDNqAQYnBDo4ahazI6jhKYFhFx tqY3Jz7HRvaoNoxsdtbNH6uJ7bLpfe1YJNSDPSSnJNp5nj6hiIhyN7LN1xMs3RM3Tay+ kBQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=bNYTr/QrNGP4OnlFOxpHUFyFvYJ7EJg/MRA76R9Qgks=; b=GLjEt0YfHUj+3+n8+Nw57H4JQAEJRd3nEXD1GroVElRM0Dc7lYgf0vTu4lUFvtmM1K 4/L1qW2r3omU3gLhXgEDsWqCzFpotICmiInFyumqZAiy4EsFF3LFfV/ELLfeD1cD9/FU oWWRe+yay7/za7u+lbuckMDWRvEe41g5hASGLfkhjMYo664pZw6fIzE0Lk5ZryhYyuRM qKQzQxX+E3LZUhiQw3SzbfxNS8rDR2+bPby3GSquvB3FdbinPn8RVuWTJcDCqYo4YRR/ 624YebeIC9x60Ad2wmDlMlVsmk4j/4XAKD8CYH80E39WvtfEf878x6buAumia2ZEb2nh M5Ig== X-Gm-Message-State: AD7BkJKeSZcqgAznJ4PLKTP0BzN3w+9ALJyaNSzKbkRcem/9qJsK1fSsVe5XeviN9JMGhMCJ X-Received: by 10.194.118.106 with SMTP id kl10mr26436345wjb.154.1459072513754; Sun, 27 Mar 2016 02:55:13 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id o128sm5083775wmb.19.2016.03.27.02.55.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 02:55:12 -0700 (PDT) From: Thomas Monjalon To: Marc Cc: "Zhang, Helin" , "Xu, Qian Q" , "Xing, Beilei" , dev@dpdk.org, "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Richardson, Bruce" , "Glynn, Michael J" Date: Sun, 27 Mar 2016 11:53:22 +0200 Message-ID: <10133718.H4CGZOGkuk@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> <3243448.uE5B0znWZS@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v11 0/8] ethdev: 100G and link speed API refactoring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 09:55:14 -0000 2016-03-26 11:24, Marc: > On 26 March 2016 at 09:08, Thomas Monjalon > wrote: > > 2016-03-25 22:30, Marc: > > > From v9 to v10 patchset the values ETH_LINK_SPEED_AUTONEG and > > ETH_LINK_SPEED_FIXED were flipped. Reverting this makes it work: > > > > > > marc@Beluga:~/personal/dpdk/tools$ git diff > > > diff --git a/lib/librte_ether/rte_ethdev.h > > b/lib/librte_ether/rte_ethdev.h > > > index ef2502a..fb247a7 100644 > > > --- a/lib/librte_ether/rte_ethdev.h > > > +++ b/lib/librte_ether/rte_ethdev.h > > > @@ -244,8 +244,8 @@ struct rte_eth_stats { > > > /** > > > * Device supported speeds bitmap flags > > > */ > > > -#define ETH_LINK_SPEED_FIXED (0 << 0) /**< Disable autoneg (fixed > > speed) */ > > > -#define ETH_LINK_SPEED_AUTONEG (1 << 0) /**< Autonegotiate (all > > speeds) */ > > > +#define ETH_LINK_SPEED_AUTONEG (0 << 0) /**< Autonegotiate (all > > speeds) */ > > > +#define ETH_LINK_SPEED_FIXED (1 << 0) /**< Disable autoneg (fixed > > speed) */ > > > #define ETH_LINK_SPEED_10M_HD (1 << 1) /**< 10 Mbps half-duplex */ > > > #define ETH_LINK_SPEED_10M (1 << 2) /**< 10 Mbps full-duplex */ > > > #define ETH_LINK_SPEED_100M_HD (1 << 3) /**< 100 Mbps half-duplex */ > > > > > > I think having autoneg == 0 is better. Do you agree Thomas? > > > > No I do not agree, because this flag is now used also for > > rte_eth_link.link_autoneg. > > So it is more logic to set it to 1. > > Having to explicitly specify ETH_LINK_SPEED_AUTONEG in link_speeds during > port configuration for achieving auto-negociation, which is what 98% of > applications will use, seems anti-natural to me and breaks existing > applications. Yes, you're right. We have to avoid apps modifications. By keeping autoneg the default behaviour (value 0), we avoid issues. > The only benefit of your approach is not to have another macro #define > ETH_LINK_AUTONEG 1, which is marginal IMHO. Yes, you're right. I suggest adding 2 macros for rte_eth_link.link_autoneg: #define ETH_LINK_FIXED 0 /**< No autonegotiation. */ #define ETH_LINK_AUTONEG 1 /**< Autonegotiated. */ and keep these ones to use with rte_eth_conf.link_speeds and rte_eth_dev_info.speed_capa: #define ETH_LINK_SPEED_AUTONEG (0 << 0) /**< Autonegotiate (all speeds) */ #define ETH_LINK_SPEED_FIXED (1 << 0) /**< Disable autoneg (fixed speed) */ Opinions?