vhost: replace vDPA device ID in Vhost
[dpdk.git] / examples / vm_power_manager / main.c
index ed18177..273bfec 100644 (file)
@@ -112,7 +112,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 
        /* Display the port MAC address. */
        struct rte_ether_addr addr;
-       rte_eth_macaddr_get(port, &addr);
+       retval = rte_eth_macaddr_get(port, &addr);
+       if (retval != 0) {
+               printf("Failed to get device (port %u) MAC address: %s\n",
+                               port, rte_strerror(-retval));
+               return retval;
+       }
+
        printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
                           " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
                        (unsigned int)port,
@@ -266,7 +272,7 @@ check_all_ports_link_status(uint32_t port_mask)
                                                "Mbps - %s\n", (uint16_t)portid,
                                                (unsigned int)link.link_speed,
                                (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
-                                       ("full-duplex") : ("half-duplex\n"));
+                                       ("full-duplex") : ("half-duplex"));
                                else
                                        printf("Port %d Link Down\n",
                                                (uint16_t)portid);
@@ -296,7 +302,7 @@ check_all_ports_link_status(uint32_t port_mask)
        }
 }
 static int
-run_monitor(__attribute__((unused)) void *arg)
+run_monitor(__rte_unused void *arg)
 {
        if (channel_monitor_init() < 0) {
                printf("Unable to initialize channel monitor\n");
@@ -307,7 +313,7 @@ run_monitor(__attribute__((unused)) void *arg)
 }
 
 static int
-run_core_monitor(__attribute__((unused)) void *arg)
+run_core_monitor(__rte_unused void *arg)
 {
        if (branch_monitor_init() < 0) {
                printf("Unable to initialize core monitor\n");