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

Function test_table_pipeline

dpdk/app/test/test_table_pipeline.c:505–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505int
506test_table_pipeline(void)
507{
508 /* TEST - All packets dropped */
509 action_handler_hit = NULL;
510 action_handler_miss = NULL;
511 table_entry_default_action = RTE_PIPELINE_ACTION_DROP;
512 setup_pipeline(e_TEST_STUB);
513 if (test_pipeline_single_filter(e_TEST_STUB, 0) < 0)
514 return -1;
515
516 /* TEST - All packets passed through */
517 table_entry_default_action = RTE_PIPELINE_ACTION_PORT;
518 setup_pipeline(e_TEST_STUB);
519 if (test_pipeline_single_filter(e_TEST_STUB, 4) < 0)
520 return -1;
521
522 /* TEST - one packet per port */
523 action_handler_hit = NULL;
524 action_handler_miss = table_action_stub_miss;
525 table_entry_default_action = RTE_PIPELINE_ACTION_PORT;
526 override_miss_mask = 0x01; /* one packet per port */
527 setup_pipeline(e_TEST_STUB);
528 if (test_pipeline_single_filter(e_TEST_STUB, 2) < 0)
529 return -1;
530
531 /* TEST - one packet per port */
532 override_miss_mask = 0x02; /*all per port */
533 setup_pipeline(e_TEST_STUB);
534 if (test_pipeline_single_filter(e_TEST_STUB, 2) < 0)
535 return -1;
536
537 /* TEST - all packets per port */
538 override_miss_mask = 0x03; /*all per port */
539 setup_pipeline(e_TEST_STUB);
540 if (test_pipeline_single_filter(e_TEST_STUB, 4) < 0)
541 return -1;
542
543 /*
544 * This test will set up two tables in the pipeline. the first table
545 * will forward to another table on miss, and the second table will
546 * forward to port.
547 */
548 connect_miss_action_to_table = 1;
549 table_entry_default_action = RTE_PIPELINE_ACTION_TABLE;
550 action_handler_hit = NULL; /* not for stub, hitmask always zero */
551 action_handler_miss = NULL;
552 setup_pipeline(e_TEST_STUB);
553 if (test_pipeline_single_filter(e_TEST_STUB, 4) < 0)
554 return -1;
555 connect_miss_action_to_table = 0;
556
557 printf("TEST - two tables, hitmask override to 0x01\n");
558 connect_miss_action_to_table = 1;
559 action_handler_miss = table_action_stub_miss;
560 override_miss_mask = 0x01;
561 setup_pipeline(e_TEST_STUB);
562 if (test_pipeline_single_filter(e_TEST_STUB, 2) < 0)

Callers 1

test_tableFunction · 0.85

Calls 4

setup_pipelineFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected