Author: kp Date: Wed Jun 3 18:09:32 2020 New Revision: 361762 URL: https://svnweb.freebsd.org/changeset/base/361762
Log: MFC r361279: bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two Modified: stable/11/sys/dev/bnxt/bnxt.h stable/11/sys/dev/bnxt/if_bnxt.c Modified: stable/11/sys/dev/bnxt/bnxt.h ============================================================================== --- stable/11/sys/dev/bnxt/bnxt.h Wed Jun 3 18:09:31 2020 (r361761) +++ stable/11/sys/dev/bnxt/bnxt.h Wed Jun 3 18:09:32 2020 (r361762) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #define NETXTREME_E_VF2 0x16d3 #define NETXTREME_E_VF3 0x16dc +/* Maximum numbers of RX and TX descriptors. iflib requires this to be a power + * of two. The hardware has no particular limitation. */ +#define BNXT_MAX_RXD ((INT32_MAX >> 1) + 1) +#define BNXT_MAX_TXD ((INT32_MAX >> 1) + 1) + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) Modified: stable/11/sys/dev/bnxt/if_bnxt.c ============================================================================== --- stable/11/sys/dev/bnxt/if_bnxt.c Wed Jun 3 18:09:31 2020 (r361761) +++ stable/11/sys/dev/bnxt/if_bnxt.c Wed Jun 3 18:09:32 2020 (r361762) @@ -313,11 +313,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {BNXT_MAX_RXD, BNXT_MAX_RXD, BNXT_MAX_RXD}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {BNXT_MAX_TXD, BNXT_MAX_TXD, BNXT_MAX_TXD}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"