| 815 | } |
| 816 | |
| 817 | int |
| 818 | sfc_ev_start(struct sfc_adapter *sa) |
| 819 | { |
| 820 | int rc; |
| 821 | |
| 822 | sfc_log_init(sa, "entry"); |
| 823 | |
| 824 | rc = efx_ev_init(sa->nic); |
| 825 | if (rc != 0) |
| 826 | goto fail_ev_init; |
| 827 | |
| 828 | /* Start management EVQ used for global events */ |
| 829 | |
| 830 | /* |
| 831 | * Management event queue start polls the queue, but it cannot |
| 832 | * interfere with other polling contexts since mgmt_evq_running |
| 833 | * is false yet. |
| 834 | */ |
| 835 | rc = sfc_ev_qstart(sa->mgmt_evq, sa->mgmt_evq_index); |
| 836 | if (rc != 0) |
| 837 | goto fail_mgmt_evq_start; |
| 838 | |
| 839 | rte_spinlock_lock(&sa->mgmt_evq_lock); |
| 840 | sa->mgmt_evq_running = true; |
| 841 | rte_spinlock_unlock(&sa->mgmt_evq_lock); |
| 842 | |
| 843 | if (sa->intr.lsc_intr) { |
| 844 | rc = sfc_ev_qprime(sa->mgmt_evq); |
| 845 | if (rc != 0) |
| 846 | goto fail_mgmt_evq_prime; |
| 847 | } |
| 848 | |
| 849 | /* |
| 850 | * Start management EVQ polling. If interrupts are disabled |
| 851 | * (not used), it is required to process link status change |
| 852 | * and other device level events to avoid unrecoverable |
| 853 | * error because the event queue overflow. |
| 854 | */ |
| 855 | sfc_ev_mgmt_periodic_qpoll_start(sa); |
| 856 | |
| 857 | /* |
| 858 | * Rx/Tx event queues are started/stopped when corresponding |
| 859 | * Rx/Tx queue is started/stopped. |
| 860 | */ |
| 861 | |
| 862 | return 0; |
| 863 | |
| 864 | fail_mgmt_evq_prime: |
| 865 | sfc_ev_qstop(sa->mgmt_evq); |
| 866 | |
| 867 | fail_mgmt_evq_start: |
| 868 | efx_ev_fini(sa->nic); |
| 869 | |
| 870 | fail_ev_init: |
| 871 | sfc_log_init(sa, "failed %d", rc); |
| 872 | return rc; |
| 873 | } |
| 874 |
no test coverage detected