app/testpmd: display devargs in port info output

Message ID 20181010114222.74519-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: display devargs in port info output |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ferruh Yigit Oct. 10, 2018, 11:42 a.m. UTC
  Devargs may affect how device works but currently we don't have a
way to observe provided devargs.

Add ability to print device argument as part of port info,

For example, for "--vdev net_pcap0,iface=lo" output will be

"
********************* Infos for port 1  *********************
MAC address: 02:70:63:61:70:00
Device name: net_pcap0
Driver name: net_pcap
Devargs: iface=lo
....
"

or for "-w0000:86:00.1,queue-num-per-vf=8",

"
********************* Infos for port 0  *********************
MAC address: 3C:FD:FE:AB:B4:41
Device name: 0000:86:00.1
Driver name: net_i40e
Devargs: queue-num-per-vf=8
....
"

`Devargs` line may not be printed at all if devargs is not provided for
that device.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Iremonger, Bernard Oct. 10, 2018, 1:30 p.m. UTC | #1
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, October 10, 2018 12:42 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: [PATCH] app/testpmd: display devargs in port info output
> 
> Devargs may affect how device works but currently we don't have a way to
> observe provided devargs.
> 
> Add ability to print device argument as part of port info,
> 
> For example, for "--vdev net_pcap0,iface=lo" output will be
> 
> "
> ********************* Infos for port 1  ********************* MAC
> address: 02:70:63:61:70:00 Device name: net_pcap0 Driver name: net_pcap
> Devargs: iface=lo
> ....
> "
> 
> or for "-w0000:86:00.1,queue-num-per-vf=8",
> 
> "
> ********************* Infos for port 0  ********************* MAC
> address: 3C:FD:FE:AB:B4:41 Device name: 0000:86:00.1 Driver name: net_i40e
> Devargs: queue-num-per-vf=8
> ....
> "
> 
> `Devargs` line may not be printed at all if devargs is not provided for that device.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
  
Ferruh Yigit Oct. 11, 2018, 11 a.m. UTC | #2
On 10/10/2018 2:30 PM, Iremonger, Bernard wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, October 10, 2018 12:42 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
>> Subject: [PATCH] app/testpmd: display devargs in port info output
>>
>> Devargs may affect how device works but currently we don't have a way to
>> observe provided devargs.
>>
>> Add ability to print device argument as part of port info,
>>
>> For example, for "--vdev net_pcap0,iface=lo" output will be
>>
>> "
>> ********************* Infos for port 1  ********************* MAC
>> address: 02:70:63:61:70:00 Device name: net_pcap0 Driver name: net_pcap
>> Devargs: iface=lo
>> ....
>> "
>>
>> or for "-w0000:86:00.1,queue-num-per-vf=8",
>>
>> "
>> ********************* Infos for port 0  ********************* MAC
>> address: 3C:FD:FE:AB:B4:41 Device name: 0000:86:00.1 Driver name: net_i40e
>> Devargs: queue-num-per-vf=8
>> ....
>> "
>>
>> `Devargs` line may not be printed at all if devargs is not provided for that device.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 86c205806..67a4a309e 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -410,6 +410,8 @@  port_infos_display(portid_t port_id)
 	rte_eth_dev_get_name_by_port(port_id, name);
 	printf("\nDevice name: %s", name);
 	printf("\nDriver name: %s", dev_info.driver_name);
+	if (dev_info.device->devargs && dev_info.device->devargs->args)
+		printf("\nDevargs: %s", dev_info.device->devargs->args);
 	printf("\nConnect to socket: %u", port->socket_id);
 
 	if (port_numa[port_id] != NUMA_NO_CONFIG) {