test/spinlock: use compile atomics for lcores sync
[dpdk.git] / examples / multi_process / symmetric_mp / main.c
index 7f49145..79e5c61 100644 (file)
@@ -66,7 +66,7 @@ struct port_stats{
        unsigned rx;
        unsigned tx;
        unsigned drop;
-} __attribute__((aligned(RTE_CACHE_LINE_SIZE / 2)));
+} __rte_aligned(RTE_CACHE_LINE_SIZE / 2);
 
 static int proc_id = -1;
 static unsigned num_procs = 0;
@@ -365,6 +365,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
        uint8_t count, all_ports_up, print_flag = 0;
        struct rte_eth_link link;
        int ret;
+       char link_status_text[RTE_ETH_LINK_MAX_STR_LEN];
 
        printf("\nChecking link status");
        fflush(stdout);
@@ -384,14 +385,10 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
                        }
                        /* print link status if flag set */
                        if (print_flag == 1) {
-                               if (link.link_status)
-                                       printf(
-                                       "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"));
-                               else
-                                       printf("Port %d Link Down\n", portid);
+                               rte_eth_link_to_str(link_status_text,
+                                       sizeof(link_status_text), &link);
+                               printf("Port %d %s\n", portid,
+                                      link_status_text);
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
@@ -473,7 +470,10 @@ main(int argc, char **argv)
 
        RTE_LOG(INFO, APP, "Finished Process Init.\n");
 
-       rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER);
+       rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
+
+       /* clean up the EAL */
+       rte_eal_cleanup();
 
        return 0;
 }