[PATCH v9 7/8] app/procinfo: support descriptor dump

Dongdong Liu liudongdong3 at huawei.com
Mon Oct 10 15:13:06 CEST 2022


Hi Reshma

Many thanks for your review.
On 2022/10/10 17:08, Pattan, Reshma wrote:
>
>
>> -----Original Message-----
>> From: Dongdong Liu <liudongdong3 at huawei.com>
>> +static void
>> +nic_descriptor_display(uint16_t port_id, struct desc_param *desc,
>> +		       desc_dump_t desc_dump)
>> +{
>> +	static const char *nic_desc_border = "###";
>> +	uint16_t queue_id = desc->queue_id;
>> +	uint16_t offset = desc->offset;
>> +	uint16_t num = desc->num;
>> +
>> +	printf("%s NIC descriptor for port %u %s\n",
>> +		   nic_desc_border, port_id, nic_desc_border);
>> +
>> +	desc_dump(port_id, queue_id, offset, num, stdout); }
>> +
>
>
>>  int
>>  main(int argc, char **argv)
>>  {
>> @@ -1732,6 +1806,12 @@ main(int argc, char **argv)
>>  			metrics_display(i);
>>  #endif
>>
>> +		if (enable_shw_rx_desc_dump)
>> +			nic_descriptor_display(i, &rx_desc_param,
>> +					       rte_eth_rx_descriptor_dump);
>
> I don't think you need the function nic_descriptor_display() to dump the descriptors.
> You can call the rte_eth_rx_descriptor_dump() directly here. And same comment for below code too.
> This way you can have the RX/TX descriptor scase  specific dump printfs in these sections.
> Also, the printf in the nic_descriptor_display() is not telling if your dumping TX descriptors or Rx descriptors.
> If you want to keep nic_descriptor_display() that's fine but you need to make sure printf to be RX/TX specific.
Good point, will do.

Thanks,
Dongdong
>
>> +		if (enable_shw_tx_desc_dump)
>> +			nic_descriptor_display(i, &tx_desc_param,
>> +					       rte_eth_tx_descriptor_dump);
>>  	}
>>
>>  #ifdef RTE_LIB_METRICS
>> --
>> 2.22.0
>
> .
>


More information about the dev mailing list