All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Sarosh Arif <sarosh.arif@emumba.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] testpmd: add speed capability in device info
Date: Thu, 8 Oct 2020 17:14:51 +0100	[thread overview]
Message-ID: <50e4724d-a256-be40-c7c0-440eddf3bffd@intel.com> (raw)
In-Reply-To: <20201008114924.355740-1-sarosh.arif@emumba.com>

On 10/8/2020 12:49 PM, Sarosh Arif wrote:
> Called rte_eth_dev_info_get() in testpmd, to get device info
> so that speed capabilities can be printed under "show device info"
> ​
> Bugzilla ID: 496
> Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
> ---
> v2:
> display all speed capabilities in a single line
> remove switch case
> v3:
> add missing speeds
> make a function for displaying speed capabilities
> ---
>   app/test-pmd/config.c  | 45 ++++++++++++++++++++++++++++++++++++++++++
>   app/test-pmd/testpmd.h |  1 +
>   2 files changed, 46 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 30bee3324..95c2798c8 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -507,6 +507,46 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
>   	return 0;
>   }
>   
> +void
> +device_infos_display_speeds(uint32_t speed_capa)
> +{

Can you please make the function static?

<...>

> @@ -569,6 +611,9 @@ 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);

It is very unlikely that it will fail but still it can be good add the return 
value check
   if (rte_eth_dev_info_get(port_id, &dev_info) > 0)
     device_infos_display_speeds(dev_info.speed_capa);

> +				speed_capa = dev_info.speed_capa;
> +				device_infos_display_speeds(speed_capa);

Is the 'speed_capa' variable still needed? Why not directly use 
'dev_info.speed_capa'?

>   				printf("\n");
>   			}
>   		}
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 25a12b14f..0773016f7 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -694,6 +694,7 @@ void nic_stats_clear(portid_t port_id);
>   void nic_xstats_display(portid_t port_id);
>   void nic_xstats_clear(portid_t port_id);
>   void nic_stats_mapping_display(portid_t port_id);
> +void device_infos_display_speeds(uint32_t speed_capa);

If function becomes static this deceleration won't be needed.

  reply	other threads:[~2020-10-08 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  6:23 [dpdk-dev] [PATCH] testpmd: add speed capability in device info Sarosh Arif
2020-09-08  8:36 ` Sarosh Arif
2020-09-08 11:55   ` Ferruh Yigit
2020-09-17 15:56 ` Ferruh Yigit
2020-09-21 11:22   ` Sarosh Arif
2020-09-28 10:01 ` [dpdk-dev] [PATCH v2] " Sarosh Arif
2020-10-04  8:51   ` Asaf Penso
2020-10-07 15:30     ` Ferruh Yigit
2020-10-08 11:49   ` [dpdk-dev] [PATCH v3] " Sarosh Arif
2020-10-08 16:14     ` Ferruh Yigit [this message]
2020-10-08 18:11   ` [dpdk-dev] [PATCH v4] " Sarosh Arif
2020-10-08 18:25   ` [dpdk-dev] [PATCH v5] " Sarosh Arif
2020-10-09  9:27     ` Ferruh Yigit
2020-10-09 11:53       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50e4724d-a256-be40-c7c0-440eddf3bffd@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=sarosh.arif@emumba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.