Date: Wed, 25 Mar 2015 13:11:20 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280588 - in stable/10/sys/dev/sfxge: . common Message-ID: <201503251311.t2PDBKIX066782@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Wed Mar 25 13:11:19 2015 New Revision: 280588 URL: https://svnweb.freebsd.org/changeset/base/280588 Log: MFC: 279182 sfxge: correct event queue interrupt moderation timer quanta Submitted by: Andrew Lee <alee at solarflare.com> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/siena_nic.c stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx.h Wed Mar 25 13:11:19 2015 (r280588) @@ -895,7 +895,8 @@ typedef struct efx_nic_cfg_s { uint32_t enc_txq_limit; uint32_t enc_rxq_limit; uint32_t enc_buftbl_limit; - uint32_t enc_evq_moderation_max; + uint32_t enc_evq_timer_quantum_ns; + uint32_t enc_evq_timer_max_us; uint32_t enc_clk_mult; #if EFSYS_OPT_LOOPBACK uint32_t enc_loopback_types[EFX_LINK_NMODES]; Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Mar 25 13:11:19 2015 (r280588) @@ -857,7 +857,7 @@ efx_ev_qmoderate( EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); - if (us > encp->enc_evq_moderation_max) { + if (us > encp->enc_evq_timer_max_us) { rc = EINVAL; goto fail1; } @@ -876,7 +876,7 @@ efx_ev_qmoderate( uint32_t timer_val; /* Calculate the timer value in quanta */ - timer_val = us * encp->enc_clk_mult / EFX_EV_TIMER_QUANTUM; + timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; /* Moderation value is base 0 so we need to deduct 1 */ if (timer_val > 0) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Wed Mar 25 13:11:19 2015 (r280588) @@ -408,7 +408,8 @@ struct efx_evq_s { #define EFX_EVQ_MAGIC 0x08081997 -#define EFX_EV_TIMER_QUANTUM 5 +#define EFX_EVQ_FALCON_TIMER_QUANTUM_NS 4968 /* 621 cycles */ +#define EFX_EVQ_SIENA_TIMER_QUANTUM_NS 6144 /* 768 cycles */ struct efx_rxq_s { uint32_t er_magic; Modified: stable/10/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/common/siena_nic.c Wed Mar 25 13:11:19 2015 (r280588) @@ -329,8 +329,10 @@ siena_board_cfg( encp->enc_clk_mult = 2; } - encp->enc_evq_moderation_max = EFX_EV_TIMER_QUANTUM << - FRF_AB_TIMER_VAL_WIDTH / encp->enc_clk_mult; + encp->enc_evq_timer_quantum_ns = + EFX_EVQ_SIENA_TIMER_QUANTUM_NS / encp->enc_clk_mult; + encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << + FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; /* Resource limits */ req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS; Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:09:46 2015 (r280587) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Wed Mar 25 13:11:19 2015 (r280588) @@ -517,7 +517,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG * so we have to range-check the value ourselves. */ if (moderation > - efx_nic_cfg_get(sc->enp)->enc_evq_moderation_max) { + efx_nic_cfg_get(sc->enp)->enc_evq_timer_max_us) { error = EINVAL; goto out; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503251311.t2PDBKIX066782>