app/testpmd: send failure logs to stderr
[dpdk.git] / app / test-pmd / util.c
index 5962651..5dd7157 100644 (file)
@@ -433,8 +433,9 @@ eth_dev_info_get_print_err(uint16_t port_id,
 
        ret = rte_eth_dev_info_get(port_id, dev_info);
        if (ret != 0)
-               printf("Error during getting device (port %u) info: %s\n",
-                               port_id, strerror(-ret));
+               fprintf(stderr,
+                       "Error during getting device (port %u) info: %s\n",
+                       port_id, strerror(-ret));
 
        return ret;
 }
@@ -450,7 +451,8 @@ eth_set_promisc_mode(uint16_t port, int enable)
                ret = rte_eth_promiscuous_disable(port);
 
        if (ret != 0)
-               printf("Error during %s promiscuous mode for port %u: %s\n",
+               fprintf(stderr,
+                       "Error during %s promiscuous mode for port %u: %s\n",
                        enable ? "enabling" : "disabling",
                        port, rte_strerror(-ret));
 }
@@ -466,7 +468,8 @@ eth_set_allmulticast_mode(uint16_t port, int enable)
                ret = rte_eth_allmulticast_disable(port);
 
        if (ret != 0)
-               printf("Error during %s all-multicast mode for port %u: %s\n",
+               fprintf(stderr,
+                       "Error during %s all-multicast mode for port %u: %s\n",
                        enable ? "enabling" : "disabling",
                        port, rte_strerror(-ret));
 }
@@ -478,7 +481,8 @@ eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link)
 
        ret = rte_eth_link_get_nowait(port_id, link);
        if (ret < 0)
-               printf("Device (port %u) link get (without wait) failed: %s\n",
+               fprintf(stderr,
+                       "Device (port %u) link get (without wait) failed: %s\n",
                        port_id, rte_strerror(-ret));
 
        return ret;
@@ -491,8 +495,9 @@ eth_macaddr_get_print_err(uint16_t port_id, struct rte_ether_addr *mac_addr)
 
        ret = rte_eth_macaddr_get(port_id, mac_addr);
        if (ret != 0)
-               printf("Error getting device (port %u) mac address: %s\n",
-                               port_id, rte_strerror(-ret));
+               fprintf(stderr,
+                       "Error getting device (port %u) mac address: %s\n",
+                       port_id, rte_strerror(-ret));
 
        return ret;
 }