]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2x: Alloc 4k fragment for each rx ring buffer element
authorGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Wed, 27 May 2015 16:51:43 +0000 (13:51 -0300)
committerDan Duval <dan.duval@oracle.com>
Mon, 19 Oct 2015 21:58:01 +0000 (17:58 -0400)
commit6891fc6a89ef2f0092637b522d521a7f5d6d3e7b
tree9b323f48a7ff8d408b9ae39411ffb72c67a66160
parentb182e0715988b94bdb11db9be119ce18fbf8f21b
bnx2x: Alloc 4k fragment for each rx ring buffer element

Orabug: 22066196

The driver allocates one page for each buffer on the rx ring, which is
too much on architectures like ppc64 and can cause unexpected allocation
failures when the system is under stress.  Now, we keep a memory pool
per queue, and if the architecture's PAGE_SIZE is greater than 4k, we
fragment pages and assign each 4k segment to a ring element, which
reduces the overall memory consumption on such architectures.  This
helps avoiding errors like the example below:

[bnx2x_alloc_rx_sge:435(eth1)]Can't alloc sge
[c00000037ffeb900] [d000000075eddeb4] .bnx2x_alloc_rx_sge+0x44/0x200 [bnx2x]
[c00000037ffeb9b0] [d000000075ee0b34] .bnx2x_fill_frag_skb+0x1ac/0x460 [bnx2x]
[c00000037ffebac0] [d000000075ee11f0] .bnx2x_tpa_stop+0x160/0x2e8 [bnx2x]
[c00000037ffebb90] [d000000075ee1560] .bnx2x_rx_int+0x1e8/0xc30 [bnx2x]
[c00000037ffebcd0] [d000000075ee2084] .bnx2x_poll+0xdc/0x3d8 [bnx2x] (unreliable)

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4cace675d687ebd2d813e90af80ff87ee85202f9)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h