net/sfc: implement Rx queue start and stop operations
[dpdk.git] / drivers / net / sfc / sfc.c
index dad8c2b..4245fb8 100644 (file)
@@ -37,6 +37,7 @@
 #include "sfc.h"
 #include "sfc_log.h"
 #include "sfc_ev.h"
+#include "sfc_rx.h"
 
 
 int
@@ -270,10 +271,17 @@ sfc_start(struct sfc_adapter *sa)
        if (rc != 0)
                goto fail_port_start;
 
+       rc = sfc_rx_start(sa);
+       if (rc != 0)
+               goto fail_rx_start;
+
        sa->state = SFC_ADAPTER_STARTED;
        sfc_log_init(sa, "done");
        return 0;
 
+fail_rx_start:
+       sfc_port_stop(sa);
+
 fail_port_start:
        sfc_ev_stop(sa);
 
@@ -312,6 +320,7 @@ sfc_stop(struct sfc_adapter *sa)
 
        sa->state = SFC_ADAPTER_STOPPING;
 
+       sfc_rx_stop(sa);
        sfc_port_stop(sa);
        sfc_ev_stop(sa);
        sfc_intr_stop(sa);
@@ -349,10 +358,17 @@ sfc_configure(struct sfc_adapter *sa)
        if (rc != 0)
                goto fail_port_init;
 
+       rc = sfc_rx_init(sa);
+       if (rc != 0)
+               goto fail_rx_init;
+
        sa->state = SFC_ADAPTER_CONFIGURED;
        sfc_log_init(sa, "done");
        return 0;
 
+fail_rx_init:
+       sfc_port_fini(sa);
+
 fail_port_init:
        sfc_ev_fini(sa);
 
@@ -376,6 +392,7 @@ sfc_close(struct sfc_adapter *sa)
        SFC_ASSERT(sa->state == SFC_ADAPTER_CONFIGURED);
        sa->state = SFC_ADAPTER_CLOSING;
 
+       sfc_rx_fini(sa);
        sfc_port_fini(sa);
        sfc_ev_fini(sa);
        sfc_intr_fini(sa);