[dpdk-dev,v7,5/9] app/testpmd: add port name to device info

Message ID 20180416130605.6509-6-declan.doherty@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Doherty, Declan April 16, 2018, 1:06 p.m. UTC
  Add the port name to information printed by show port info <port_id>

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 app/test-pmd/config.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 884bcb3b6..1b985056a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -407,6 +407,7 @@  port_infos_display(portid_t port_id)
 	static const char *info_border = "*********************";
 	portid_t pid;
 	uint16_t mtu;
+	char name[RTE_ETH_NAME_MAX_LEN];
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		printf("Valid port range is [0");
@@ -423,6 +424,8 @@  port_infos_display(portid_t port_id)
 	       info_border, port_id, info_border);
 	rte_eth_macaddr_get(port_id, &mac_addr);
 	print_ethaddr("MAC address: ", &mac_addr);
+	rte_eth_dev_get_name_by_port(port_id, name);
+	printf("\nDevice name: %s", name);
 	printf("\nDriver name: %s", dev_info.driver_name);
 	printf("\nConnect to socket: %u", port->socket_id);