common/sfc_efx/base: separate target EvQ and IRQ config
[dpdk.git] / drivers / common / sfc_efx / base / ef10_ev.c
index e2b5c62..c0cbc42 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
  */
 
@@ -47,13 +47,6 @@ ef10_ev_drv_gen(
        __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(
@@ -128,12 +121,15 @@ 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;
 
        _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
@@ -164,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;
        }
 
        /*
@@ -192,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;
 
@@ -857,7 +854,11 @@ ef10_ev_drv_gen(
        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,
@@ -1064,6 +1065,10 @@ ef10_ev_mcdi(
        return (should_abort);
 }
 
+#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */
+
+#if EFX_OPTS_EF10()
+
                void
 ef10_ev_rxlabel_init(
        __in            efx_evq_t *eep,