common/sfc_efx/base: separate target EvQ and IRQ config

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 <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
This commit is contained in:
Andrew Rybchenko 2021-07-02 11:39:31 +03:00 committed by David Marchand
parent 396541fe43
commit 3dee345ab3
4 changed files with 21 additions and 11 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;