common/sfc_efx: update copyright year
[dpdk.git] / drivers / common / sfc_efx / base / ef10_ev.c
index 18f19e8..ea59bee 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(
@@ -130,9 +123,12 @@ ef10_ev_qcreate(
        efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
        uint32_t irq;
        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
@@ -175,42 +171,29 @@ ef10_ev_qcreate(
         * 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, us, flags,
+           low_latency);
+       if (rc != 0)
+               goto fail2;
 
        return (0);
 
-fail3:
-       EFSYS_PROBE(fail3);
 fail2:
        EFSYS_PROBE(fail2);
 fail1:
@@ -869,7 +852,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,
@@ -1076,6 +1063,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,