examples: add flush after stats printing
[dpdk.git] / examples / l2fwd-crypto / main.c
index 7c84b40..827da9b 100644 (file)
@@ -334,6 +334,8 @@ print_stats(void)
                   total_packets_dropped,
                   total_packets_errors);
        printf("\n====================================================\n");
+
+       fflush(stdout);
 }
 
 static int
@@ -1756,7 +1758,7 @@ check_all_ports_link_status(uint32_t port_mask)
                                        "Port%d Link Up. Speed %u Mbps - %s\n",
                                                portid, 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", portid);
                                continue;
@@ -2589,7 +2591,13 @@ initialize_ports(struct l2fwd_crypto_options *options)
                        return -1;
                }
 
-               rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]);
+               retval = rte_eth_macaddr_get(portid,
+                                            &l2fwd_ports_eth_addr[portid]);
+               if (retval < 0) {
+                       printf("rte_eth_macaddr_get :err=%d, port=%u\n",
+                                       retval, portid);
+                       return -1;
+               }
 
                printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
                                portid,