net/mlx5: support flow dump API
[dpdk.git] / examples / multi_process / client_server_mp / mp_client / client.c
index 92955e9..361d90b 100644 (file)
@@ -220,7 +220,7 @@ main(int argc, char *argv[])
        if (parse_app_args(argc, argv) < 0)
                rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n");
 
-       if (rte_eth_dev_count() == 0)
+       if (rte_eth_dev_count_avail() == 0)
                rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
 
        rx_ring = rte_ring_lookup(get_rx_queue_name(client_id));
@@ -246,19 +246,19 @@ main(int argc, char *argv[])
 
        for (;;) {
                uint16_t i, rx_pkts;
-               uint16_t port;
 
                rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts,
                                PKT_READ_SIZE, NULL);
 
-               if (unlikely(rx_pkts == 0)){
-                       if (need_flush)
-                               for (port = 0; port < ports->num_ports; port++) {
-                                       sent = rte_eth_tx_buffer_flush(ports->id[port], client_id,
-                                                       tx_buffer[port]);
-                                       if (unlikely(sent))
-                                               tx_stats->tx[port] += sent;
-                               }
+               if (rx_pkts == 0 && need_flush) {
+                       for (i = 0; i < ports->num_ports; i++) {
+                               uint16_t port = ports->id[i];
+
+                               sent = rte_eth_tx_buffer_flush(port,
+                                                              client_id,
+                                                              tx_buffer[port]);
+                               tx_stats->tx[port] += sent;
+                       }
                        need_flush = 0;
                        continue;
                }