bnxt_en: Don't use static arrays for completion ring pages
authorMichael Chan <michael.chan@broadcom.com>
Mon, 2 Aug 2021 14:52:38 +0000 (10:52 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Aug 2021 11:38:46 +0000 (12:38 +0100)
commit03c7448790b87cec82a2f1406ff40dd1a8861170
tree84b72007879941e7f4071329dc7fbc3d8dbd415a
parent0547ffe6248cd90361dfa627c4566afb81f06c2b
bnxt_en: Don't use static arrays for completion ring pages

We currently store these page addresses and DMA addreses in static
arrays.  On systems with 4K pages, we support up to 64 pages per
completion ring.  The actual number of pages for each completion ring
may be much less than 64.  For example, when the RX ring size is set
to the default 511 entries, only 16 completion ring pages are needed
per ring.

In the next patch, we'll be doubling the maximum number of completion
pages.  So we convert to allocate these arrays as needed instead of
declaring them statically.

Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h