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 B8707A0C46; Fri, 18 Jun 2021 15:41:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D639B41109; Fri, 18 Jun 2021 15:40:46 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 535C6410F8 for ; Fri, 18 Jun 2021 15:40:45 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 1FB5A7F6A7; Fri, 18 Jun 2021 16:40:45 +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 600537F691; Fri, 18 Jun 2021 16:40:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 600537F691 Authentication-Results: shelob.oktetlabs.ru/600537F691; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: dev@dpdk.org Cc: David Marchand , Andy Moreton Date: Fri, 18 Jun 2021 16:40:15 +0300 Message-Id: <20210618134032.1922012-4-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210618134032.1922012-1-andrew.rybchenko@oktetlabs.ru> References: <20210527152510.1551026-1-andrew.rybchenko@oktetlabs.ru> <20210618134032.1922012-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 03/20] common/sfc_efx/base: separate target EvQ and IRQ config 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" Target EvQ and IRQ number are specified in the same location in MCDI request. The value is treated as IRQ number if the event queue is interrupting (corresponding flag is set) and as target event queue otherwise. However it is better to separate it on helper API level to make it more clear. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_ev.c | 12 +++++++----- drivers/common/sfc_efx/base/efx_impl.h | 1 + drivers/common/sfc_efx/base/efx_mcdi.c | 7 ++++++- drivers/common/sfc_efx/base/rhead_ev.c | 12 +++++++----- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_ev.c b/drivers/common/sfc_efx/base/ef10_ev.c index ea59beecc4..c0cbc427b9 100644 --- a/drivers/common/sfc_efx/base/ef10_ev.c +++ b/drivers/common/sfc_efx/base/ef10_ev.c @@ -121,7 +121,8 @@ ef10_ev_qcreate( __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t irq; + uint32_t irq = 0; + uint32_t target_evq = 0; efx_rc_t rc; boolean_t low_latency; @@ -159,11 +160,12 @@ ef10_ev_qcreate( EFX_EVQ_FLAGS_NOTIFY_INTERRUPT) { irq = index; } else if (index == EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX) { - irq = index; + /* Use the first interrupt for always interrupting EvQ */ + irq = 0; flags = (flags & ~EFX_EVQ_FLAGS_NOTIFY_MASK) | EFX_EVQ_FLAGS_NOTIFY_INTERRUPT; } else { - irq = EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX; + target_evq = EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX; } /* @@ -187,8 +189,8 @@ ef10_ev_qcreate( * decision and low_latency hint is ignored. */ low_latency = encp->enc_datapath_cap_evb ? 0 : 1; - rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, us, flags, - low_latency); + rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, target_evq, us, + flags, low_latency); if (rc != 0) goto fail2; diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index 4a513171a1..c1f98def40 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1535,6 +1535,7 @@ efx_mcdi_init_evq( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, + __in uint32_t target_evq, __in uint32_t us, __in uint32_t flags, __in boolean_t low_latency); diff --git a/drivers/common/sfc_efx/base/efx_mcdi.c b/drivers/common/sfc_efx/base/efx_mcdi.c index f226ffd923..b68fc0503d 100644 --- a/drivers/common/sfc_efx/base/efx_mcdi.c +++ b/drivers/common/sfc_efx/base/efx_mcdi.c @@ -2568,6 +2568,7 @@ efx_mcdi_init_evq( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, + __in uint32_t target_evq, __in uint32_t us, __in uint32_t flags, __in boolean_t low_latency) @@ -2602,11 +2603,15 @@ efx_mcdi_init_evq( MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_SIZE, nevs); MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); - MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); interrupting = ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) == EFX_EVQ_FLAGS_NOTIFY_INTERRUPT); + if (interrupting) + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + else + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TARGET_EVQ, target_evq); + if (encp->enc_init_evq_v2_supported) { /* * On Medford the low latency license is required to enable RX diff --git a/drivers/common/sfc_efx/base/rhead_ev.c b/drivers/common/sfc_efx/base/rhead_ev.c index 2099581fd7..533cd9e34a 100644 --- a/drivers/common/sfc_efx/base/rhead_ev.c +++ b/drivers/common/sfc_efx/base/rhead_ev.c @@ -106,7 +106,8 @@ rhead_ev_qcreate( { const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp); size_t desc_size; - uint32_t irq; + uint32_t irq = 0; + uint32_t target_evq = 0; efx_rc_t rc; _NOTE(ARGUNUSED(id)) /* buftbl id managed by MC */ @@ -142,19 +143,20 @@ rhead_ev_qcreate( EFX_EVQ_FLAGS_NOTIFY_INTERRUPT) { irq = index; } else if (index == EFX_RHEAD_ALWAYS_INTERRUPTING_EVQ_INDEX) { - irq = index; + /* Use the first interrupt for always interrupting EvQ */ + irq = 0; flags = (flags & ~EFX_EVQ_FLAGS_NOTIFY_MASK) | EFX_EVQ_FLAGS_NOTIFY_INTERRUPT; } else { - irq = EFX_RHEAD_ALWAYS_INTERRUPTING_EVQ_INDEX; + target_evq = EFX_RHEAD_ALWAYS_INTERRUPTING_EVQ_INDEX; } /* * Interrupts may be raised for events immediately after the queue is * created. See bug58606. */ - rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, us, flags, - B_FALSE); + rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, target_evq, us, + flags, B_FALSE); if (rc != 0) goto fail2; -- 2.30.2