diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-02-12 03:36:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 02:31:08 -0500 |
commit | 0f00846deb9c9eaaeb4668b81496b783a04a241f (patch) | |
tree | 955d77255c54eed324db2c74f9cd9f3d887d3f7b /drivers | |
parent | 8badd27aa0d7c02572fcd1a4a3c6b57d67f40b78 (diff) |
bnx2x: System-page alignment
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bnx2x.h | 7 | ||||
-rw-r--r-- | drivers/net/bnx2x_main.c | 11 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 153cc9564b4c..89a72c86ef8f 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -158,8 +158,6 @@ struct sw_rx_page { | |||
158 | #define SGE_PAGE_SHIFT PAGE_SHIFT | 158 | #define SGE_PAGE_SHIFT PAGE_SHIFT |
159 | #define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr) | 159 | #define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr) |
160 | 160 | ||
161 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | ||
162 | |||
163 | /* SGE ring related macros */ | 161 | /* SGE ring related macros */ |
164 | #define NUM_RX_SGE_PAGES 2 | 162 | #define NUM_RX_SGE_PAGES 2 |
165 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) | 163 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) |
@@ -758,6 +756,11 @@ struct bnx2x { | |||
758 | #define ETH_MAX_PACKET_SIZE 1500 | 756 | #define ETH_MAX_PACKET_SIZE 1500 |
759 | #define ETH_MAX_JUMBO_PACKET_SIZE 9600 | 757 | #define ETH_MAX_JUMBO_PACKET_SIZE 9600 |
760 | 758 | ||
759 | /* Max supported alignment is 256 (8 shift) */ | ||
760 | #define BNX2X_RX_ALIGN_SHIFT ((L1_CACHE_SHIFT < 8) ? \ | ||
761 | L1_CACHE_SHIFT : 8) | ||
762 | #define BNX2X_RX_ALIGN (1 << BNX2X_RX_ALIGN_SHIFT) | ||
763 | |||
761 | struct host_def_status_block *def_status_blk; | 764 | struct host_def_status_block *def_status_blk; |
762 | #define DEF_SB_ID 16 | 765 | #define DEF_SB_ID 16 |
763 | u16 def_c_idx; | 766 | u16 def_c_idx; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index db8506d08fa5..312f652872b4 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -4296,14 +4296,11 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
4296 | u16 ring_prod, cqe_ring_prod; | 4296 | u16 ring_prod, cqe_ring_prod; |
4297 | int i, j; | 4297 | int i, j; |
4298 | 4298 | ||
4299 | bp->rx_buf_size = bp->dev->mtu; | 4299 | bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD + BNX2X_RX_ALIGN; |
4300 | bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD + | 4300 | DP(NETIF_MSG_IFUP, |
4301 | BCM_RX_ETH_PAYLOAD_ALIGN; | 4301 | "mtu %d rx_buf_size %d\n", bp->dev->mtu, bp->rx_buf_size); |
4302 | 4302 | ||
4303 | if (bp->flags & TPA_ENABLE_FLAG) { | 4303 | if (bp->flags & TPA_ENABLE_FLAG) { |
4304 | DP(NETIF_MSG_IFUP, | ||
4305 | "rx_buf_size %d effective_mtu %d\n", | ||
4306 | bp->rx_buf_size, bp->dev->mtu + ETH_OVREHEAD); | ||
4307 | 4304 | ||
4308 | for_each_rx_queue(bp, j) { | 4305 | for_each_rx_queue(bp, j) { |
4309 | struct bnx2x_fastpath *fp = &bp->fp[j]; | 4306 | struct bnx2x_fastpath *fp = &bp->fp[j]; |
@@ -4502,7 +4499,7 @@ static void bnx2x_init_context(struct bnx2x *bp) | |||
4502 | context->ustorm_st_context.common.flags = | 4499 | context->ustorm_st_context.common.flags = |
4503 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; | 4500 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; |
4504 | context->ustorm_st_context.common.mc_alignment_log_size = | 4501 | context->ustorm_st_context.common.mc_alignment_log_size = |
4505 | 6 /*BCM_RX_ETH_PAYLOAD_ALIGN*/; | 4502 | BNX2X_RX_ALIGN_SHIFT; |
4506 | context->ustorm_st_context.common.bd_buff_size = | 4503 | context->ustorm_st_context.common.bd_buff_size = |
4507 | bp->rx_buf_size; | 4504 | bp->rx_buf_size; |
4508 | context->ustorm_st_context.common.bd_page_base_hi = | 4505 | context->ustorm_st_context.common.bd_page_base_hi = |