net/sfc: support API to negotiate delivery of Rx metadata
[dpdk.git] / app / test-pmd / testpmd.c
index 1cdd3cd..a7841c5 100644 (file)
@@ -246,6 +246,7 @@ uint32_t tx_pkt_times_intra;
 
 uint16_t nb_pkt_per_burst = DEF_PKT_BURST; /**< Number of packets per burst. */
 uint16_t nb_pkt_flowgen_clones; /**< Number of Tx packet clones to send in flowgen mode. */
+int nb_flows_flowgen = 1024; /**< Number of flows in flowgen mode. */
 uint16_t mb_mempool_cache = DEF_MBUF_CACHE; /**< Size of mbuf mempool cache. */
 
 /* current configuration is in DCB or not,0 means it is not in DCB mode */
@@ -520,6 +521,97 @@ enum rte_eth_rx_mq_mode rx_mq_mode = ETH_MQ_RX_VMDQ_DCB_RSS;
  */
 uint32_t eth_link_speed;
 
+/*
+ * ID of the current process in multi-process, used to
+ * configure the queues to be polled.
+ */
+int proc_id;
+
+/*
+ * Number of processes in multi-process, used to
+ * configure the queues to be polled.
+ */
+unsigned int num_procs = 1;
+
+static void
+eth_rx_metadata_negotiate_mp(uint16_t port_id)
+{
+       uint64_t rx_meta_features = 0;
+       int ret;
+
+       if (!is_proc_primary())
+               return;
+
+       rx_meta_features |= RTE_ETH_RX_METADATA_USER_FLAG;
+       rx_meta_features |= RTE_ETH_RX_METADATA_USER_MARK;
+       rx_meta_features |= RTE_ETH_RX_METADATA_TUNNEL_ID;
+
+       ret = rte_eth_rx_metadata_negotiate(port_id, &rx_meta_features);
+       if (ret == 0) {
+               if (!(rx_meta_features & RTE_ETH_RX_METADATA_USER_FLAG)) {
+                       TESTPMD_LOG(DEBUG, "Flow action FLAG will not affect Rx mbufs on port %u\n",
+                                   port_id);
+               }
+
+               if (!(rx_meta_features & RTE_ETH_RX_METADATA_USER_MARK)) {
+                       TESTPMD_LOG(DEBUG, "Flow action MARK will not affect Rx mbufs on port %u\n",
+                                   port_id);
+               }
+
+               if (!(rx_meta_features & RTE_ETH_RX_METADATA_TUNNEL_ID)) {
+                       TESTPMD_LOG(DEBUG, "Flow tunnel offload support might be limited or unavailable on port %u\n",
+                                   port_id);
+               }
+       } else if (ret != -ENOTSUP) {
+               rte_exit(EXIT_FAILURE, "Error when negotiating Rx meta features on port %u: %s\n",
+                        port_id, rte_strerror(-ret));
+       }
+}
+
+static int
+eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
+                     const struct rte_eth_conf *dev_conf)
+{
+       if (is_proc_primary())
+               return rte_eth_dev_configure(port_id, nb_rx_q, nb_tx_q,
+                                       dev_conf);
+       return 0;
+}
+
+static int
+eth_dev_start_mp(uint16_t port_id)
+{
+       if (is_proc_primary())
+               return rte_eth_dev_start(port_id);
+
+       return 0;
+}
+
+static int
+eth_dev_stop_mp(uint16_t port_id)
+{
+       if (is_proc_primary())
+               return rte_eth_dev_stop(port_id);
+
+       return 0;
+}
+
+static void
+mempool_free_mp(struct rte_mempool *mp)
+{
+       if (is_proc_primary())
+               rte_mempool_free(mp);
+}
+
+static int
+eth_dev_set_mtu_mp(uint16_t port_id, uint16_t mtu)
+{
+       if (is_proc_primary())
+               return rte_eth_dev_set_mtu(port_id, mtu);
+
+       return 0;
+}
+
 /* Forward function declarations */
 static void setup_attached_port(portid_t pi);
 static void check_all_ports_link_status(uint32_t port_mask);
@@ -857,16 +949,23 @@ dma_unmap_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,
        int ret;
 
        RTE_ETH_FOREACH_DEV(pid) {
-               struct rte_eth_dev *dev =
-                       &rte_eth_devices[pid];
+               struct rte_eth_dev_info dev_info;
+
+               ret = eth_dev_info_get_print_err(pid, &dev_info);
+               if (ret != 0) {
+                       TESTPMD_LOG(DEBUG,
+                                   "unable to get device info for port %d on addr 0x%p,"
+                                   "mempool unmapping will not be performed\n",
+                                   pid, memhdr->addr);
+                       continue;
+               }
 
-               ret = rte_dev_dma_unmap(dev->device, memhdr->addr, 0,
-                                       memhdr->len);
+               ret = rte_dev_dma_unmap(dev_info.device, memhdr->addr, 0, memhdr->len);
                if (ret) {
                        TESTPMD_LOG(DEBUG,
                                    "unable to DMA unmap addr 0x%p "
                                    "for device %s\n",
-                                   memhdr->addr, dev->data->name);
+                                   memhdr->addr, dev_info.device->name);
                }
        }
        ret = rte_extmem_unregister(memhdr->addr, memhdr->len);
@@ -892,16 +991,22 @@ dma_map_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,
                return;
        }
        RTE_ETH_FOREACH_DEV(pid) {
-               struct rte_eth_dev *dev =
-                       &rte_eth_devices[pid];
+               struct rte_eth_dev_info dev_info;
 
-               ret = rte_dev_dma_map(dev->device, memhdr->addr, 0,
-                                     memhdr->len);
+               ret = eth_dev_info_get_print_err(pid, &dev_info);
+               if (ret != 0) {
+                       TESTPMD_LOG(DEBUG,
+                                   "unable to get device info for port %d on addr 0x%p,"
+                                   "mempool mapping will not be performed\n",
+                                   pid, memhdr->addr);
+                       continue;
+               }
+               ret = rte_dev_dma_map(dev_info.device, memhdr->addr, 0, memhdr->len);
                if (ret) {
                        TESTPMD_LOG(DEBUG,
                                    "unable to DMA map addr 0x%p "
                                    "for device %s\n",
-                                   memhdr->addr, dev->data->name);
+                                   memhdr->addr, dev_info.device->name);
                }
        }
 }
@@ -982,6 +1087,14 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
        mb_size = sizeof(struct rte_mbuf) + mbuf_seg_size;
 #endif
        mbuf_poolname_build(socket_id, pool_name, sizeof(pool_name), size_idx);
+       if (!is_proc_primary()) {
+               rte_mp = rte_mempool_lookup(pool_name);
+               if (rte_mp == NULL)
+                       rte_exit(EXIT_FAILURE,
+                               "Get mbuf pool for socket %u failed: %s\n",
+                               socket_id, rte_strerror(rte_errno));
+               return rte_mp;
+       }
 
        TESTPMD_LOG(INFO,
                "create a new mbuf pool <%s>: n=%u, size=%u, socket=%u\n",
@@ -1089,10 +1202,8 @@ check_socket_id(const unsigned int socket_id)
 
        if (new_socket_id(socket_id)) {
                if (!warning_once && numa_support)
-                       printf("Warning: NUMA should be configured manually by"
-                              " using --port-numa-config and"
-                              " --ring-numa-config parameters along with"
-                              " --numa.\n");
+                       fprintf(stderr,
+                               "Warning: NUMA should be configured manually by using --port-numa-config and --ring-numa-config parameters along with --numa.\n");
                warning_once = 1;
                return -1;
        }
@@ -1139,11 +1250,9 @@ check_nb_rxq(queueid_t rxq)
 
        allowed_max_rxq = get_allowed_max_nb_rxq(&pid);
        if (rxq > allowed_max_rxq) {
-               printf("Fail: input rxq (%u) can't be greater "
-                      "than max_rx_queues (%u) of port %u\n",
-                      rxq,
-                      allowed_max_rxq,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input rxq (%u) can't be greater than max_rx_queues (%u) of port %u\n",
+                       rxq, allowed_max_rxq, pid);
                return -1;
        }
        return 0;
@@ -1189,11 +1298,9 @@ check_nb_txq(queueid_t txq)
 
        allowed_max_txq = get_allowed_max_nb_txq(&pid);
        if (txq > allowed_max_txq) {
-               printf("Fail: input txq (%u) can't be greater "
-                      "than max_tx_queues (%u) of port %u\n",
-                      txq,
-                      allowed_max_txq,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input txq (%u) can't be greater than max_tx_queues (%u) of port %u\n",
+                       txq, allowed_max_txq, pid);
                return -1;
        }
        return 0;
@@ -1264,21 +1371,17 @@ check_nb_rxd(queueid_t rxd)
 
        allowed_max_rxd = get_allowed_max_nb_rxd(&pid);
        if (rxd > allowed_max_rxd) {
-               printf("Fail: input rxd (%u) can't be greater "
-                      "than max_rxds (%u) of port %u\n",
-                      rxd,
-                      allowed_max_rxd,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input rxd (%u) can't be greater than max_rxds (%u) of port %u\n",
+                       rxd, allowed_max_rxd, pid);
                return -1;
        }
 
        allowed_min_rxd = get_allowed_min_nb_rxd(&pid);
        if (rxd < allowed_min_rxd) {
-               printf("Fail: input rxd (%u) can't be less "
-                      "than min_rxds (%u) of port %u\n",
-                      rxd,
-                      allowed_min_rxd,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input rxd (%u) can't be less than min_rxds (%u) of port %u\n",
+                       rxd, allowed_min_rxd, pid);
                return -1;
        }
 
@@ -1349,21 +1452,17 @@ check_nb_txd(queueid_t txd)
 
        allowed_max_txd = get_allowed_max_nb_txd(&pid);
        if (txd > allowed_max_txd) {
-               printf("Fail: input txd (%u) can't be greater "
-                      "than max_txds (%u) of port %u\n",
-                      txd,
-                      allowed_max_txd,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input txd (%u) can't be greater than max_txds (%u) of port %u\n",
+                       txd, allowed_max_txd, pid);
                return -1;
        }
 
        allowed_min_txd = get_allowed_min_nb_txd(&pid);
        if (txd < allowed_min_txd) {
-               printf("Fail: input txd (%u) can't be less "
-                      "than min_txds (%u) of port %u\n",
-                      txd,
-                      allowed_min_txd,
-                      pid);
+               fprintf(stderr,
+                       "Fail: input txd (%u) can't be less than min_txds (%u) of port %u\n",
+                       txd, allowed_min_txd, pid);
                return -1;
        }
        return 0;
@@ -1409,31 +1508,84 @@ check_nb_hairpinq(queueid_t hairpinq)
 
        allowed_max_hairpinq = get_allowed_max_nb_hairpinq(&pid);
        if (hairpinq > allowed_max_hairpinq) {
-               printf("Fail: input hairpin (%u) can't be greater "
-                      "than max_hairpin_queues (%u) of port %u\n",
-                      hairpinq, allowed_max_hairpinq, pid);
+               fprintf(stderr,
+                       "Fail: input hairpin (%u) can't be greater than max_hairpin_queues (%u) of port %u\n",
+                       hairpinq, allowed_max_hairpinq, pid);
                return -1;
        }
        return 0;
 }
 
+static void
+init_config_port_offloads(portid_t pid, uint32_t socket_id)
+{
+       struct rte_port *port = &ports[pid];
+       uint16_t data_size;
+       int ret;
+       int i;
+
+       eth_rx_metadata_negotiate_mp(pid);
+
+       port->dev_conf.txmode = tx_mode;
+       port->dev_conf.rxmode = rx_mode;
+
+       ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+       if (ret != 0)
+               rte_exit(EXIT_FAILURE, "rte_eth_dev_info_get() failed\n");
+
+       ret = update_jumbo_frame_offload(pid);
+       if (ret != 0)
+               fprintf(stderr,
+                       "Updating jumbo frame offload failed for port %u\n",
+                       pid);
+
+       if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE))
+               port->dev_conf.txmode.offloads &=
+                       ~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+       /* Apply Rx offloads configuration */
+       for (i = 0; i < port->dev_info.max_rx_queues; i++)
+               port->rx_conf[i].offloads = port->dev_conf.rxmode.offloads;
+       /* Apply Tx offloads configuration */
+       for (i = 0; i < port->dev_info.max_tx_queues; i++)
+               port->tx_conf[i].offloads = port->dev_conf.txmode.offloads;
+
+       if (eth_link_speed)
+               port->dev_conf.link_speeds = eth_link_speed;
+
+       /* set flag to initialize port/queue */
+       port->need_reconfig = 1;
+       port->need_reconfig_queues = 1;
+       port->socket_id = socket_id;
+       port->tx_metadata = 0;
+
+       /*
+        * Check for maximum number of segments per MTU.
+        * Accordingly update the mbuf data size.
+        */
+       if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX &&
+           port->dev_info.rx_desc_lim.nb_mtu_seg_max != 0) {
+               data_size = rx_mode.max_rx_pkt_len /
+                       port->dev_info.rx_desc_lim.nb_mtu_seg_max;
+
+               if ((data_size + RTE_PKTMBUF_HEADROOM) > mbuf_data_size[0]) {
+                       mbuf_data_size[0] = data_size + RTE_PKTMBUF_HEADROOM;
+                       TESTPMD_LOG(WARNING,
+                                   "Configured mbuf size of the first segment %hu\n",
+                                   mbuf_data_size[0]);
+               }
+       }
+}
+
 static void
 init_config(void)
 {
        portid_t pid;
-       struct rte_port *port;
        struct rte_mempool *mbp;
        unsigned int nb_mbuf_per_pool;
        lcoreid_t  lc_id;
-       uint8_t port_per_socket[RTE_MAX_NUMA_NODES];
        struct rte_gro_param gro_param;
        uint32_t gso_types;
-       uint16_t data_size;
-       bool warning = 0;
-       int k;
-       int ret;
-
-       memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
 
        /* Configuration of logical cores. */
        fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
@@ -1455,30 +1607,12 @@ init_config(void)
        }
 
        RTE_ETH_FOREACH_DEV(pid) {
-               port = &ports[pid];
-               /* Apply default TxRx configuration for all ports */
-               port->dev_conf.txmode = tx_mode;
-               port->dev_conf.rxmode = rx_mode;
+               uint32_t socket_id;
 
-               ret = eth_dev_info_get_print_err(pid, &port->dev_info);
-               if (ret != 0)
-                       rte_exit(EXIT_FAILURE,
-                                "rte_eth_dev_info_get() failed\n");
-
-               ret = update_jumbo_frame_offload(pid);
-               if (ret != 0)
-                       printf("Updating jumbo frame offload failed for port %u\n",
-                               pid);
-
-               if (!(port->dev_info.tx_offload_capa &
-                     DEV_TX_OFFLOAD_MBUF_FAST_FREE))
-                       port->dev_conf.txmode.offloads &=
-                               ~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
                if (numa_support) {
-                       if (port_numa[pid] != NUMA_NO_CONFIG)
-                               port_per_socket[port_numa[pid]]++;
-                       else {
-                               uint32_t socket_id = rte_eth_dev_socket_id(pid);
+                       socket_id = port_numa[pid];
+                       if (port_numa[pid] == NUMA_NO_CONFIG) {
+                               socket_id = rte_eth_dev_socket_id(pid);
 
                                /*
                                 * if socket_id is invalid,
@@ -1486,48 +1620,14 @@ init_config(void)
                                 */
                                if (check_socket_id(socket_id) < 0)
                                        socket_id = socket_ids[0];
-                               port_per_socket[socket_id]++;
-                       }
-               }
-
-               /* Apply Rx offloads configuration */
-               for (k = 0; k < port->dev_info.max_rx_queues; k++)
-                       port->rx_conf[k].offloads =
-                               port->dev_conf.rxmode.offloads;
-               /* Apply Tx offloads configuration */
-               for (k = 0; k < port->dev_info.max_tx_queues; k++)
-                       port->tx_conf[k].offloads =
-                               port->dev_conf.txmode.offloads;
-
-               if (eth_link_speed)
-                       port->dev_conf.link_speeds = eth_link_speed;
-
-               /* set flag to initialize port/queue */
-               port->need_reconfig = 1;
-               port->need_reconfig_queues = 1;
-               port->tx_metadata = 0;
-
-               /* Check for maximum number of segments per MTU. Accordingly
-                * update the mbuf data size.
-                */
-               if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX &&
-                               port->dev_info.rx_desc_lim.nb_mtu_seg_max != 0) {
-                       data_size = rx_mode.max_rx_pkt_len /
-                               port->dev_info.rx_desc_lim.nb_mtu_seg_max;
-
-                       if ((data_size + RTE_PKTMBUF_HEADROOM) >
-                                                       mbuf_data_size[0]) {
-                               mbuf_data_size[0] = data_size +
-                                                RTE_PKTMBUF_HEADROOM;
-                               warning = 1;
                        }
+               } else {
+                       socket_id = (socket_num == UMA_NO_CONFIG) ?
+                                   0 : socket_num;
                }
+               /* Apply default TxRx configuration for all ports */
+               init_config_port_offloads(pid, socket_id);
        }
-
-       if (warning)
-               TESTPMD_LOG(WARNING,
-                           "Configured mbuf size of the first segment %hu\n",
-                           mbuf_data_size[0]);
        /*
         * Create pools of mbuf.
         * If NUMA support is disabled, create a single pool of mbuf in
@@ -1610,21 +1710,8 @@ init_config(void)
 void
 reconfig(portid_t new_port_id, unsigned socket_id)
 {
-       struct rte_port *port;
-       int ret;
-
        /* Reconfiguration of Ethernet ports. */
-       port = &ports[new_port_id];
-
-       ret = eth_dev_info_get_print_err(new_port_id, &port->dev_info);
-       if (ret != 0)
-               return;
-
-       /* set flag to initialize port/queue */
-       port->need_reconfig = 1;
-       port->need_reconfig_queues = 1;
-       port->socket_id = socket_id;
-
+       init_config_port_offloads(new_port_id, socket_id);
        init_port_config();
 }
 
@@ -1641,15 +1728,15 @@ init_fwd_streams(void)
        RTE_ETH_FOREACH_DEV(pid) {
                port = &ports[pid];
                if (nb_rxq > port->dev_info.max_rx_queues) {
-                       printf("Fail: nb_rxq(%d) is greater than "
-                               "max_rx_queues(%d)\n", nb_rxq,
-                               port->dev_info.max_rx_queues);
+                       fprintf(stderr,
+                               "Fail: nb_rxq(%d) is greater than max_rx_queues(%d)\n",
+                               nb_rxq, port->dev_info.max_rx_queues);
                        return -1;
                }
                if (nb_txq > port->dev_info.max_tx_queues) {
-                       printf("Fail: nb_txq(%d) is greater than "
-                               "max_tx_queues(%d)\n", nb_txq,
-                               port->dev_info.max_tx_queues);
+                       fprintf(stderr,
+                               "Fail: nb_txq(%d) is greater than max_tx_queues(%d)\n",
+                               nb_txq, port->dev_info.max_tx_queues);
                        return -1;
                }
                if (numa_support) {
@@ -1676,7 +1763,8 @@ init_fwd_streams(void)
 
        q = RTE_MAX(nb_rxq, nb_txq);
        if (q == 0) {
-               printf("Fail: Cannot allocate fwd streams as number of queues is 0\n");
+               fprintf(stderr,
+                       "Fail: Cannot allocate fwd streams as number of queues is 0\n");
                return -1;
        }
        nb_fwd_streams_new = (streamid_t)(nb_ports * q);
@@ -2008,6 +2096,11 @@ flush_fwd_rx_queues(void)
        uint64_t prev_tsc = 0, diff_tsc, cur_tsc, timer_tsc = 0;
        uint64_t timer_period;
 
+       if (num_procs > 1) {
+               printf("multi-process not support for flushing fwd Rx queues, skip the below lines and return.\n");
+               return;
+       }
+
        /* convert to number of cycles */
        timer_period = rte_get_timer_hz(); /* 1 second timeout */
 
@@ -2116,16 +2209,10 @@ run_one_txonly_burst_on_core(void *fwd_arg)
 static void
 launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)
 {
-       port_fwd_begin_t port_fwd_begin;
        unsigned int i;
        unsigned int lc_id;
        int diag;
 
-       port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin;
-       if (port_fwd_begin != NULL) {
-               for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++)
-                       (*port_fwd_begin)(fwd_ports_ids[i]);
-       }
        for (i = 0; i < cur_fwd_config.nb_fwd_lcores; i++) {
                lc_id = fwd_lcores_cpuids[i];
                if ((interactive == 0) || (lc_id != rte_lcore_id())) {
@@ -2133,8 +2220,9 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)
                        diag = rte_eal_remote_launch(pkt_fwd_on_lcore,
                                                     fwd_lcores[i], lc_id);
                        if (diag != 0)
-                               printf("launch lcore %u failed - diag=%d\n",
-                                      lc_id, diag);
+                               fprintf(stderr,
+                                       "launch lcore %u failed - diag=%d\n",
+                                       lc_id, diag);
                }
        }
 }
@@ -2163,17 +2251,42 @@ start_packet_forwarding(int with_tx_first)
                        cur_fwd_eng->fwd_mode_name);
 
        if (all_ports_started() == 0) {
-               printf("Not all ports were started\n");
+               fprintf(stderr, "Not all ports were started\n");
                return;
        }
        if (test_done == 0) {
-               printf("Packet forwarding already started\n");
+               fprintf(stderr, "Packet forwarding already started\n");
                return;
        }
-       test_done = 0;
 
        fwd_config_setup();
 
+       port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin;
+       if (port_fwd_begin != NULL) {
+               for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+                       if (port_fwd_begin(fwd_ports_ids[i])) {
+                               fprintf(stderr,
+                                       "Packet forwarding is not ready\n");
+                               return;
+                       }
+               }
+       }
+
+       if (with_tx_first) {
+               port_fwd_begin = tx_only_engine.port_fwd_begin;
+               if (port_fwd_begin != NULL) {
+                       for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+                               if (port_fwd_begin(fwd_ports_ids[i])) {
+                                       fprintf(stderr,
+                                               "Packet forwarding is not ready\n");
+                                       return;
+                               }
+                       }
+               }
+       }
+
+       test_done = 0;
+
        if(!no_flush_rx)
                flush_fwd_rx_queues();
 
@@ -2182,11 +2295,6 @@ start_packet_forwarding(int with_tx_first)
 
        fwd_stats_reset();
        if (with_tx_first) {
-               port_fwd_begin = tx_only_engine.port_fwd_begin;
-               if (port_fwd_begin != NULL) {
-                       for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++)
-                               (*port_fwd_begin)(fwd_ports_ids[i]);
-               }
                while (with_tx_first--) {
                        launch_packet_forwarding(
                                        run_one_txonly_burst_on_core);
@@ -2210,7 +2318,7 @@ stop_packet_forwarding(void)
        int i;
 
        if (test_done) {
-               printf("Packet forwarding not started\n");
+               fprintf(stderr, "Packet forwarding not started\n");
                return;
        }
        printf("Telling cores to stop...");
@@ -2236,14 +2344,14 @@ void
 dev_set_link_up(portid_t pid)
 {
        if (rte_eth_dev_set_link_up(pid) < 0)
-               printf("\nSet link up fail.\n");
+               fprintf(stderr, "\nSet link up fail.\n");
 }
 
 void
 dev_set_link_down(portid_t pid)
 {
        if (rte_eth_dev_set_link_down(pid) < 0)
-               printf("\nSet link down fail.\n");
+               fprintf(stderr, "\nSet link down fail.\n");
 }
 
 static int
@@ -2364,10 +2472,10 @@ setup_hairpin_queues(portid_t pi, portid_t p_pi, uint16_t cnt_pi)
                if (rte_atomic16_cmpset(&(port->port_status),
                                        RTE_PORT_HANDLING,
                                        RTE_PORT_STOPPED) == 0)
-                       printf("Port %d can not be set back "
-                                       "to stopped\n", pi);
-               printf("Fail to configure port %d hairpin "
-                               "queues\n", pi);
+                       fprintf(stderr,
+                               "Port %d can not be set back to stopped\n", pi);
+               fprintf(stderr, "Fail to configure port %d hairpin queues\n",
+                       pi);
                /* try to reconfigure queues next time */
                port->need_reconfig_queues = 1;
                return -1;
@@ -2387,10 +2495,10 @@ setup_hairpin_queues(portid_t pi, portid_t p_pi, uint16_t cnt_pi)
                if (rte_atomic16_cmpset(&(port->port_status),
                                        RTE_PORT_HANDLING,
                                        RTE_PORT_STOPPED) == 0)
-                       printf("Port %d can not be set back "
-                                       "to stopped\n", pi);
-               printf("Fail to configure port %d hairpin "
-                               "queues\n", pi);
+                       fprintf(stderr,
+                               "Port %d can not be set back to stopped\n", pi);
+               fprintf(stderr, "Fail to configure port %d hairpin queues\n",
+                       pi);
                /* try to reconfigure queues next time */
                port->need_reconfig_queues = 1;
                return -1;
@@ -2456,7 +2564,6 @@ start_port(portid_t pid)
        int peer_pi;
        queueid_t qi;
        struct rte_port *port;
-       struct rte_ether_addr mac_addr;
        struct rte_eth_hairpin_cap cap;
 
        if (port_id_is_invalid(pid, ENABLED_WARN))
@@ -2470,7 +2577,7 @@ start_port(portid_t pid)
                port = &ports[pi];
                if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
                                                 RTE_PORT_HANDLING) == 0) {
-                       printf("Port %d is now not stopped\n", pi);
+                       fprintf(stderr, "Port %d is now not stopped\n", pi);
                        continue;
                }
 
@@ -2480,8 +2587,9 @@ start_port(portid_t pid)
                        if (flow_isolate_all) {
                                int ret = port_flow_isolate(pi, 1);
                                if (ret) {
-                                       printf("Failed to apply isolated"
-                                              " mode on port %d\n", pi);
+                                       fprintf(stderr,
+                                               "Failed to apply isolated mode on port %d\n",
+                                               pi);
                                        return -1;
                                }
                        }
@@ -2490,26 +2598,29 @@ start_port(portid_t pid)
                                        port->socket_id);
                        if (nb_hairpinq > 0 &&
                            rte_eth_dev_hairpin_capability_get(pi, &cap)) {
-                               printf("Port %d doesn't support hairpin "
-                                      "queues\n", pi);
+                               fprintf(stderr,
+                                       "Port %d doesn't support hairpin queues\n",
+                                       pi);
                                return -1;
                        }
                        /* configure port */
-                       diag = rte_eth_dev_configure(pi, nb_rxq + nb_hairpinq,
+                       diag = eth_dev_configure_mp(pi, nb_rxq + nb_hairpinq,
                                                     nb_txq + nb_hairpinq,
                                                     &(port->dev_conf));
                        if (diag != 0) {
                                if (rte_atomic16_cmpset(&(port->port_status),
                                RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
-                                       printf("Port %d can not be set back "
-                                                       "to stopped\n", pi);
-                               printf("Fail to configure port %d\n", pi);
+                                       fprintf(stderr,
+                                               "Port %d can not be set back to stopped\n",
+                                               pi);
+                               fprintf(stderr, "Fail to configure port %d\n",
+                                       pi);
                                /* try to reconfigure port next time */
                                port->need_reconfig = 1;
                                return -1;
                        }
                }
-               if (port->need_reconfig_queues > 0) {
+               if (port->need_reconfig_queues > 0 && is_proc_primary()) {
                        port->need_reconfig_queues = 0;
                        /* setup tx queues */
                        for (qi = 0; qi < nb_txq; qi++) {
@@ -2532,10 +2643,12 @@ start_port(portid_t pid)
                                if (rte_atomic16_cmpset(&(port->port_status),
                                                        RTE_PORT_HANDLING,
                                                        RTE_PORT_STOPPED) == 0)
-                                       printf("Port %d can not be set back "
-                                                       "to stopped\n", pi);
-                               printf("Fail to configure port %d tx queues\n",
-                                      pi);
+                                       fprintf(stderr,
+                                               "Port %d can not be set back to stopped\n",
+                                               pi);
+                               fprintf(stderr,
+                                       "Fail to configure port %d tx queues\n",
+                                       pi);
                                /* try to reconfigure queues next time */
                                port->need_reconfig_queues = 1;
                                return -1;
@@ -2548,9 +2661,8 @@ start_port(portid_t pid)
                                                mbuf_pool_find
                                                        (rxring_numa[pi], 0);
                                        if (mp == NULL) {
-                                               printf("Failed to setup RX queue:"
-                                                       "No mempool allocation"
-                                                       " on the socket %d\n",
+                                               fprintf(stderr,
+                                                       "Failed to setup RX queue: No mempool allocation on the socket %d\n",
                                                        rxring_numa[pi]);
                                                return -1;
                                        }
@@ -2565,9 +2677,8 @@ start_port(portid_t pid)
                                                mbuf_pool_find
                                                        (port->socket_id, 0);
                                        if (mp == NULL) {
-                                               printf("Failed to setup RX queue:"
-                                                       "No mempool allocation"
-                                                       " on the socket %d\n",
+                                               fprintf(stderr,
+                                                       "Failed to setup RX queue: No mempool allocation on the socket %d\n",
                                                        port->socket_id);
                                                return -1;
                                        }
@@ -2584,10 +2695,12 @@ start_port(portid_t pid)
                                if (rte_atomic16_cmpset(&(port->port_status),
                                                        RTE_PORT_HANDLING,
                                                        RTE_PORT_STOPPED) == 0)
-                                       printf("Port %d can not be set back "
-                                                       "to stopped\n", pi);
-                               printf("Fail to configure port %d rx queues\n",
-                                      pi);
+                                       fprintf(stderr,
+                                               "Port %d can not be set back to stopped\n",
+                                               pi);
+                               fprintf(stderr,
+                                       "Fail to configure port %d rx queues\n",
+                                       pi);
                                /* try to reconfigure queues next time */
                                port->need_reconfig_queues = 1;
                                return -1;
@@ -2601,37 +2714,37 @@ start_port(portid_t pid)
                        diag = rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN,
                                        NULL, 0);
                        if (diag < 0)
-                               printf(
-                               "Port %d: Failed to disable Ptype parsing\n",
-                               pi);
+                               fprintf(stderr,
+                                       "Port %d: Failed to disable Ptype parsing\n",
+                                       pi);
                }
 
                p_pi = pi;
                cnt_pi++;
 
                /* start port */
-               diag = rte_eth_dev_start(pi);
+               diag = eth_dev_start_mp(pi);
                if (diag < 0) {
-                       printf("Fail to start port %d: %s\n", pi,
-                              rte_strerror(-diag));
+                       fprintf(stderr, "Fail to start port %d: %s\n",
+                               pi, rte_strerror(-diag));
 
                        /* Fail to setup rx queue, return */
                        if (rte_atomic16_cmpset(&(port->port_status),
                                RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
-                               printf("Port %d can not be set back to "
-                                                       "stopped\n", pi);
+                               fprintf(stderr,
+                                       "Port %d can not be set back to stopped\n",
+                                       pi);
                        continue;
                }
 
                if (rte_atomic16_cmpset(&(port->port_status),
                        RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0)
-                       printf("Port %d can not be set into started\n", pi);
+                       fprintf(stderr, "Port %d can not be set into started\n",
+                               pi);
 
-               if (eth_macaddr_get_print_err(pi, &mac_addr) == 0)
-                       printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi,
-                               mac_addr.addr_bytes[0], mac_addr.addr_bytes[1],
-                               mac_addr.addr_bytes[2], mac_addr.addr_bytes[3],
-                               mac_addr.addr_bytes[4], mac_addr.addr_bytes[5]);
+               if (eth_macaddr_get_print_err(pi, &port->eth_addr) == 0)
+                       printf("Port %d: " RTE_ETHER_ADDR_PRT_FMT "\n", pi,
+                                       RTE_ETHER_ADDR_BYTES(&port->eth_addr));
 
                /* at least one port started, need checking link status */
                need_check_link_status = 1;
@@ -2642,7 +2755,7 @@ start_port(portid_t pid)
        if (need_check_link_status == 1 && !no_link_check)
                check_all_ports_link_status(RTE_PORT_ALL);
        else if (need_check_link_status == 0)
-               printf("Please stop the ports first\n");
+               fprintf(stderr, "Please stop the ports first\n");
 
        if (hairpin_mode & 0xf) {
                uint16_t i;
@@ -2661,10 +2774,10 @@ start_port(portid_t pid)
                                        continue;
                                diag = rte_eth_hairpin_bind(pi, peer_pl[j]);
                                if (diag < 0) {
-                                       printf("Error during binding hairpin"
-                                              " Tx port %u to %u: %s\n",
-                                              pi, peer_pl[j],
-                                              rte_strerror(-diag));
+                                       fprintf(stderr,
+                                               "Error during binding hairpin Tx port %u to %u: %s\n",
+                                               pi, peer_pl[j],
+                                               rte_strerror(-diag));
                                        return -1;
                                }
                        }
@@ -2678,10 +2791,10 @@ start_port(portid_t pid)
                                        continue;
                                diag = rte_eth_hairpin_bind(peer_pl[j], pi);
                                if (diag < 0) {
-                                       printf("Error during binding hairpin"
-                                              " Tx port %u to %u: %s\n",
-                                              peer_pl[j], pi,
-                                              rte_strerror(-diag));
+                                       fprintf(stderr,
+                                               "Error during binding hairpin Tx port %u to %u: %s\n",
+                                               peer_pl[j], pi,
+                                               rte_strerror(-diag));
                                        return -1;
                                }
                        }
@@ -2711,12 +2824,16 @@ stop_port(portid_t pid)
                        continue;
 
                if (port_is_forwarding(pi) != 0 && test_done == 0) {
-                       printf("Please remove port %d from forwarding configuration.\n", pi);
+                       fprintf(stderr,
+                               "Please remove port %d from forwarding configuration.\n",
+                               pi);
                        continue;
                }
 
                if (port_is_bonding_slave(pi)) {
-                       printf("Please remove port %d from bonded device.\n", pi);
+                       fprintf(stderr,
+                               "Please remove port %d from bonded device.\n",
+                               pi);
                        continue;
                }
 
@@ -2744,13 +2861,14 @@ stop_port(portid_t pid)
                if (port->flow_list)
                        port_flow_flush(pi);
 
-               if (rte_eth_dev_stop(pi) != 0)
+               if (eth_dev_stop_mp(pi) != 0)
                        RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n",
                                pi);
 
                if (rte_atomic16_cmpset(&(port->port_status),
                        RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
-                       printf("Port %d can not be set into stopped\n", pi);
+                       fprintf(stderr, "Port %d can not be set into stopped\n",
+                               pi);
                need_check_link_status = 1;
        }
        if (need_check_link_status && !no_link_check)
@@ -2797,24 +2915,30 @@ close_port(portid_t pid)
                        continue;
 
                if (port_is_forwarding(pi) != 0 && test_done == 0) {
-                       printf("Please remove port %d from forwarding configuration.\n", pi);
+                       fprintf(stderr,
+                               "Please remove port %d from forwarding configuration.\n",
+                               pi);
                        continue;
                }
 
                if (port_is_bonding_slave(pi)) {
-                       printf("Please remove port %d from bonded device.\n", pi);
+                       fprintf(stderr,
+                               "Please remove port %d from bonded device.\n",
+                               pi);
                        continue;
                }
 
                port = &ports[pi];
                if (rte_atomic16_cmpset(&(port->port_status),
                        RTE_PORT_CLOSED, RTE_PORT_CLOSED) == 1) {
-                       printf("Port %d is already closed\n", pi);
+                       fprintf(stderr, "Port %d is already closed\n", pi);
                        continue;
                }
 
-               port_flow_flush(pi);
-               rte_eth_dev_close(pi);
+               if (is_proc_primary()) {
+                       port_flow_flush(pi);
+                       rte_eth_dev_close(pi);
+               }
        }
 
        remove_invalid_ports();
@@ -2833,7 +2957,8 @@ reset_port(portid_t pid)
 
        if ((pid == (portid_t)RTE_PORT_ALL && !all_ports_stopped()) ||
                (pid != (portid_t)RTE_PORT_ALL && !port_is_stopped(pid))) {
-               printf("Can not reset port(s), please stop port(s) first.\n");
+               fprintf(stderr,
+                       "Can not reset port(s), please stop port(s) first.\n");
                return;
        }
 
@@ -2844,14 +2969,16 @@ reset_port(portid_t pid)
                        continue;
 
                if (port_is_forwarding(pi) != 0 && test_done == 0) {
-                       printf("Please remove port %d from forwarding "
-                              "configuration.\n", pi);
+                       fprintf(stderr,
+                               "Please remove port %d from forwarding configuration.\n",
+                               pi);
                        continue;
                }
 
                if (port_is_bonding_slave(pi)) {
-                       printf("Please remove port %d from bonded device.\n",
-                              pi);
+                       fprintf(stderr,
+                               "Please remove port %d from bonded device.\n",
+                               pi);
                        continue;
                }
 
@@ -2861,7 +2988,8 @@ reset_port(portid_t pid)
                        port->need_reconfig = 1;
                        port->need_reconfig_queues = 1;
                } else {
-                       printf("Failed to reset port %d. diag=%d\n", pi, diag);
+                       fprintf(stderr, "Failed to reset port %d. diag=%d\n",
+                               pi, diag);
                }
        }
 
@@ -2877,7 +3005,7 @@ attach_port(char *identifier)
        printf("Attaching a new port...\n");
 
        if (identifier == NULL) {
-               printf("Invalid parameters are specified\n");
+               fprintf(stderr, "Invalid parameters are specified\n");
                return;
        }
 
@@ -2918,7 +3046,8 @@ setup_attached_port(portid_t pi)
        reconfig(pi, socket_id);
        ret = rte_eth_promiscuous_enable(pi);
        if (ret != 0)
-               printf("Error during enabling promiscuous mode for port %u: %s - ignore\n",
+               fprintf(stderr,
+                       "Error during enabling promiscuous mode for port %u: %s - ignore\n",
                        pi, rte_strerror(-ret));
 
        ports_ids[nb_ports++] = pi;
@@ -2937,7 +3066,7 @@ detach_device(struct rte_device *dev)
        portid_t sibling;
 
        if (dev == NULL) {
-               printf("Device already removed\n");
+               fprintf(stderr, "Device already removed\n");
                return;
        }
 
@@ -2946,7 +3075,8 @@ detach_device(struct rte_device *dev)
        RTE_ETH_FOREACH_DEV_OF(sibling, dev) {
                if (ports[sibling].port_status != RTE_PORT_CLOSED) {
                        if (ports[sibling].port_status != RTE_PORT_STOPPED) {
-                               printf("Port %u not stopped\n", sibling);
+                               fprintf(stderr, "Port %u not stopped\n",
+                                       sibling);
                                return;
                        }
                        port_flow_flush(sibling);
@@ -2968,18 +3098,28 @@ detach_device(struct rte_device *dev)
 void
 detach_port_device(portid_t port_id)
 {
+       int ret;
+       struct rte_eth_dev_info dev_info;
+
        if (port_id_is_invalid(port_id, ENABLED_WARN))
                return;
 
        if (ports[port_id].port_status != RTE_PORT_CLOSED) {
                if (ports[port_id].port_status != RTE_PORT_STOPPED) {
-                       printf("Port not stopped\n");
+                       fprintf(stderr, "Port not stopped\n");
                        return;
                }
-               printf("Port was not closed\n");
+               fprintf(stderr, "Port was not closed\n");
        }
 
-       detach_device(rte_eth_devices[port_id].device);
+       ret = eth_dev_info_get_print_err(port_id, &dev_info);
+       if (ret != 0) {
+               TESTPMD_LOG(ERR,
+                       "Failed to get device info for port %d, not detaching\n",
+                       port_id);
+               return;
+       }
+       detach_device(dev_info.device);
 }
 
 void
@@ -2993,14 +3133,15 @@ detach_devargs(char *identifier)
 
        memset(&da, 0, sizeof(da));
        if (rte_devargs_parsef(&da, "%s", identifier)) {
-               printf("cannot parse identifier\n");
+               fprintf(stderr, "cannot parse identifier\n");
                return;
        }
 
        RTE_ETH_FOREACH_MATCHING_DEV(port_id, identifier, &iterator) {
                if (ports[port_id].port_status != RTE_PORT_CLOSED) {
                        if (ports[port_id].port_status != RTE_PORT_STOPPED) {
-                               printf("Port %u not stopped\n", port_id);
+                               fprintf(stderr, "Port %u not stopped\n",
+                                       port_id);
                                rte_eth_iterator_cleanup(&iterator);
                                rte_devargs_reset(&da);
                                return;
@@ -3082,7 +3223,7 @@ pmd_test_exit(void)
        }
        for (i = 0 ; i < RTE_DIM(mempools) ; i++) {
                if (mempools[i])
-                       rte_mempool_free(mempools[i]);
+                       mempool_free_mp(mempools[i]);
        }
 
        printf("\nBye...\n");
@@ -3118,7 +3259,8 @@ check_all_ports_link_status(uint32_t port_mask)
                        if (ret < 0) {
                                all_ports_up = 0;
                                if (print_flag == 1)
-                                       printf("Port %u link get failed: %s\n",
+                                       fprintf(stderr,
+                                               "Port %u link get failed: %s\n",
                                                portid, rte_strerror(-ret));
                                continue;
                        }
@@ -3160,7 +3302,8 @@ rmv_port_callback(void *arg)
        int need_to_start = 0;
        int org_no_link_check = no_link_check;
        portid_t port_id = (intptr_t)arg;
-       struct rte_device *dev;
+       struct rte_eth_dev_info dev_info;
+       int ret;
 
        RTE_ETH_VALID_PORTID_OR_RET(port_id);
 
@@ -3172,11 +3315,16 @@ rmv_port_callback(void *arg)
        stop_port(port_id);
        no_link_check = org_no_link_check;
 
-       /* Save rte_device pointer before closing ethdev port */
-       dev = rte_eth_devices[port_id].device;
-       close_port(port_id);
-       detach_device(dev); /* might be already removed or have more ports */
-
+       ret = eth_dev_info_get_print_err(port_id, &dev_info);
+       if (ret != 0)
+               TESTPMD_LOG(ERR,
+                       "Failed to get device info for port %d, not detaching\n",
+                       port_id);
+       else {
+               struct rte_device *device = dev_info.device;
+               close_port(port_id);
+               detach_device(device); /* might be already removed or have more ports */
+       }
        if (need_to_start)
                start_packet_forwarding(0);
 }
@@ -3190,7 +3338,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,
        RTE_SET_USED(ret_param);
 
        if (type >= RTE_ETH_EVENT_MAX) {
-               fprintf(stderr, "\nPort %" PRIu16 ": %s called upon invalid event %d\n",
+               fprintf(stderr,
+                       "\nPort %" PRIu16 ": %s called upon invalid event %d\n",
                        port_id, __func__, type);
                fflush(stderr);
        } else if (event_print_mask & (UINT32_C(1) << type)) {
@@ -3209,7 +3358,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,
                        break;
                if (rte_eal_alarm_set(100000,
                                rmv_port_callback, (void *)(intptr_t)port_id))
-                       fprintf(stderr, "Could not set up deferred device removal\n");
+                       fprintf(stderr,
+                               "Could not set up deferred device removal\n");
                break;
        case RTE_ETH_EVENT_DESTROY:
                ports[port_id].port_status = RTE_PORT_CLOSED;
@@ -3386,7 +3536,8 @@ update_jumbo_frame_offload(portid_t portid)
                on = false;
        } else {
                if ((port->dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) == 0) {
-                       printf("Frame size (%u) is not supported by port %u\n",
+                       fprintf(stderr,
+                               "Frame size (%u) is not supported by port %u\n",
                                port->dev_conf.rxmode.max_rx_pkt_len,
                                portid);
                        return -1;
@@ -3413,10 +3564,11 @@ update_jumbo_frame_offload(portid_t portid)
         * if unset do it here
         */
        if ((rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) == 0) {
-               ret = rte_eth_dev_set_mtu(portid,
+               ret = eth_dev_set_mtu_mp(portid,
                                port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead);
                if (ret)
-                       printf("Failed to set MTU to %u for port %u\n",
+                       fprintf(stderr,
+                               "Failed to set MTU to %u for port %u\n",
                                port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead,
                                portid);
        }
@@ -3467,13 +3619,9 @@ init_port_config(void)
                rte_pmd_ixgbe_bypass_init(pid);
 #endif
 
-               if (lsc_interrupt &&
-                   (rte_eth_devices[pid].data->dev_flags &
-                    RTE_ETH_DEV_INTR_LSC))
+               if (lsc_interrupt && (*port->dev_info.dev_flags & RTE_ETH_DEV_INTR_LSC))
                        port->dev_conf.intr_conf.lsc = 1;
-               if (rmv_interrupt &&
-                   (rte_eth_devices[pid].data->dev_flags &
-                    RTE_ETH_DEV_INTR_RMV))
+               if (rmv_interrupt && (*port->dev_info.dev_flags & RTE_ETH_DEV_INTR_RMV))
                        port->dev_conf.intr_conf.rmv = 1;
        }
 }
@@ -3497,10 +3645,19 @@ void clear_port_slave_flag(portid_t slave_pid)
 uint8_t port_is_bonding_slave(portid_t slave_pid)
 {
        struct rte_port *port;
+       struct rte_eth_dev_info dev_info;
+       int ret;
 
        port = &ports[slave_pid];
-       if ((rte_eth_devices[slave_pid].data->dev_flags &
-           RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
+       ret = eth_dev_info_get_print_err(slave_pid, &dev_info);
+       if (ret != 0) {
+               TESTPMD_LOG(ERR,
+                       "Failed to get device info for port id %d,"
+                       "cannot determine if the port is a bonded slave",
+                       slave_pid);
+               return 0;
+       }
+       if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
                return 1;
        return 0;
 }
@@ -3603,12 +3760,14 @@ init_port_dcb_config(portid_t pid,
        int retval;
        uint16_t i;
 
+       if (num_procs > 1) {
+               printf("The multi-process feature doesn't support dcb.\n");
+               return -ENOTSUP;
+       }
        rte_port = &ports[pid];
 
-       memset(&port_conf, 0, sizeof(struct rte_eth_conf));
-
-       port_conf.rxmode = rte_port->dev_conf.rxmode;
-       port_conf.txmode = rte_port->dev_conf.txmode;
+       /* retain the original device configuration. */
+       memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
 
        /*set configuration of DCB in vt mode and DCB in non-vt mode*/
        retval = get_eth_dcb_conf(pid, &port_conf, dcb_mode, num_tcs, pfc_en);
@@ -3630,8 +3789,9 @@ init_port_dcb_config(portid_t pid,
         */
        if (dcb_mode == DCB_VT_ENABLED &&
            rte_port->dev_info.vmdq_pool_base > 0) {
-               printf("VMDQ_DCB multi-queue mode is nonsensical"
-                       " for port %d.", pid);
+               fprintf(stderr,
+                       "VMDQ_DCB multi-queue mode is nonsensical for port %d.\n",
+                       pid);
                return -1;
        }
 
@@ -3729,8 +3889,8 @@ static void
 signal_handler(int signum)
 {
        if (signum == SIGINT || signum == SIGTERM) {
-               printf("\nSignal %d received, preparing to exit...\n",
-                               signum);
+               fprintf(stderr, "\nSignal %d received, preparing to exit...\n",
+                       signum);
 #ifdef RTE_LIB_PDUMP
                /* uninitialize packet capture framework */
                rte_pdump_uninit();
@@ -3771,10 +3931,6 @@ main(int argc, char** argv)
                rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
                         rte_strerror(rte_errno));
 
-       if (rte_eal_process_type() == RTE_PROC_SECONDARY)
-               rte_exit(EXIT_FAILURE,
-                        "Secondary process type not supported.\n");
-
        ret = register_eth_event_callback();
        if (ret != 0)
                rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
@@ -3833,18 +3989,19 @@ main(int argc, char** argv)
                                "interactive mode.\n");
 
        if (tx_first && lsc_interrupt) {
-               printf("Warning: lsc_interrupt needs to be off when "
-                               " using tx_first. Disabling.\n");
+               fprintf(stderr,
+                       "Warning: lsc_interrupt needs to be off when using tx_first. Disabling.\n");
                lsc_interrupt = 0;
        }
 
        if (!nb_rxq && !nb_txq)
-               printf("Warning: Either rx or tx queues should be non-zero\n");
+               fprintf(stderr,
+                       "Warning: Either rx or tx queues should be non-zero\n");
 
        if (nb_rxq > 1 && nb_rxq > nb_txq)
-               printf("Warning: nb_rxq=%d enables RSS configuration, "
-                      "but nb_txq=%d will prevent to fully test it.\n",
-                      nb_rxq, nb_txq);
+               fprintf(stderr,
+                       "Warning: nb_rxq=%d enables RSS configuration, but nb_txq=%d will prevent to fully test it.\n",
+                       nb_rxq, nb_txq);
 
        init_config();
 
@@ -3879,7 +4036,8 @@ main(int argc, char** argv)
        RTE_ETH_FOREACH_DEV(port_id) {
                ret = rte_eth_promiscuous_enable(port_id);
                if (ret != 0)
-                       printf("Error during enabling promiscuous mode for port %u: %s - ignore\n",
+                       fprintf(stderr,
+                               "Error during enabling promiscuous mode for port %u: %s - ignore\n",
                                port_id, rte_strerror(-ret));
        }
 
@@ -3890,9 +4048,10 @@ main(int argc, char** argv)
        if (latencystats_enabled != 0) {
                int ret = rte_latencystats_init(1, NULL);
                if (ret)
-                       printf("Warning: latencystats init()"
-                               " returned error %d\n", ret);
-               printf("Latencystats running on lcore %d\n",
+                       fprintf(stderr,
+                               "Warning: latencystats init() returned error %d\n",
+                               ret);
+               fprintf(stderr, "Latencystats running on lcore %d\n",
                        latencystats_lcore_id);
        }
 #endif