From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23BD3A04CC; Mon, 21 Sep 2020 13:23:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 636611D730; Mon, 21 Sep 2020 13:23:25 +0200 (CEST) Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) by dpdk.org (Postfix) with ESMTP id 27D5F1D703 for ; Mon, 21 Sep 2020 13:23:24 +0200 (CEST) Received: by mail-oi1-f196.google.com with SMTP id u126so16482794oif.13 for ; Mon, 21 Sep 2020 04:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N+sxLLZaiLxvQ8mJRljQ9F57jszTnSoWRW2aVq3nRSM=; b=FOoy4ERY33sUzeyg570R6kWizpMss7SK2CcW0OevA60zkBQZFbZSB0Z66+L9pNW5K/ Jvm+MvVwEMCw03OezoG5F5he3SiJF1MOBussxLD1VkEa6N5LORIX3uGgsa60NYnFT9wn 7yruODAzANjj+oYTnscn4ZqT9lhP9gXyrTglUX4Z6fCdGbEu2Wb6gsOIZiiqj5/iOJ7E RJr+6zNZw9CamQUQ4IjgylLRZdcESIGSb0iEJ0UWIc7XbV7b2ej/KQoIQpwf/tdT+W/L tFRJjZFpo6O7ow1eEXP4GYIYf+ze71wHwWcF4emi7ghTA83YEzDOohqQ3LQyIpnJC05f Vx+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N+sxLLZaiLxvQ8mJRljQ9F57jszTnSoWRW2aVq3nRSM=; b=Ap/xD/ZOgrpBzLqJlOTVXOK81f77X5AGCLY3GoZ9+aw+NdVqAJNR58QJ1Xu4I9j3TI bYefUDFlttdKZL9p+kjSaPhBhnUaqRypPxg9PsoFikBXSBrdL1UYD0sKZDKJfD/gquid F6qCtvInoa0PBPHb9T2TSj9A+mtKbLij7FTI9PnTYhvPT1X2IOsTVlQ61Bhz9hMDRv3v p4NLFexwNw2scF4vpbRmGKtg/YDYFWMsw4bClKNXy8zVaejJOutGSaRV6QsWn+S9GSkG bJ59Wf3AcAoqpaEFEzDTqxLr7tkKdwBHSIBUat3JlTnndl9UTQzTeu+af/KP6BchOAij 3wFg== X-Gm-Message-State: AOAM530i8Lmp4qZXIxxmnYlxPDWVs1d4VujYTFnpj3i+qdM1N7xLO0Qh BodFE1zLd5ZDPcqczfrd3C8H/rk3QvwP83K0zE7aKA== X-Google-Smtp-Source: ABdhPJxDfGVNHH88aRN67ld2fCWcxGb2EYT/Ti9uTGgLPsiVQ+oqhXyJ8Jww7lmX3ib8zpOc3O5joGlFzEpJI7rdlWA= X-Received: by 2002:aca:d549:: with SMTP id m70mr17338387oig.49.1600687403336; Mon, 21 Sep 2020 04:23:23 -0700 (PDT) MIME-Version: 1.0 References: <20200904062339.77430-1-sarosh.arif@emumba.com> <84032779-1b74-0aed-2a49-9a0315c7b819@intel.com> In-Reply-To: <84032779-1b74-0aed-2a49-9a0315c7b819@intel.com> From: Sarosh Arif Date: Mon, 21 Sep 2020 16:22:47 +0500 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] testpmd: add speed capability in device info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Sep 17, 2020 at 8:56 PM Ferruh Yigit wrote: > > On 9/4/2020 7:23 AM, Sarosh Arif wrote: > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > > index 30bee3324..8824ad174 100644 > > --- a/app/test-pmd/config.c > > +++ b/app/test-pmd/config.c > > @@ -518,6 +518,7 @@ device_infos_display(const char *identifier) > > struct rte_device *dev; > > struct rte_devargs da; > > portid_t port_id; > > + struct rte_eth_dev_info dev_info; > > char devstr[128]; > > This is for the testpmd command "show device info |all", > not sure speed capabilities really fits the device info display. > > "show port info |all" command may be better fit, but before > that is there a specific need to see the speed capabilities of a port, > it may help figuring out right place. In bug 496 on bugzilla, it is requested to display speed capabilities of a device, in order to create a test to confirm the correct speed capabilities of a device. Since speed_capa is property of the device it should be printed under show device info. > > > > > memset(&da, 0, sizeof(da)); > > @@ -569,6 +570,90 @@ device_infos_display(const char *identifier) > > &mac_addr); > > rte_eth_dev_get_name_by_port(port_id, name); > > printf("\n\tDevice name: %s", name); > > + rte_eth_dev_info_get(port_id, &dev_info); > > + switch (dev_info.speed_capa) { > > + case ETH_LINK_SPEED_AUTONEG: > > + printf("\n\tDevice speed capability: %s", > > + "Autonegotiate (all speeds)"); > > + break; > > + case ETH_LINK_SPEED_FIXED: > > + printf("\n\tDevice speed capability: %s", > > + "Disable autonegotiate (fixed speed)"); > > + break; > > + case ETH_LINK_SPEED_10M_HD ... > > + ETH_LINK_SPEED_10M-1: > > Why ranges are used, there can't be any value in between? > It's a bit map so multiple bits can be one at a time resulting in values in between. > Also case range is not part of starndard, may be good to avoid for > portability, like the case -pendantic is used etc.. I will submit v2 without using case range. > > > > + printf("\n\tDevice speed capability: %s", > > + "10 Mbps half-duplex"); > > + break; > > You should not break. 'speed_capa' is list of speeds that device > supports, so it won't be a single value, that is why breaking after > first hit is wrong. I will correct this in v2 > > Can you please confirm you intentions is not to display link speed, but > "speed capability"? Btw, link speed is already displayed in "show port > info ..." The intention is to be able create a test to confirm the correct speed capabilities of a device. > > > + case ETH_LINK_SPEED_10M ... > > + ETH_LINK_SPEED_100M_HD-1: > > + printf("\n\tDevice speed capability: %s", > > + "10 Mbps full-duplex"); > > Also no need to be this verbose, since there will be multiple values, > this makes to much noise, instead can be an list of speeds in single line. Okay >