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

Function test_interrupt_disable

dpdk/app/test/test_interrupts.c:317–376  ·  view source on GitHub ↗

* Tests for rte_intr_disable(). */

Source from the content-addressed store, hash-verified

315 * Tests for rte_intr_disable().
316 */
317static int
318test_interrupt_disable(void)
319{
320 struct rte_intr_handle *test_intr_handle;
321
322 /* check with null intr_handle */
323 if (rte_intr_disable(NULL) == 0) {
324 printf("unexpectedly disable null intr_handle "
325 "successfully\n");
326 return -1;
327 }
328
329 /* check with invalid intr_handle */
330 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_INVALID];
331 if (rte_intr_disable(test_intr_handle) == 0) {
332 printf("unexpectedly disable invalid intr_handle "
333 "successfully\n");
334 return -1;
335 }
336
337 /* check with valid intr_handle */
338 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID];
339 if (rte_intr_disable(test_intr_handle) == 0) {
340 printf("unexpectedly disable a specific intr_handle "
341 "successfully\n");
342 return -1;
343 }
344
345 /* check with specific valid intr_handle */
346 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_ALARM];
347 if (rte_intr_disable(test_intr_handle) == 0) {
348 printf("unexpectedly disable a specific intr_handle "
349 "successfully\n");
350 return -1;
351 }
352
353 /* check with specific valid intr_handle */
354 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT];
355 if (rte_intr_disable(test_intr_handle) == 0) {
356 printf("unexpectedly disable a specific intr_handle "
357 "successfully\n");
358 return -1;
359 }
360
361 /* check with valid handler and its type */
362 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_CASE1];
363 if (rte_intr_disable(test_intr_handle) < 0) {
364 printf("fail to disable interrupt on a simulated handler\n");
365 return -1;
366 }
367
368 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_UIO];
369 if (rte_intr_disable(test_intr_handle) == 0) {
370 printf("unexpectedly disable a specific intr_handle "
371 "successfully\n");
372 return -1;
373 }
374

Callers 1

test_interruptFunction · 0.85

Calls 2

rte_intr_disableFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected