diff options
author | Michael Chan <mchan@broadcom.com> | 2006-06-13 22:03:47 (GMT) |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 04:30:49 (GMT) |
commit | c86a31f452f7dd132a1765d6d7160b0947f37b14 (patch) | |
tree | b531650af625d24958bb59b511a1e4157525dc1e /drivers/net/bnx2.h | |
parent | 7a6400cd3dbcfc3bbffcdb6dac4ffc957fb50e19 (diff) | |
download | linux-fsl-qoriq-c86a31f452f7dd132a1765d6d7160b0947f37b14.tar.xz |
[BNX2]: Use CPU native page size
Use CPU native page size to determine various ring sizes. This allows
order-0 memory allocations on all systems.
Added check to limit the page size to 16K since that's the maximum rx
ring size that will be used. This will prevent using unnecessarily
large page sizes on some architectures with large page sizes.
[Suggested by David Miller]
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.h')
-rw-r--r-- | drivers/net/bnx2.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index cc36b75..5845e33 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -3750,7 +3750,12 @@ struct l2_fhdr { #define DMA_READ_CHANS 5 #define DMA_WRITE_CHANS 3 -#define BCM_PAGE_BITS 12 +/* Use CPU native page size up to 16K for the ring sizes. */ +#if (PAGE_SHIFT > 14) +#define BCM_PAGE_BITS 14 +#else +#define BCM_PAGE_BITS PAGE_SHIFT +#endif #define BCM_PAGE_SIZE (1 << BCM_PAGE_BITS) #define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct tx_bd)) @@ -3773,7 +3778,7 @@ struct l2_fhdr { #define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx) -#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> 8) +#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4)) #define RX_IDX(x) ((x) & MAX_RX_DESC_CNT) /* Context size. */ |