X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fsfc_efx%2Fbase%2Fef10_ev.c;h=ba078940b63741f7f6b271b77a81e9b1a8930549;hb=c4f4a0e60dcb2a3877a4a751d7641fa1d9c46c29;hp=08729cf71ec6addaa1603c9e4c3848b39dc7fd86;hpb=8527058133ab08391490c4cd447cf9fa900df66b;p=dpdk.git diff --git a/drivers/common/sfc_efx/base/ef10_ev.c b/drivers/common/sfc_efx/base/ef10_ev.c index 08729cf71e..ba078940b6 100644 --- a/drivers/common/sfc_efx/base/ef10_ev.c +++ b/drivers/common/sfc_efx/base/ef10_ev.c @@ -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( @@ -125,23 +118,17 @@ ef10_ev_qcreate( __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 */ - if (index >= encp->enc_evq_limit) { - rc = EINVAL; - goto fail1; - } - - if (us > encp->enc_evq_timer_max_us) { - rc = EINVAL; - goto fail2; - } + EFSYS_ASSERT((flags & EFX_EVQ_FLAGS_EXTENDED_WIDTH) == 0); /* * NO_CONT_EV mode is only requested from the firmware when creating @@ -156,7 +143,7 @@ ef10_ev_qcreate( if (flags & EFX_EVQ_FLAGS_NO_CONT_EV) { if (enp->en_nic_cfg.enc_no_cont_ev_mode_supported == B_FALSE) { rc = EINVAL; - goto fail3; + goto fail1; } } @@ -171,13 +158,14 @@ ef10_ev_qcreate( /* 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; } /* @@ -185,46 +173,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 fail4; - } 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 fail5; - } + /* + * 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); -fail5: - EFSYS_PROBE(fail5); -fail4: - EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: @@ -883,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, @@ -1090,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,