Date: Mon, 5 Oct 2020 19:45:11 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366463 - stable/12/sys/dev/cxgbe Message-ID: <202010051945.095JjBTh055526@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Mon Oct 5 19:45:11 2020 New Revision: 366463 URL: https://svnweb.freebsd.org/changeset/base/366463 Log: MFC r366354: cxgbe(4): validate largest_rx_cluster and safest_rx_cluster. These tunables can only be set to a valid cluster size (2K, 4K, 9K, or 16K) as documented in the man page. Anything else could lead to a panic on interface up. Reported by: mav@ Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Mon Oct 5 19:38:51 2020 (r366462) +++ stable/12/sys/dev/cxgbe/t4_sge.c Mon Oct 5 19:45:11 2020 (r366463) @@ -538,6 +538,28 @@ t4_sge_modload(void) tscale = 1; } + 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)," + " using %d instead.\n", largest_rx_cluster, MJUM16BYTES); + largest_rx_cluster = MJUM16BYTES; + } + + 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)," + " using %d instead.\n", safest_rx_cluster, MJUMPAGESIZE); + safest_rx_cluster = MJUMPAGESIZE; + } + extfree_refs = counter_u64_alloc(M_WAITOK); extfree_rels = counter_u64_alloc(M_WAITOK); pullups = counter_u64_alloc(M_WAITOK);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010051945.095JjBTh055526>