[v9,2/6] app/testpmd: dump device capability and Rx domain info

Message ID 20211019081738.2165150-3-xuemingl@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: introduce shared Rx queue |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xueming Li Oct. 19, 2021, 8:17 a.m. UTC
  Dump device capability and Rx domain ID if shared Rx queue is supported
by device.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 app/test-pmd/config.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Andrew Rybchenko Oct. 19, 2021, 8:33 a.m. UTC | #1
On 10/19/21 11:17 AM, Xueming Li wrote:
> Dump device capability and Rx domain ID if shared Rx queue is supported
> by device.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>

LGTM except one minor note:

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

> ---
>  app/test-pmd/config.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 9c66329e96e..c0616dcd2fd 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -733,6 +733,7 @@ port_infos_display(portid_t port_id)
>  	printf("Max segment number per MTU/TSO: %hu\n",
>  		dev_info.tx_desc_lim.nb_mtu_seg_max);
>  
> +	printf("Device capabilities: 0x%"PRIx64"\n", dev_info.dev_capa);

IMHO, it should be decoded

>  	/* Show switch info only if valid switch domain and port id is set */
>  	if (dev_info.switch_info.domain_id !=
>  		RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
> @@ -743,6 +744,9 @@ port_infos_display(portid_t port_id)
>  			dev_info.switch_info.domain_id);
>  		printf("Switch Port Id: %u\n",
>  			dev_info.switch_info.port_id);
> +		if ((dev_info.dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE) != 0)
> +			printf("Switch Rx domain: %u\n",
> +			       dev_info.switch_info.rx_domain);
>  	}
>  }
>  
>
  
Xueming Li Oct. 19, 2021, 9:10 a.m. UTC | #2
On Tue, 2021-10-19 at 11:33 +0300, Andrew Rybchenko wrote:
> On 10/19/21 11:17 AM, Xueming Li wrote:
> > Dump device capability and Rx domain ID if shared Rx queue is supported
> > by device.
> > 
> > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> 
> LGTM except one minor note:
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 
> > ---
> >  app/test-pmd/config.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 9c66329e96e..c0616dcd2fd 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -733,6 +733,7 @@ port_infos_display(portid_t port_id)
> >  	printf("Max segment number per MTU/TSO: %hu\n",
> >  		dev_info.tx_desc_lim.nb_mtu_seg_max);
> >  
> > +	printf("Device capabilities: 0x%"PRIx64"\n", dev_info.dev_capa);
> 
> IMHO, it should be decoded

Thanks for checking this, do you mean decode to readable names?
Then we need a new API rte_eth_dev_capability_name(), it's simple, but
is it ok to add API w/o RFC?

> 
> >  	/* Show switch info only if valid switch domain and port id is set */
> >  	if (dev_info.switch_info.domain_id !=
> >  		RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
> > @@ -743,6 +744,9 @@ port_infos_display(portid_t port_id)
> >  			dev_info.switch_info.domain_id);
> >  		printf("Switch Port Id: %u\n",
> >  			dev_info.switch_info.port_id);
> > +		if ((dev_info.dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE) != 0)
> > +			printf("Switch Rx domain: %u\n",
> > +			       dev_info.switch_info.rx_domain);
> >  	}
> >  }
> >  
> > 
>
  
Andrew Rybchenko Oct. 19, 2021, 9:39 a.m. UTC | #3
On 10/19/21 12:10 PM, Xueming(Steven) Li wrote:
> On Tue, 2021-10-19 at 11:33 +0300, Andrew Rybchenko wrote:
>> On 10/19/21 11:17 AM, Xueming Li wrote:
>>> Dump device capability and Rx domain ID if shared Rx queue is supported
>>> by device.
>>>
>>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>>
>> LGTM except one minor note:
>>
>> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>>
>>> ---
>>>  app/test-pmd/config.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>>> index 9c66329e96e..c0616dcd2fd 100644
>>> --- a/app/test-pmd/config.c
>>> +++ b/app/test-pmd/config.c
>>> @@ -733,6 +733,7 @@ port_infos_display(portid_t port_id)
>>>  	printf("Max segment number per MTU/TSO: %hu\n",
>>>  		dev_info.tx_desc_lim.nb_mtu_seg_max);
>>>  
>>> +	printf("Device capabilities: 0x%"PRIx64"\n", dev_info.dev_capa);
>>
>> IMHO, it should be decoded
> 
> Thanks for checking this, do you mean decode to readable names?
> Then we need a new API rte_eth_dev_capability_name(), it's simple, but
> is it ok to add API w/o RFC?

It is trivial. So, I think it should be OK.
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 9c66329e96e..c0616dcd2fd 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -733,6 +733,7 @@  port_infos_display(portid_t port_id)
 	printf("Max segment number per MTU/TSO: %hu\n",
 		dev_info.tx_desc_lim.nb_mtu_seg_max);
 
+	printf("Device capabilities: 0x%"PRIx64"\n", dev_info.dev_capa);
 	/* Show switch info only if valid switch domain and port id is set */
 	if (dev_info.switch_info.domain_id !=
 		RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
@@ -743,6 +744,9 @@  port_infos_display(portid_t port_id)
 			dev_info.switch_info.domain_id);
 		printf("Switch Port Id: %u\n",
 			dev_info.switch_info.port_id);
+		if ((dev_info.dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE) != 0)
+			printf("Switch Rx domain: %u\n",
+			       dev_info.switch_info.rx_domain);
 	}
 }