From owner-svn-src-all@FreeBSD.ORG Sun Jan 5 22:45:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0FE18F2; Sun, 5 Jan 2014 22:45:46 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD0901B1C; Sun, 5 Jan 2014 22:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s05Mjk3C015099; Sun, 5 Jan 2014 22:45:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s05MjkCF015098; Sun, 5 Jan 2014 22:45:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201401052245.s05MjkCF015098@svn.freebsd.org> From: Alexander Motin Date: Sun, 5 Jan 2014 22:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r260345 - stable/10/sys/dev/isp X-SVN-Group: stable-10 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.17 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, 05 Jan 2014 22:45:47 -0000 Author: mav Date: Sun Jan 5 22:45:46 2014 New Revision: 260345 URL: http://svnweb.freebsd.org/changeset/base/260345 Log: MFC r257916: Save one more register read per command by not reading rqstoutrp register every time. The purpose of that register is unlikely output queue overflow detection, so read it only when its last known (and probably stale now) value signals overflow. Modified: stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Sun Jan 5 22:43:40 2014 (r260344) +++ stable/10/sys/dev/isp/isp_library.c Sun Jan 5 22:45:46 2014 (r260345) @@ -322,9 +322,13 @@ isp_destroy_handle(ispsoftc_t *isp, uint void * isp_getrqentry(ispsoftc_t *isp) { - isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); - if (ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)) == isp->isp_reqodx) { - return (NULL); + uint32_t next; + + next = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)); + if (next == isp->isp_reqodx) { + isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp); + if (next == isp->isp_reqodx) + return (NULL); } return (ISP_QUEUE_ENTRY(isp->isp_rquest, isp->isp_reqidx)); }