/* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
* Copyright(c) 2012-2019 Solarflare Communications Inc.
*/
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
-static __checkReturn boolean_t
-ef10_ev_mcdi(
- __in efx_evq_t *eep,
- __in efx_qword_t *eqp,
- __in const efx_ev_callbacks_t *eecp,
- __in_opt void *arg);
-
static __checkReturn efx_rc_t
efx_mcdi_set_evq_tmr(
__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;
+ uint32_t target_evq = 0;
efx_rc_t rc;
+ boolean_t low_latency;
_NOTE(ARGUNUSED(id)) /* buftbl id managed by MC */
+ EFSYS_ASSERT((flags & EFX_EVQ_FLAGS_EXTENDED_WIDTH) == 0);
+
/*
* NO_CONT_EV mode is only requested from the firmware when creating
* receive queues, but here it needs to be specified at event queue
/* 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) {
- 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;
}
/*
* created. See bug58606.
*/
- if (encp->enc_init_evq_v2_supported) {
- /*
- * On Medford the low latency license is required to enable RX
- * and event cut through and to disable RX batching. If event
- * queue type in flags is auto, we let the firmware decide the
- * settings to use. If the adapter has a low latency license,
- * it will choose the best settings for low latency, otherwise
- * it will choose the best settings for throughput.
- */
- rc = efx_mcdi_init_evq_v2(enp, index, esmp, ndescs, irq, us,
- flags);
- if (rc != 0)
- goto fail2;
- } else {
- /*
- * On Huntington we need to specify the settings to use.
- * If event queue type in flags is auto, we favour throughput
- * if the adapter is running virtualization supporting firmware
- * (i.e. the full featured firmware variant)
- * and latency otherwise. The Ethernet Virtual Bridging
- * capability is used to make this decision. (Note though that
- * the low latency firmware variant is also best for
- * throughput and corresponding type should be specified
- * to choose it.)
- */
- boolean_t low_latency = encp->enc_datapath_cap_evb ? 0 : 1;
- rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, us, flags,
- low_latency);
- if (rc != 0)
- goto fail3;
- }
+ /*
+ * On Huntington we need to specify the settings to use.
+ * If event queue type in flags is auto, we favour throughput
+ * if the adapter is running virtualization supporting firmware
+ * (i.e. the full featured firmware variant)
+ * and latency otherwise. The Ethernet Virtual Bridging
+ * capability is used to make this decision. (Note though that
+ * the low latency firmware variant is also best for
+ * throughput and corresponding type should be specified
+ * to choose it.)
+ *
+ * If FW supports EvQ types (e.g. on Medford and Medford2) the
+ * type which is specified in flags is passed to FW to make the
+ * 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, target_evq, us,
+ flags, low_latency);
+ if (rc != 0)
+ goto fail2;
return (0);
-fail3:
- EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
return (should_abort);
}
-static __checkReturn boolean_t
+#endif /* EFX_OPTS_EF10() */
+
+#if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()
+
+ __checkReturn boolean_t
ef10_ev_mcdi(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
return (should_abort);
}
+#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */
+
+#if EFX_OPTS_EF10()
+
void
ef10_ev_rxlabel_init(
__in efx_evq_t *eep,