| 695 | } |
| 696 | |
| 697 | int |
| 698 | sfc_configure(struct sfc_adapter *sa) |
| 699 | { |
| 700 | int rc; |
| 701 | |
| 702 | sfc_log_init(sa, "entry"); |
| 703 | |
| 704 | SFC_ASSERT(sfc_adapter_is_locked(sa)); |
| 705 | |
| 706 | SFC_ASSERT(sa->state == SFC_ETHDEV_INITIALIZED || |
| 707 | sa->state == SFC_ETHDEV_CONFIGURED); |
| 708 | sa->state = SFC_ETHDEV_CONFIGURING; |
| 709 | |
| 710 | rc = sfc_check_conf(sa); |
| 711 | if (rc != 0) |
| 712 | goto fail_check_conf; |
| 713 | |
| 714 | rc = sfc_intr_configure(sa); |
| 715 | if (rc != 0) |
| 716 | goto fail_intr_configure; |
| 717 | |
| 718 | rc = sfc_port_configure(sa); |
| 719 | if (rc != 0) |
| 720 | goto fail_port_configure; |
| 721 | |
| 722 | rc = sfc_rx_configure(sa); |
| 723 | if (rc != 0) |
| 724 | goto fail_rx_configure; |
| 725 | |
| 726 | rc = sfc_tx_configure(sa); |
| 727 | if (rc != 0) |
| 728 | goto fail_tx_configure; |
| 729 | |
| 730 | rc = sfc_sw_xstats_configure(sa); |
| 731 | if (rc != 0) |
| 732 | goto fail_sw_xstats_configure; |
| 733 | |
| 734 | sa->state = SFC_ETHDEV_CONFIGURED; |
| 735 | sfc_log_init(sa, "done"); |
| 736 | return 0; |
| 737 | |
| 738 | fail_sw_xstats_configure: |
| 739 | sfc_tx_close(sa); |
| 740 | |
| 741 | fail_tx_configure: |
| 742 | sfc_rx_close(sa); |
| 743 | |
| 744 | fail_rx_configure: |
| 745 | sfc_port_close(sa); |
| 746 | |
| 747 | fail_port_configure: |
| 748 | sfc_intr_close(sa); |
| 749 | |
| 750 | fail_intr_configure: |
| 751 | fail_check_conf: |
| 752 | sa->state = SFC_ETHDEV_INITIALIZED; |
| 753 | sfc_log_init(sa, "failed %d", rc); |
| 754 | return rc; |
no test coverage detected