From owner-svn-src-all@freebsd.org Sat Jun 4 09:20:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA8CB65367; Sat, 4 Jun 2016 09:20:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C30DF1B1B; Sat, 4 Jun 2016 09:20:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u549KkTD072168; Sat, 4 Jun 2016 09:20:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u549KkAJ072166; Sat, 4 Jun 2016 09:20:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606040920.u549KkAJ072166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 4 Jun 2016 09:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301309 - 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.22 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: Sat, 04 Jun 2016 09:20:48 -0000 Author: arybchik Date: Sat Jun 4 09:20:46 2016 New Revision: 301309 URL: https://svnweb.freebsd.org/changeset/base/301309 Log: sfxge(4): always be ready to receive batched events When the low-latency firmware variant is running, it is reported as not being capable of batching RX events, but it can still do so if the FORCE_EV_MERGING flag is set on an RXQ. Therefore we need to handle batched RX events even if the capability isn't set. If this bug is fixed in the firmware such that the capability is set even when running the low-latency firmware variant, it will almost always be reported so I don't think we lose much by removing the check. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6705 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Sat Jun 4 09:17:45 2016 (r301308) +++ head/sys/dev/sfxge/common/ef10_nic.c Sat Jun 4 09:20:46 2016 (r301309) @@ -1003,8 +1003,11 @@ ef10_get_datapath_caps( encp->enc_rx_batching_enabled = CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; - if (encp->enc_rx_batching_enabled) - encp->enc_rx_batch_max = 16; + /* + * Even if batching isn't reported as supported, we may still get + * batched events. + */ + encp->enc_rx_batch_max = 16; /* Check if the firmware supports disabling scatter on RXQs */ encp->enc_rx_disable_scatter_supported = Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Sat Jun 4 09:17:45 2016 (r301308) +++ head/sys/dev/sfxge/sfxge_ev.c Sat Jun 4 09:20:46 2016 (r301309) @@ -128,8 +128,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u rxq->pending += delta; if (delta != 1) { - if ((!efx_nic_cfg_get(sc->enp)->enc_rx_batching_enabled) || - (delta <= 0) || + if ((delta <= 0) || (delta > efx_nic_cfg_get(sc->enp)->enc_rx_batch_max)) { evq->exception = B_TRUE;