Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 2017 14:50:16 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316573 - head/sys/dev/cxgbe/iw_cxgbe
Message-ID:  <201704061450.v36EoGj4003762@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Apr  6 14:50:15 2017
New Revision: 316573
URL: https://svnweb.freebsd.org/changeset/base/316573

Log:
  cxgbe/iw_cxgbe: Replace a magic constant with something more readable
  (and accurate).
  
  T4 and later have an extra bit for page shift so the maximum page size
  is 8TB (shift of 12 + 31) instead of 128MB (12 + 15).  This saves space
  in the chip's PBL (physical buffer list) when registering very large
  memory regions.
  
  MFC after:	3 days
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/mem.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c
==============================================================================
--- head/sys/dev/cxgbe/iw_cxgbe/mem.c	Thu Apr  6 14:36:08 2017	(r316572)
+++ head/sys/dev/cxgbe/iw_cxgbe/mem.c	Thu Apr  6 14:50:15 2017	(r316573)
@@ -345,7 +345,8 @@ static int build_phys_page_list(struct i
 	}
 
 	/* Find largest page shift we can use to cover buffers */
-	for (*shift = PAGE_SHIFT; *shift < 27; ++(*shift))
+	for (*shift = PAGE_SHIFT; *shift < PAGE_SHIFT + M_FW_RI_TPTE_PS;
+	    ++(*shift))
 		if ((1ULL << *shift) & mask)
 			break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704061450.v36EoGj4003762>