From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v11 5/8] ethdev: add speed capabilities Date: Fri, 18 Mar 2016 10:28:23 +0100 Message-ID: <20160318092823.GJ27079@6wind.com> References: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> <1458238145-7496-1-git-send-email-thomas.monjalon@6wind.com> <1458238145-7496-6-git-send-email-thomas.monjalon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: marcdevel@gmail.com, bruce.richardson@intel.com, declan.doherty@intel.com, konstantin.ananyev@intel.com, wenzhuo.lu@intel.com, helin.zhang@intel.com, jing.d.chen@intel.com, harish.patil@qlogic.com, rahul.lakkireddy@chelsio.com, johndale@cisco.com, vido@cesnet.cz, alejandro.lucero@netronome.com, dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 1EE9D58F3 for ; Fri, 18 Mar 2016 10:28:38 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id l124so23406645wmf.1 for ; Fri, 18 Mar 2016 02:28:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1458238145-7496-6-git-send-email-thomas.monjalon@6wind.com> 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" On Thu, Mar 17, 2016 at 07:09:02PM +0100, Thomas Monjalon wrote: > From: Marc Sune > > 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 > --- > 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