svn commit: r316573 - head/sys/dev/cxgbe/iw_cxgbe
Navdeep Parhar
np at FreeBSD.org
Thu Apr 6 14:50:17 UTC 2017
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;
More information about the svn-src-all
mailing list