examples: work only on defined lcores
[dpdk.git] / examples / multi_process / client_server_mp / mp_server / main.c
index b796e76..43e0ab5 100644 (file)
@@ -138,8 +138,8 @@ do_stats_display(void)
                const volatile struct tx_stats *tx = &ports->tx_stats[i];
                for (j = 0; j < ports->num_ports; j++){
                        /* assign to local variables here, save re-reading volatile vars */
-                       const uint64_t tx_val = tx->tx[j];
-                       const uint64_t drop_val = tx->tx_drop[j];
+                       const uint64_t tx_val = tx->tx[ports->id[j]];
+                       const uint64_t drop_val = tx->tx_drop[ports->id[j]];
                        port_tx[j] += tx_val;
                        port_tx_drop[j] += drop_val;
                        client_tx[i] += tx_val;
@@ -200,12 +200,6 @@ sleep_lcore(__attribute__((unused)) void *dummy)
                while (sleep(sleeptime) <= sleeptime)
                        do_stats_display();
        }
-       else {
-               const unsigned sleeptime = 100;
-               printf("Putting core %u to sleep\n", rte_lcore_id());
-               while (sleep(sleeptime) <= sleeptime)
-                       ; /* loop doing nothing */
-       }
        return 0;
 }