app/testpmd: show mac address at initialization
authorZijie Pan <zijie.pan@6wind.com>
Wed, 30 Apr 2014 13:29:48 +0000 (15:29 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 16 May 2014 11:25:35 +0000 (13:25 +0200)
Display port number and MAC address at start up.
It is useful when configuring a packet generator.

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/testpmd.c

index 8b3e5c4..a4a8032 100644 (file)
@@ -1227,6 +1227,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");
@@ -1354,6 +1355,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;
        }