| 563 | } |
| 564 | |
| 565 | static int |
| 566 | eh_validate_conf(struct eventmode_conf *em_conf) |
| 567 | { |
| 568 | int ret; |
| 569 | |
| 570 | /* |
| 571 | * Check if event devs are specified. Else probe the event devices |
| 572 | * and initialize the config with all ports & queues available |
| 573 | */ |
| 574 | if (em_conf->nb_eventdev == 0) { |
| 575 | ret = eh_set_nb_eventdev(em_conf); |
| 576 | if (ret != 0) |
| 577 | return ret; |
| 578 | eh_do_capability_check(em_conf); |
| 579 | ret = eh_set_default_conf_eventdev(em_conf); |
| 580 | if (ret != 0) |
| 581 | return ret; |
| 582 | } else { |
| 583 | /* Perform capability check for the selected event devices */ |
| 584 | eh_do_capability_check(em_conf); |
| 585 | } |
| 586 | |
| 587 | /* |
| 588 | * Check if links are specified. Else generate a default config for |
| 589 | * the event ports used. |
| 590 | */ |
| 591 | if (em_conf->nb_link == 0) { |
| 592 | ret = eh_set_default_conf_link(em_conf); |
| 593 | if (ret != 0) |
| 594 | return ret; |
| 595 | } |
| 596 | |
| 597 | /* |
| 598 | * Check if rx adapters are specified. Else generate a default config |
| 599 | * with one rx adapter and all eth queues - event queue mapped. |
| 600 | */ |
| 601 | if (em_conf->nb_rx_adapter == 0) { |
| 602 | ret = eh_set_default_conf_rx_adapter(em_conf); |
| 603 | if (ret != 0) |
| 604 | return ret; |
| 605 | } |
| 606 | |
| 607 | /* |
| 608 | * Check if tx adapters are specified. Else generate a default config |
| 609 | * with one tx adapter. |
| 610 | */ |
| 611 | if (em_conf->nb_tx_adapter == 0) { |
| 612 | ret = eh_set_default_conf_tx_adapter(em_conf); |
| 613 | if (ret != 0) |
| 614 | return ret; |
| 615 | } |
| 616 | |
| 617 | return 0; |
| 618 | } |
| 619 | |
| 620 | static int |
| 621 | eh_initialize_eventdev(struct eventmode_conf *em_conf) |
no test coverage detected