[dpdk-dev] [PATCH] app/testpmd: show mac address at initialization

David Marchand david.marchand at 6wind.com
Wed Apr 30 15:29:48 CEST 2014


From: Zijie Pan <zijie.pan at 6wind.com>

Display port number and MAC address at start up.
It is useful when configuring a packet generator.

Signed-off-by: Zijie Pan <zijie.pan at 6wind.com>
---
 app/test-pmd/testpmd.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9c56914..a661d33 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1223,6 +1223,7 @@ start_port(portid_t pid)
 	portid_t pi;
 	queueid_t qi;
 	struct rte_port *port;
+	uint8_t *mac_addr;
 
 	if (test_done == 0) {
 		printf("Please stop forwarding first\n");
@@ -1350,6 +1351,11 @@ start_port(portid_t pid)
 			RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0)
 			printf("Port %d can not be set into started\n", pi);
 
+		mac_addr = port->eth_addr.addr_bytes;
+		printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi,
+		       mac_addr[0], mac_addr[1], mac_addr[2],
+		       mac_addr[3], mac_addr[4], mac_addr[5]);
+
 		/* at least one port started, need checking link status */
 		need_check_link_status = 1;
 	}
-- 
1.7.10.4



More information about the dev mailing list