MCPcopy Create free account
hub / github.com/F-Stack/f-stack / testsuite_setup

Function testsuite_setup

dpdk/app/test/test_event_timer_adapter.c:140–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static int
141testsuite_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
191static void
192testsuite_teardown(void)

Callers

nothing calls this directly

Calls 9

rte_event_dev_countFunction · 0.85
rte_vdev_initFunction · 0.85
rte_event_dev_get_dev_idFunction · 0.85
rte_lcore_countFunction · 0.85
rte_get_next_lcoreFunction · 0.85
eventdev_setupFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected