diff --git a/sys/conf/NOTES b/sys/conf/NOTES --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2057,7 +2057,8 @@ # mismatch between the mbuf size assumed by the kernel and the mbuf size # assumed by a module. The only driver that currently has the ability to # detect a mismatch is ti(4). -options MCLSHIFT=11 # mbuf cluster shift in bits, 11 == 2KB +options MCLSHIFT=12 # mbuf cluster shift in bits, 12 == 4 kB + # default is 11 == 2 kB options MSIZE=256 # mbuf size in bytes # diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -107,7 +107,11 @@ CTRL_EQ_QSIZE = 1024, TX_EQ_QSIZE = 1024, +#if MJUMPAGESIZE != MCLBYTES SW_ZONE_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ +#else + SW_ZONE_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ +#endif CL_METADATA_SIZE = CACHE_LINE_SIZE, SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -570,7 +570,9 @@ } if (largest_rx_cluster != MCLBYTES && +#if MJUMPAGESIZE != MCLBYTES largest_rx_cluster != MJUMPAGESIZE && +#endif largest_rx_cluster != MJUM9BYTES && largest_rx_cluster != MJUM16BYTES) { printf("Invalid hw.cxgbe.largest_rx_cluster value (%d)," @@ -579,7 +581,9 @@ } if (safest_rx_cluster != MCLBYTES && +#if MJUMPAGESIZE != MCLBYTES safest_rx_cluster != MJUMPAGESIZE && +#endif safest_rx_cluster != MJUM9BYTES && safest_rx_cluster != MJUM16BYTES) { printf("Invalid hw.cxgbe.safest_rx_cluster value (%d)," @@ -718,7 +722,9 @@ uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); static int sw_buf_sizes[] = { MCLBYTES, +#if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, +#endif MJUM9BYTES, MJUM16BYTES }; @@ -855,7 +861,9 @@ int i, j, n; static int sw_buf_sizes[] = { /* Sorted by size */ MCLBYTES, +#if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, +#endif MJUM9BYTES, MJUM16BYTES }; diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -61,8 +61,8 @@ #include #include -_Static_assert(MJUMPAGESIZE > MCLBYTES, - "Cluster must be smaller than a jumbo page"); +_Static_assert(MCLBYTES <= MJUMPAGESIZE, + "Cluster must not be larger than a jumbo page"); /* * In FreeBSD, Mbufs and Mbuf Clusters are allocated from UMA diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -885,9 +885,11 @@ case MCLBYTES: type = EXT_CLUSTER; break; +#if MJUMPAGESIZE != MCLBYTES case MJUMPAGESIZE: type = EXT_JUMBOP; break; +#endif case MJUM9BYTES: type = EXT_JUMBO9; break; @@ -933,9 +935,11 @@ case MCLBYTES: zone = zone_clust; break; +#if MJUMPAGESIZE != MCLBYTES case MJUMPAGESIZE: zone = zone_jumbop; break; +#endif case MJUM9BYTES: zone = zone_jumbo9; break; @@ -1055,9 +1059,11 @@ case EXT_CLUSTER: size = MCLBYTES; break; +#if MJUMPAGESIZE != MCLBYTES case EXT_JUMBOP: size = MJUMPAGESIZE; break; +#endif case EXT_JUMBO9: size = MJUM9BYTES; break;