net/sfc/base: remove unused defined for WPTR alignment
[dpdk.git] / test / test / test_eventdev_sw.c
index b86b137..3a126ea 100644 (file)
@@ -1,34 +1,5 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2017 Intel Corporation
  */
 
 #include <stdio.h>
@@ -50,6 +21,7 @@
 #include <rte_pause.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
+#include <rte_bus_vdev.h>
 
 #include "test.h"
 
@@ -417,7 +389,7 @@ run_prio_packet_test(struct test *t)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        struct test_event_dev_stats stats;
        err = test_event_dev_stats_get(evdev, &stats);
@@ -509,7 +481,7 @@ test_single_directed_packet(struct test *t)
        }
 
        /* Run schedule() as dir packets may need to be re-ordered */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        struct test_event_dev_stats stats;
        err = test_event_dev_stats_get(evdev, &stats);
@@ -576,7 +548,7 @@ test_directed_forward_credits(struct test *t)
                        printf("%d: error failed to enqueue\n", __LINE__);
                        return -1;
                }
-               rte_service_run_iter_on_app_lcore(t->service_id);
+               rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
                uint32_t deq_pkts;
                deq_pkts = rte_event_dequeue_burst(evdev, 0, &ev, 1, 0);
@@ -738,7 +710,7 @@ burst_packets(struct test *t)
                        return -1;
                }
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* Check stats for all NUM_PKTS arrived to sched core */
        struct test_event_dev_stats stats;
@@ -827,7 +799,7 @@ abuse_inflights(struct test *t)
        }
 
        /* schedule */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        struct test_event_dev_stats stats;
 
@@ -965,7 +937,7 @@ xstats_tests(struct test *t)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* Device names / values */
        int num_stats = rte_event_dev_xstats_names_get(evdev,
@@ -1292,7 +1264,7 @@ port_reconfig_credits(struct test *t)
                        }
                }
 
-               rte_service_run_iter_on_app_lcore(t->service_id);
+               rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
                struct rte_event ev[NPKTS];
                int deq = rte_event_dequeue_burst(evdev, t->port[0], ev,
@@ -1518,7 +1490,7 @@ xstats_id_reset_tests(struct test *t)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        static const char * const dev_names[] = {
                "dev_rx", "dev_tx", "dev_drop", "dev_sched_calls",
@@ -1909,7 +1881,7 @@ qid_priorities(struct test *t)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* dequeue packets, verify priority was upheld */
        struct rte_event ev[32];
@@ -1990,7 +1962,7 @@ load_balancing(struct test *t)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        struct test_event_dev_stats stats;
        err = test_event_dev_stats_get(evdev, &stats);
@@ -2090,7 +2062,7 @@ load_balancing_history(struct test *t)
        }
 
        /* call the scheduler */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* Dequeue the flow 0 packet from port 1, so that we can then drop */
        struct rte_event ev;
@@ -2107,7 +2079,7 @@ load_balancing_history(struct test *t)
        rte_event_enqueue_burst(evdev, t->port[1], &release_ev, 1);
 
        /* call the scheduler */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /*
         * Set up the next set of flows, first a new flow to fill up
@@ -2140,7 +2112,7 @@ load_balancing_history(struct test *t)
        }
 
        /* schedule */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (err) {
@@ -2184,7 +2156,7 @@ load_balancing_history(struct test *t)
                while (rte_event_dequeue_burst(evdev, i, &ev, 1, 0))
                        rte_event_enqueue_burst(evdev, i, &release_ev, 1);
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        cleanup(t);
        return 0;
@@ -2250,7 +2222,7 @@ invalid_qid(struct test *t)
        }
 
        /* call the scheduler */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (err) {
@@ -2335,7 +2307,7 @@ single_packet(struct test *t)
                return -1;
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (err) {
@@ -2378,7 +2350,7 @@ single_packet(struct test *t)
                printf("%d: Failed to enqueue\n", __LINE__);
                return -1;
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (stats.port_inflight[wrk_enq] != 0) {
@@ -2466,7 +2438,7 @@ inflight_counts(struct test *t)
        }
 
        /* schedule */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (err) {
@@ -2522,7 +2494,7 @@ inflight_counts(struct test *t)
         * As the scheduler core decrements inflights, it needs to run to
         * process packets to act on the drop messages
         */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (stats.port_inflight[p1] != 0) {
@@ -2557,7 +2529,7 @@ inflight_counts(struct test *t)
         * As the scheduler core decrements inflights, it needs to run to
         * process packets to act on the drop messages
         */
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        err = test_event_dev_stats_get(evdev, &stats);
        if (stats.port_inflight[p2] != 0) {
@@ -2651,7 +2623,7 @@ parallel_basic(struct test *t, int check_order)
                }
        }
 
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* use extra slot to make logic in loops easier */
        struct rte_event deq_ev[w3_port + 1];
@@ -2678,7 +2650,7 @@ parallel_basic(struct test *t, int check_order)
                        return -1;
                }
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* dequeue from the tx ports, we should get 3 packets */
        deq_pkts = rte_event_dequeue_burst(evdev, t->port[tx_port], deq_ev,
@@ -2756,7 +2728,7 @@ holb(struct test *t) /* test to check we avoid basic head-of-line blocking */
                printf("%d: Error doing first enqueue\n", __LINE__);
                goto err;
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        if (rte_event_dev_xstats_by_name_get(evdev, "port_0_cq_ring_used", NULL)
                        != 1)
@@ -2781,7 +2753,7 @@ holb(struct test *t) /* test to check we avoid basic head-of-line blocking */
                        printf("%d: Error with enqueue\n", __LINE__);
                        goto err;
                }
-               rte_service_run_iter_on_app_lcore(t->service_id);
+               rte_service_run_iter_on_app_lcore(t->service_id, 1);
        } while (rte_event_dev_xstats_by_name_get(evdev,
                                rx_port_free_stat, NULL) != 0);
 
@@ -2791,7 +2763,7 @@ holb(struct test *t) /* test to check we avoid basic head-of-line blocking */
                printf("%d: Error with enqueue\n", __LINE__);
                goto err;
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        /* check that the other port still has an empty CQ */
        if (rte_event_dev_xstats_by_name_get(evdev, other_port_used_stat, NULL)
@@ -2814,7 +2786,7 @@ holb(struct test *t) /* test to check we avoid basic head-of-line blocking */
                printf("%d: Error with enqueue\n", __LINE__);
                goto err;
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
        if (rte_event_dev_xstats_by_name_get(evdev, other_port_used_stat, NULL)
                        != 1) {
@@ -3004,7 +2976,7 @@ worker_loopback(struct test *t)
        while (rte_eal_get_lcore_state(p_lcore) != FINISHED ||
                        rte_eal_get_lcore_state(w_lcore) != FINISHED) {
 
-               rte_service_run_iter_on_app_lcore(t->service_id);
+               rte_service_run_iter_on_app_lcore(t->service_id, 1);
 
                uint64_t new_cycles = rte_get_timer_cycles();
 
@@ -3031,7 +3003,7 @@ worker_loopback(struct test *t)
                        cycles = new_cycles;
                }
        }
-       rte_service_run_iter_on_app_lcore(t->service_id);
+       rte_service_run_iter_on_app_lcore(t->service_id, 1);
        /* ensure all completions are flushed */
 
        rte_eal_mp_wait_lcore();