[dpdk-dev] [PATCH v2 1/2] Added ETH_SPEED_CAP bitmap in rte_eth_dev_info
Thomas Monjalon
thomas.monjalon at 6wind.com
Wed May 27 06:02:31 CEST 2015
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 <marc.sune at bisdn.de>
[...]
> +/**
> + * 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?
More information about the dev
mailing list