]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit8cfb47d17195212ea8d13dc65b009bee07e4a5f2
tree84b72007879941e7f4071329dc7fbc3d8dbd415a
parentacf2d819893569c9300f2725d370e3e1cd3c9f67
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