[dpdk-dev] [PATCH v11 5/8] ethdev: add speed capabilities

Adrien Mazarguil adrien.mazarguil at 6wind.com
Fri Mar 18 10:28:23 CET 2016


On Thu, Mar 17, 2016 at 07:09:02PM +0100, Thomas Monjalon wrote:
> From: Marc Sune <marcdevel at gmail.com>
> 
> The speed capabilities of a device can be retrieved with
> rte_eth_dev_info_get().
> 
> The new field speed_capa is initialized in the drivers without
> taking care of device characteristics in this patch.
> When the capabilities of a driver are accurate, the table in
> overview.rst must be filled.
> 
> Signed-off-by: Marc Sune <marcdevel at gmail.com>
> ---
>  doc/guides/nics/overview.rst           |  1 +
>  doc/guides/rel_notes/release_16_04.rst |  8 ++++++++
>  drivers/net/bnx2x/bnx2x_ethdev.c       |  1 +
>  drivers/net/cxgbe/cxgbe_ethdev.c       |  1 +
>  drivers/net/e1000/em_ethdev.c          |  4 ++++
>  drivers/net/e1000/igb_ethdev.c         |  4 ++++
>  drivers/net/fm10k/fm10k_ethdev.c       |  4 ++++
>  drivers/net/i40e/i40e_ethdev.c         |  8 ++++++++
>  drivers/net/ixgbe/ixgbe_ethdev.c       |  8 ++++++++
>  drivers/net/mlx4/mlx4.c                |  2 ++
>  drivers/net/mlx5/mlx5_ethdev.c         |  3 +++
>  drivers/net/nfp/nfp_net.c              |  2 ++
>  lib/librte_ether/rte_ethdev.h          | 21 +++++++++++++++++++++
>  13 files changed, 67 insertions(+)
[...]
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index cc4e9aa..3a4a989 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -4301,6 +4301,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>  		 0);
>  	if (priv_get_ifname(priv, &ifname) == 0)
>  		info->if_index = if_nametoindex(ifname);
> +	info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G |
> +			ETH_LINK_SPEED_56G;
>  	priv_unlock(priv);
>  }

Missing: ETH_LINK_SPEED_100M (not sure if we care), ETH_LINK_SPEED_1G and
the nonstandard ETH_LINK_SPEED_20G with some adapters.

In the future we should provide a more accurate speed_capa depending on
actual port capabilities, several mlx4 adapters cannot handle them all.

> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index 6704382..3487538 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -522,6 +522,9 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>  	 * size if it is not fixed.
>  	 * The API should be updated to solve this problem. */
>  	info->reta_size = priv->ind_table_max_size;
> +	info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G |
> +			ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G |
> +			ETH_LINK_SPEED_50G;
>  	priv_unlock(priv);
>  }

Missing: ETH_LINK_SPEED_100G, ETH_LINK_SPEED_20G and ETH_LINK_SPEED_56G.

Same as above, these capabilities actually depend on the adapter type and
should be probed.

I think ETH_LINK_SPEED_100M should work as well but I can't find it
mentioned anywhere, let's leave it out for now.

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list