From owner-svn-src-all@FreeBSD.ORG Sun Feb 22 19:13:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 398BE5D9; Sun, 22 Feb 2015 19:13:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23EBE94F; Sun, 22 Feb 2015 19:13:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1MJDsgi007203; Sun, 22 Feb 2015 19:13:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1MJDqJ7007193; Sun, 22 Feb 2015 19:13:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502221913.t1MJDqJ7007193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 22 Feb 2015 19:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279182 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2015 19:13:54 -0000 Author: arybchik Date: Sun Feb 22 19:13:52 2015 New Revision: 279182 URL: https://svnweb.freebsd.org/changeset/base/279182 Log: sfxge: correct event queue interrupt moderation timer quanta Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sun Feb 22 18:59:00 2015 (r279181) +++ head/sys/dev/sfxge/common/efx.h Sun Feb 22 19:13:52 2015 (r279182) @@ -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: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sun Feb 22 18:59:00 2015 (r279181) +++ head/sys/dev/sfxge/common/efx_ev.c Sun Feb 22 19:13:52 2015 (r279182) @@ -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: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sun Feb 22 18:59:00 2015 (r279181) +++ head/sys/dev/sfxge/common/efx_impl.h Sun Feb 22 19:13:52 2015 (r279182) @@ -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: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sun Feb 22 18:59:00 2015 (r279181) +++ head/sys/dev/sfxge/common/siena_nic.c Sun Feb 22 19:13:52 2015 (r279182) @@ -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: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Sun Feb 22 18:59:00 2015 (r279181) +++ head/sys/dev/sfxge/sfxge_ev.c Sun Feb 22 19:13:52 2015 (r279182) @@ -522,7 +522,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; }