From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52BFEA0A0C; Fri, 2 Jul 2021 10:40:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC77841368; Fri, 2 Jul 2021 10:40:39 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 5026D4003E for ; Fri, 2 Jul 2021 10:40:38 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 255977F6BE; Fri, 2 Jul 2021 11:40:38 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id D52CA7F6C0; Fri, 2 Jul 2021 11:40:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru D52CA7F6C0 Authentication-Results: shelob.oktetlabs.ru/D52CA7F6C0; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: dev@dpdk.org Cc: David Marchand , Andy Moreton Date: Fri, 2 Jul 2021 11:39:33 +0300 Message-Id: <20210702083948.546667-6-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210702083948.546667-1-andrew.rybchenko@oktetlabs.ru> References: <20210527152510.1551026-1-andrew.rybchenko@oktetlabs.ru> <20210702083948.546667-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 05/20] net/sfc: explicitly control IRQ used for Rx queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_ev.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index 9a8149f052..71f706e403 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -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; -- 2.30.2