From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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:content-type; bh=Q5T8TBHbVO13bS8zLk+zLTEvocIlRVX9K1TPCXZGxUE=; b=Xg3ZrLdbG4DZA0rgxC/KbA7nZT7We1HkNoK8wiapL2xj2gw6Bw78fK5mic+LM2Vmz/ 2mcmT/VQ++tWFcyy2KXiufmF5srvRPGxnUKpiFDrlIDFvddDiJtU1oV7gPt36dSHle2p rTIdFjaOZ/tRxfbo0QEyGIKIrW4t9pDeL9uTiPls5RY323BTvMHfrO8NoaHQTByyLUZG Ra60UgPRDIEwPS/ZXqJT9XEGxlB9LLI5bVAYq67eC3szGxsGb496UWPwK4IiN7n8iy3x 6k0mEknV5zXjdAJlZgv8bgmFk8xNULWjHvH6ZCmMylrxsIGcobGDTD+XAbnii6M4mSU2 fD7A== X-Gm-Message-State: ALoCoQmGLhDsGgS3HX+otMHnt/zu5nQt+OQrExps61wS1uLyiTVrsMIbtkQlbjZYJerO1/7v5KmR X-Received: by 10.180.91.100 with SMTP id cd4mr46988221wib.57.1432701156838; Tue, 26 May 2015 21:32:36 -0700 (PDT) Received: from xps13.localnet (159.20.90.92.rev.sfr.net. [92.90.20.159]) by mx.google.com with ESMTPSA id ny7sm1558129wic.11.2015.05.26.21.32.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 21:32:35 -0700 (PDT) From: Thomas Monjalon To: Marc Sune Date: Wed, 27 May 2015 06:02:31 +0200 Message-ID: <2412503.21Wb9XeS85@xps13> Organization: 6WIND User-Agent: KMail/4.14.7 (Linux/4.0.1-1-ARCH; KDE/4.14.7; x86_64; ; ) In-Reply-To: <1432669843-15672-2-git-send-email-marc.sune@bisdn.de> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 1/2] Added ETH_SPEED_CAP bitmap in rte_eth_dev_info 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: Wed, 27 May 2015 04:32:37 -0000 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?