From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id A8A952C46 for ; Sun, 27 Mar 2016 21:39:50 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id s192so1791557lfs.0 for ; Sun, 27 Mar 2016 12:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=P1hn94dNi5b5AdB4J0SahjjWNWzTJ9ngU+x/iIwFSZA=; b=hdf9FJudgjbPHONSP2Q+PlmfNp5ctUpzg636heUnzFNpGnhlRgbWWD5hCpOghl6We2 HMOpPr7FVuniq/9yxrVnM6vrDrhR68XOTnWtGPOh2JdzAKefpkRqznkDNY3xk+/UXiYU T9keQSuaRAbvFfaw/+DAQ6AE9SqrpUYr3X2/9hYsimOwofM1HQfM/L1B03gU+kw3S2hf vy2cl5f+6ePe9LC7a7OM8IFs8CxWOIt6q7vFNdjv019g2vWAx0b7kIWVcE/YfmGZzt7F KqipxrWGmIe3/Lywk81igLjHSfUFOclZ/rEcqWb8ZgNnMpNji+92lJgbecDx2DlaDOFP 4Q6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=P1hn94dNi5b5AdB4J0SahjjWNWzTJ9ngU+x/iIwFSZA=; b=Bfs0KCKKN1zYH1KHt4qgXgsC7ShqksYlw7ZowmmNhiks32dC/6tbqojJRkoOLkY8HD ZKbsFhrDpSs8x+oCF22BTUY3ysyTWqJtbjw25ium6DMp9/mSHgA9elXKkrWc6CBkp3L8 108yhgD+LofnmJtkkoCY/dumAVkxbxQ/sJElJG3rLHzSzuRihxHwIjl1mzVPzAdbDhfr ISf3t/Fu+reDav1D6dxht3jzgf3Wv07DGWjC4SQSod+E7Iteb3ZZTywLoNvP3Kr47sx0 yfqNjGA4sOkm2JcBxjYVlMcX1REMmZb5XfUccHyirFFAVhpeNQ9aA5Z4VYsizUuRR9/e rHzw== X-Gm-Message-State: AD7BkJIn+XUyOhboK1JrOekjdtqtMyMlW+R3qlMCgkTzCpOrFLC/C4jVBsiM22i+ND5oE6Mn9cbCtbbcHTJlpQ== X-Received: by 10.25.152.205 with SMTP id a196mr9465944lfe.85.1459107590279; Sun, 27 Mar 2016 12:39:50 -0700 (PDT) MIME-Version: 1.0 Sender: marc.sune@gmail.com Received: by 10.112.155.196 with HTTP; Sun, 27 Mar 2016 12:39:30 -0700 (PDT) In-Reply-To: <10133718.H4CGZOGkuk@xps13> References: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> <3243448.uE5B0znWZS@xps13> <10133718.H4CGZOGkuk@xps13> From: Marc Date: Sun, 27 Mar 2016 21:39:30 +0200 X-Google-Sender-Auth: 2Dmvd-lpTpaP6U-PsujRBwaZ4Ks Message-ID: To: Thomas Monjalon Cc: "Zhang, Helin" , "Xu, Qian Q" , "Xing, Beilei" , dev@dpdk.org, "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Richardson, Bruce" , "Glynn, Michael J" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 19:39:50 -0000 On 27 March 2016 at 11:53, Thomas Monjalon wrote: > 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? > Agree on all of them. I can add them in the (hopefully) final v14, once all or main drivers have been tested. Regards marc