net/sfc: explicitly control IRQ used for Rx queues
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Fri, 2 Jul 2021 08:39:33 +0000 (11:39 +0300)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 20 Jul 2021 10:20:31 +0000 (12:20 +0200)
Interrupts support has assumptions on interrupt numbers used
for LSC and Rx queues. The first interrupt is used for LSC,
subsequent interrupts are used for Rx queues.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/net/sfc/sfc_ev.c

index 9a8149f..71f706e 100644 (file)
@@ -648,6 +648,7 @@ sfc_ev_qstart(struct sfc_evq *evq, unsigned int hw_index)
        struct sfc_adapter *sa = evq->sa;
        efsys_mem_t *esmp;
        uint32_t evq_flags = sa->evq_flags;
+       uint32_t irq = 0;
        unsigned int total_delay_us;
        unsigned int delay_us;
        int rc;
@@ -662,20 +663,35 @@ sfc_ev_qstart(struct sfc_evq *evq, unsigned int hw_index)
        (void)memset((void *)esmp->esm_base, 0xff,
                     efx_evq_size(sa->nic, evq->entries, evq_flags));
 
-       if ((sa->intr.lsc_intr && hw_index == sa->mgmt_evq_index) ||
-           (sa->intr.rxq_intr && evq->dp_rxq != NULL &&
-            sfc_ethdev_rx_qid_by_rxq_sw_index(sfc_sa2shared(sa),
-               evq->dp_rxq->dpq.queue_id) != SFC_ETHDEV_QID_INVALID))
+       if (sa->intr.lsc_intr && hw_index == sa->mgmt_evq_index) {
                evq_flags |= EFX_EVQ_FLAGS_NOTIFY_INTERRUPT;
-       else
+               irq = 0;
+       } else if (sa->intr.rxq_intr && evq->dp_rxq != NULL) {
+               sfc_ethdev_qid_t ethdev_qid;
+
+               ethdev_qid =
+                       sfc_ethdev_rx_qid_by_rxq_sw_index(sfc_sa2shared(sa),
+                               evq->dp_rxq->dpq.queue_id);
+               if (ethdev_qid != SFC_ETHDEV_QID_INVALID) {
+                       evq_flags |= EFX_EVQ_FLAGS_NOTIFY_INTERRUPT;
+                       /*
+                        * The first interrupt is used for management EvQ
+                        * (LSC etc). RxQ interrupts follow it.
+                        */
+                       irq = 1 + ethdev_qid;
+               } else {
+                       evq_flags |= EFX_EVQ_FLAGS_NOTIFY_DISABLED;
+               }
+       } else {
                evq_flags |= EFX_EVQ_FLAGS_NOTIFY_DISABLED;
+       }
 
        evq->init_state = SFC_EVQ_STARTING;
 
        /* Create the common code event queue */
-       rc = efx_ev_qcreate(sa->nic, hw_index, esmp, evq->entries,
-                           0 /* unused on EF10 */, 0, evq_flags,
-                           &evq->common);
+       rc = efx_ev_qcreate_irq(sa->nic, hw_index, esmp, evq->entries,
+                               0 /* unused on EF10 */, 0, evq_flags,
+                               irq, &evq->common);
        if (rc != 0)
                goto fail_ev_qcreate;