From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 1/2] Added ETH_SPEED_CAP bitmap in rte_eth_dev_info Date: Wed, 27 May 2015 06:02:31 +0200 Message-ID: <2412503.21Wb9XeS85@xps13> References: <1431387946-29950-1-git-send-email-marc.sune@bisdn.de> <1432669843-15672-1-git-send-email-marc.sune@bisdn.de> <1432669843-15672-2-git-send-email-marc.sune@bisdn.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Marc Sune Return-path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 19F425A0F for ; Wed, 27 May 2015 06:32:37 +0200 (CEST) Received: by wgbgq6 with SMTP id gq6so113670627wgb.3 for ; Tue, 26 May 2015 21:32:36 -0700 (PDT) In-Reply-To: <1432669843-15672-2-git-send-email-marc.sune@bisdn.de> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Marc, 2015-05-26 21:50, Marc Sune: > Added constants and bitmap to struct rte_eth_dev_info to be used by PMDs. > > Signed-off-by: Marc Sune [...] > +/** > + * Device supported speeds > + */ > +#define ETH_SPEED_CAP_NOT_PHY (0) /*< No phy media > */ Why not starting with lower values? Some new drivers may be interested by lower speed. > +#define ETH_SPEED_CAP_10M_HD (1 << 0) /*< 10 Mbps half-duplex> */ > +#define ETH_SPEED_CAP_10M_FD (1 << 1) /*< 10 Mbps full-duplex> */ > +#define ETH_SPEED_CAP_100M_HD (1 << 2) /*< 100 Mbps half-duplex> */ > +#define ETH_SPEED_CAP_100M_FD (1 << 3) /*< 100 Mbps full-duplex> */ > +#define ETH_SPEED_CAP_1G (1 << 4) /*< 1 Gbps > */ > +#define ETH_SPEED_CAP_2_5G (1 << 5) /*< 2.5 Gbps > */ > +#define ETH_SPEED_CAP_5G (1 << 6) /*< 5 Gbps > */ > +#define ETH_SPEED_CAP_10G (1 << 7) /*< 10 Mbps > */ > +#define ETH_SPEED_CAP_20G (1 << 8) /*< 20 Gbps > */ > +#define ETH_SPEED_CAP_25G (1 << 9) /*< 25 Gbps > */ > +#define ETH_SPEED_CAP_40G (1 << 10) /*< 40 Gbps > */ > +#define ETH_SPEED_CAP_50G (1 << 11) /*< 50 Gbps > */ > +#define ETH_SPEED_CAP_56G (1 << 12) /*< 56 Gbps > */ > +#define ETH_SPEED_CAP_100G (1 << 13) /*< 100 Gbps > */ We should note that rte_eth_link is using ETH_LINK_SPEED_* constants which are not some bitmaps so we have to create these new constants. Furthermore, rte_eth_link.link_speed is an uint16_t so it is limited to 40G. Should we use some constant bitmaps here also? What about removing _CAP suffix from your constants? [...] > + uint32_t speed_capa; /**< Supported speeds bitmap (ETH_SPEED_CAP_). */ If the constants are ETH_SPEED_CAP, why not wording this variable speed_cap?