summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-08-03 07:28:54 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-21 15:17:57 -0300
commit5d7057db969c65be347887d98320f74442d9aeff (patch)
treec92230149e79192080d1c2271e4adce2dab2bb44
parent8e45467a03c7dedb096e314450d0d5579f7df936 (diff)
downloadFreeBSD-src-5d7057db969c65be347887d98320f74442d9aeff.zip
FreeBSD-src-5d7057db969c65be347887d98320f74442d9aeff.tar.gz
MFC r321625:
Make the number of children for pctrie node available outside subr_pctrie.c. (cherry picked from commit e2e84a25a976cfd8cb2558e17386d2fa77887aca)
-rw-r--r--sys/kern/subr_pctrie.c12
-rw-r--r--sys/sys/pctrie.h13
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
index b538f5d..e92d26c 100644
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$");
#include <ddb/ddb.h>
#endif
-/*
- * These widths should allow the pointers to a node's children to fit within
- * a single cache line. The extra levels from a narrow width should not be
- * a problem thanks to path compression.
- */
-#ifdef __LP64__
-#define PCTRIE_WIDTH 4
-#else
-#define PCTRIE_WIDTH 3
-#endif
-
-#define PCTRIE_COUNT (1 << PCTRIE_WIDTH)
#define PCTRIE_MASK (PCTRIE_COUNT - 1)
#define PCTRIE_LIMIT (howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1)
diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h
index 56c1b8c..1fd0b34 100644
--- a/sys/sys/pctrie.h
+++ b/sys/sys/pctrie.h
@@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree)
return (ptree->pt_root == 0);
}
+/*
+ * These widths should allow the pointers to a node's children to fit within
+ * a single cache line. The extra levels from a narrow width should not be
+ * a problem thanks to path compression.
+ */
+#ifdef __LP64__
+#define PCTRIE_WIDTH 4
+#else
+#define PCTRIE_WIDTH 3
+#endif
+
+#define PCTRIE_COUNT (1 << PCTRIE_WIDTH)
+
#endif /* _KERNEL */
#endif /* !_SYS_PCTRIE_H_ */
OpenPOWER on IntegriCloud