net/hns3: adjust format of RAS related structures
[dpdk.git] / app / test-eventdev / test_pipeline_common.c
index fa91bf2..b47d767 100644 (file)
@@ -44,7 +44,6 @@ processed_pkts(struct test_pipeline *t)
        uint8_t i;
        uint64_t total = 0;
 
-       rte_smp_rmb();
        for (i = 0; i < t->nb_workers; i++)
                total += t->worker[i].processed_pkts;
 
@@ -60,7 +59,7 @@ pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt,
 
        int port_idx = 0;
        /* launch workers */
-       RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+       RTE_LCORE_FOREACH_WORKER(lcore_id) {
                if (!(opt->wlcores[lcore_id]))
                        continue;
 
@@ -106,11 +105,17 @@ int
 pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
 {
        unsigned int lcores;
-       /*
-        * N worker + 1 master
-        */
+
+       /* N worker + main */
        lcores = 2;
 
+       if (opt->prod_type != EVT_PROD_TYPE_ETH_RX_ADPTR) {
+               evt_err("Invalid producer type '%s' valid producer '%s'",
+                       evt_prod_id_to_name(opt->prod_type),
+                       evt_prod_id_to_name(EVT_PROD_TYPE_ETH_RX_ADPTR));
+               return -1;
+       }
+
        if (!rte_eth_dev_count_avail()) {
                evt_err("test needs minimum 1 ethernet dev");
                return -1;
@@ -122,8 +127,8 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
        }
 
        /* Validate worker lcores */
-       if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
-               evt_err("worker lcores overlaps with master lcore");
+       if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+               evt_err("worker lcores overlaps with main lcore");
                return -1;
        }
        if (evt_has_disabled_lcore(opt->wlcores)) {
@@ -212,6 +217,11 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
                        return ret;
                }
 
+               /* Enable mbuf fast free if PMD has the capability. */
+               if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+                       local_port_conf.txmode.offloads |=
+                               DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
                rx_conf = dev_info.default_rxconf;
                rx_conf.offloads = port_conf.rxmode.offloads;
 
@@ -385,12 +395,16 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt,
                if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) {
                        uint32_t service_id = -1U;
 
-                       rte_event_eth_tx_adapter_service_id_get(consm,
-                                       &service_id);
+                       ret = rte_event_eth_tx_adapter_service_id_get(consm,
+                                                                  &service_id);
+                       if (ret != -ESRCH && ret != 0) {
+                               evt_err("Failed to get Tx adptr service ID");
+                               return ret;
+                       }
                        ret = evt_service_setup(service_id);
                        if (ret) {
                                evt_err("Failed to setup service core"
-                                               " for Tx adapter\n");
+                                               " for Tx adapter");
                                return ret;
                        }
                }