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

Function test_interrupt

dpdk/app/test/test_interrupts.c:426–595  ·  view source on GitHub ↗

* Main function of testing interrupt. */

Source from the content-addressed store, hash-verified

424 * Main function of testing interrupt.
425 */
426static int
427test_interrupt(void)
428{
429 int ret = -1;
430 struct rte_intr_handle *test_intr_handle;
431
432 if (RTE_EXEC_ENV_IS_WINDOWS)
433 return TEST_SKIPPED;
434
435 if (test_interrupt_init() < 0) {
436 printf("fail to initialize for testing interrupt\n");
437 goto out;
438 }
439
440 printf("Check unknown valid interrupt full path\n");
441 if (test_interrupt_full_path_check(TEST_INTERRUPT_HANDLE_VALID) < 0) {
442 printf("failure occurred during checking unknown valid "
443 "interrupt full path\n");
444 goto out;
445 }
446
447 printf("Check valid UIO interrupt full path\n");
448 if (test_interrupt_full_path_check(TEST_INTERRUPT_HANDLE_VALID_UIO)
449 < 0) {
450 printf("failure occurred during checking valid UIO interrupt "
451 "full path\n");
452 goto out;
453 }
454
455 printf("Check valid device event interrupt full path\n");
456 if (test_interrupt_full_path_check(
457 TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT) < 0) {
458 printf("failure occurred during checking valid device event "
459 "interrupt full path\n");
460 goto out;
461 }
462
463 printf("Check valid alarm interrupt full path\n");
464 if (test_interrupt_full_path_check(
465 TEST_INTERRUPT_HANDLE_VALID_ALARM) < 0) {
466 printf("failure occurred during checking valid alarm "
467 "interrupt full path\n");
468 goto out;
469 }
470
471 printf("start register/unregister test\n");
472 /* check if it will fail to register cb with intr_handle = NULL */
473 if (rte_intr_callback_register(NULL, test_interrupt_callback,
474 NULL) == 0) {
475 printf("unexpectedly register successfully with null "
476 "intr_handle\n");
477 goto out;
478 }
479
480 /* check if it will fail to register cb with invalid intr_handle */
481 test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_INVALID];
482 if (rte_intr_callback_register(test_intr_handle,
483 test_interrupt_callback, test_intr_handle) == 0) {

Callers

nothing calls this directly

Calls 9

test_interrupt_initFunction · 0.85
rte_delay_msFunction · 0.85
test_interrupt_enableFunction · 0.85
test_interrupt_disableFunction · 0.85
test_interrupt_deinitFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected