| 138 | } |
| 139 | |
| 140 | static int |
| 141 | testsuite_setup(void) |
| 142 | { |
| 143 | /* Some of the multithreaded tests require 3 other lcores to run */ |
| 144 | unsigned int required_lcore_count = 4; |
| 145 | uint32_t service_id; |
| 146 | |
| 147 | /* To make it easier to map services later if needed, just reset |
| 148 | * service core state. |
| 149 | */ |
| 150 | (void) rte_service_lcore_reset_all(); |
| 151 | |
| 152 | if (!rte_event_dev_count()) { |
| 153 | /* If there is no hardware eventdev, or no software vdev was |
| 154 | * specified on the command line, create an instance of |
| 155 | * event_sw. |
| 156 | */ |
| 157 | LOG_DBG("Failed to find a valid event device... testing with" |
| 158 | " event_sw device\n"); |
| 159 | TEST_ASSERT_SUCCESS(rte_vdev_init("event_sw0", NULL), |
| 160 | "Error creating eventdev"); |
| 161 | evdev = rte_event_dev_get_dev_id("event_sw0"); |
| 162 | } |
| 163 | |
| 164 | if (rte_event_dev_service_id_get(evdev, &service_id) == 0) { |
| 165 | /* A software event device will use a software event timer |
| 166 | * adapter as well. 2 more cores required to convert to |
| 167 | * service cores. |
| 168 | */ |
| 169 | required_lcore_count += 2; |
| 170 | using_services = true; |
| 171 | } |
| 172 | |
| 173 | if (rte_lcore_count() < required_lcore_count) { |
| 174 | printf("Not enough cores for event_timer_adapter_test, expecting at least %u\n", |
| 175 | required_lcore_count); |
| 176 | return TEST_SKIPPED; |
| 177 | } |
| 178 | |
| 179 | /* Assign lcores for various tasks */ |
| 180 | test_lcore1 = rte_get_next_lcore(-1, 1, 0); |
| 181 | test_lcore2 = rte_get_next_lcore(test_lcore1, 1, 0); |
| 182 | test_lcore3 = rte_get_next_lcore(test_lcore2, 1, 0); |
| 183 | if (using_services) { |
| 184 | sw_evdev_slcore = rte_get_next_lcore(test_lcore3, 1, 0); |
| 185 | sw_adptr_slcore = rte_get_next_lcore(sw_evdev_slcore, 1, 0); |
| 186 | } |
| 187 | |
| 188 | return eventdev_setup(); |
| 189 | } |
| 190 | |
| 191 | static void |
| 192 | testsuite_teardown(void) |
nothing calls this directly
no test coverage detected