summaryrefslogtreecommitdiffstats
path: root/sys/dev/sfxge/common/efx_ev.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sfxge/common/efx_ev.c')
-rw-r--r--sys/dev/sfxge/common/efx_ev.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/sfxge/common/efx_ev.c b/sys/dev/sfxge/common/efx_ev.c
index 27ecd41..feed316 100644
--- a/sys/dev/sfxge/common/efx_ev.c
+++ b/sys/dev/sfxge/common/efx_ev.c
@@ -567,6 +567,12 @@ efx_ev_mcdi(
if (enp->en_family != EFX_FAMILY_SIENA)
goto out;
+ EFSYS_ASSERT(eecp->eec_link_change != NULL);
+ EFSYS_ASSERT(eecp->eec_exception != NULL);
+#if EFSYS_OPT_MON_STATS
+ EFSYS_ASSERT(eecp->eec_monitor != NULL);
+#endif
+
EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);
code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE);
@@ -648,7 +654,7 @@ out:
return (should_abort);
}
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
__checkReturn int
efx_ev_qprime(
@@ -844,13 +850,14 @@ efx_ev_qmoderate(
__in unsigned int us)
{
efx_nic_t *enp = eep->ee_enp;
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
unsigned int locked;
efx_dword_t dword;
int rc;
EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
- if (us > enp->en_nic_cfg.enc_evq_moderation_max) {
+ if (us > encp->enc_evq_moderation_max) {
rc = EINVAL;
goto fail1;
}
@@ -869,21 +876,20 @@ efx_ev_qmoderate(
uint32_t timer_val;
/* Calculate the timer value in quanta */
- us -= (us % EFX_EV_TIMER_QUANTUM);
- if (us < EFX_EV_TIMER_QUANTUM)
- us = EFX_EV_TIMER_QUANTUM;
-
- timer_val = us / EFX_EV_TIMER_QUANTUM;
+ timer_val = us * encp->enc_clk_mult / EFX_EV_TIMER_QUANTUM;
/* Moderation value is base 0 so we need to deduct 1 */
+ if (timer_val > 0)
+ timer_val--;
+
if (enp->en_family == EFX_FAMILY_FALCON)
EFX_POPULATE_DWORD_2(dword,
FRF_AB_TC_TIMER_MODE, FFE_AB_TIMER_MODE_INT_HLDOFF,
- FRF_AB_TIMER_VAL, timer_val - 1);
+ FRF_AB_TIMER_VAL, timer_val);
else
EFX_POPULATE_DWORD_2(dword,
FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF,
- FRF_CZ_TC_TIMER_VAL, timer_val - 1);
+ FRF_CZ_TC_TIMER_VAL, timer_val);
}
locked = (eep->ee_index == 0) ? 1 : 0;
@@ -964,7 +970,7 @@ efx_ev_qcreate(
eep->ee_handler[FSE_AZ_EV_CODE_DRV_GEN_EV] = efx_ev_drv_gen;
#if EFSYS_OPT_MCDI
eep->ee_handler[FSE_AZ_EV_CODE_MCDI_EVRESPONSE] = efx_ev_mcdi;
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
/* Set up the new event queue */
if (enp->en_family != EFX_FAMILY_FALCON) {
OpenPOWER on IntegriCloud