examples: check status of getting ethdev info
[dpdk.git] / examples / multi_process / symmetric_mp / main.c
index c310e94..9ae8efb 100644 (file)
@@ -209,7 +209,13 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
        printf("# Initialising port %u... ", port);
        fflush(stdout);
 
-       rte_eth_dev_info_get(port, &info);
+       retval = rte_eth_dev_info_get(port, &info);
+       if (retval != 0) {
+               printf("Error during getting device (port %u) info: %s\n",
+                               port, strerror(-retval));
+               return retval;
+       }
+
        info.default_rxconf.rx_drop_en = 1;
 
        if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
@@ -271,7 +277,7 @@ static void
 assign_ports_to_cores(void)
 {
 
-       const unsigned lcores = rte_eal_get_configuration()->lcore_count;
+       const unsigned int lcores = rte_lcore_count();
        const unsigned port_pairs = num_ports / 2;
        const unsigned pairs_per_lcore = port_pairs / lcores;
        unsigned extra_pairs = port_pairs % lcores;