4 * Copyright(c) 2017 Cavium networks. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Cavium networks nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <rte_atomic.h>
34 #include <rte_common.h>
35 #include <rte_cycles.h>
36 #include <rte_debug.h>
38 #include <rte_ethdev.h>
39 #include <rte_eventdev.h>
40 #include <rte_hexdump.h>
42 #include <rte_malloc.h>
43 #include <rte_memcpy.h>
44 #include <rte_launch.h>
45 #include <rte_lcore.h>
46 #include <rte_per_lcore.h>
47 #include <rte_random.h>
51 #define NUM_PACKETS (1 << 18)
52 #define MAX_EVENTS (16 * 1024)
59 const char *eventdev_name = "event_octeontx";
61 evdev = rte_event_dev_get_dev_id(eventdev_name);
63 printf("%d: Eventdev %s not found - creating.\n",
64 __LINE__, eventdev_name);
65 if (rte_eal_vdev_init(eventdev_name, NULL) < 0) {
66 printf("Error creating eventdev %s\n", eventdev_name);
69 evdev = rte_event_dev_get_dev_id(eventdev_name);
71 printf("Error finding newly created eventdev\n");
80 testsuite_teardown(void)
82 rte_event_dev_close(evdev);
86 static struct unit_test_suite eventdev_octeontx_testsuite = {
87 .suite_name = "eventdev octeontx unit test suite",
88 .setup = testsuite_setup,
89 .teardown = testsuite_teardown,
93 test_eventdev_octeontx(void)
95 return unit_test_suite_runner(&eventdev_octeontx_testsuite);
98 REGISTER_TEST_COMMAND(eventdev_octeontx_autotest, test_eventdev_octeontx);