svn commit: r260345 - stable/10/sys/dev/isp

Alexander Motin mav at FreeBSD.org
Sun Jan 5 22:45:47 UTC 2014


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));
 }


More information about the svn-src-all mailing list