Custom mapping is actually supported for EF10 and EF100 families only.
A driver (e.g. DPDK PMD) may require to customize mapping of EvQ
to interrupts if, for example, extra EvQ are used for house-keeping
in polling or wake up (via another EvQ) mode.
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- uint32_t irq = 0;
uint32_t target_evq = 0;
efx_rc_t rc;
boolean_t low_latency;
/* INIT_EVQ expects function-relative vector number */
if ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) ==
EFX_EVQ_FLAGS_NOTIFY_INTERRUPT) {
- irq = index;
+ /* IRQ number is specified by caller */
} else if (index == EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX) {
/* Use the first interrupt for always interrupting EvQ */
irq = 0;
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep);
LIBEFX_INTERNAL
__in uint32_t flags,
__deref_out efx_evq_t **eepp);
+LIBEFX_API
+extern __checkReturn efx_rc_t
+efx_ev_qcreate_irq(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t ndescs,
+ __in uint32_t id,
+ __in uint32_t us,
+ __in uint32_t flags,
+ __in uint32_t irq,
+ __deref_out efx_evq_t **eepp);
+
LIBEFX_API
extern void
efx_ev_qpost(
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep);
static void
__checkReturn efx_rc_t
-efx_ev_qcreate(
+efx_ev_qcreate_irq(
__in efx_nic_t *enp,
__in unsigned int index,
__in efsys_mem_t *esmp,
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__deref_out efx_evq_t **eepp)
{
const efx_ev_ops_t *eevop = enp->en_eevop;
*eepp = eep;
if ((rc = eevop->eevo_qcreate(enp, index, esmp, ndescs, id, us, flags,
- eep)) != 0)
+ irq, eep)) != 0)
goto fail9;
return (0);
return (rc);
}
+ __checkReturn efx_rc_t
+efx_ev_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t ndescs,
+ __in uint32_t id,
+ __in uint32_t us,
+ __in uint32_t flags,
+ __deref_out efx_evq_t **eepp)
+{
+ uint32_t irq = index;
+
+ return (efx_ev_qcreate_irq(enp, index, esmp, ndescs, id, us, flags,
+ irq, eepp));
+}
+
void
efx_ev_qdestroy(
__in efx_evq_t *eep)
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
EFSYS_ASSERT((flags & EFX_EVQ_FLAGS_EXTENDED_WIDTH) == 0);
+ if (irq != index) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
#if EFSYS_OPT_RX_SCALE
if (enp->en_intr.ei_type == EFX_INTR_LINE &&
index >= EFX_MAXRSS_LEGACY) {
rc = EINVAL;
- goto fail1;
+ goto fail2;
}
#endif
for (size = 0;
break;
if (id + (1 << size) >= encp->enc_buftbl_limit) {
rc = EINVAL;
- goto fail2;
+ goto fail3;
}
/* Set up the handler table */
return (0);
+fail3:
+ EFSYS_PROBE(fail3);
+#if EFSYS_OPT_RX_SCALE
fail2:
EFSYS_PROBE(fail2);
-#if EFSYS_OPT_RX_SCALE
-fail1:
#endif
+fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
void (*eevo_fini)(efx_nic_t *);
efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int,
efsys_mem_t *, size_t, uint32_t,
- uint32_t, uint32_t, efx_evq_t *);
+ uint32_t, uint32_t, uint32_t,
+ efx_evq_t *);
void (*eevo_qdestroy)(efx_evq_t *);
efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int);
void (*eevo_qpost)(efx_evq_t *, uint16_t);
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep)
{
const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);
size_t desc_size;
- uint32_t irq = 0;
uint32_t target_evq = 0;
efx_rc_t rc;
/* INIT_EVQ expects function-relative vector number */
if ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) ==
EFX_EVQ_FLAGS_NOTIFY_INTERRUPT) {
- irq = index;
+ /* IRQ number is specified by caller */
} else if (index == EFX_RHEAD_ALWAYS_INTERRUPTING_EVQ_INDEX) {
/* Use the first interrupt for always interrupting EvQ */
irq = 0;
__in uint32_t id,
__in uint32_t us,
__in uint32_t flags,
+ __in uint32_t irq,
__in efx_evq_t *eep);
LIBEFX_INTERNAL
efx_ev_init;
efx_ev_qcreate;
efx_ev_qcreate_check_init_done;
+ efx_ev_qcreate_irq;
efx_ev_qdestroy;
efx_ev_qmoderate;
efx_ev_qpending;