diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2008-09-03 17:38:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-03 17:38:00 -0400 |
commit | 437cf2f1c5f05e34510f43e129af29a716b04ce6 (patch) | |
tree | 49db1783b6804fb8bbb61ca9d3a5bb1037dcf30e /drivers/net/bnx2x.h | |
parent | 56e9c0a6eb4918ae010aa4689e4481ab67986a0c (diff) |
bnx2x: Accessing un-mapped page
The allocated RX buffer size was 64 bytes bigger than the PCI mapped
size with no good reason. If the packet was actually using the buffer up
to its limit and if the last 64 bytes of the buffer crossed 4KB boundary
then an unmapped PCI page was accessed. The fix is to use only one
parameter for the buffer size - there is no need to differentiate
between the buffer size and the PCI mapping size since the extra 64
bytes can actually be used by the FW to align the Ethernet payload to
64 bytes.
Also updating the driver version and date
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r-- | drivers/net/bnx2x.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index a14dba1afcc5..fd705d1295a7 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -151,6 +151,8 @@ struct sw_rx_page { | |||
151 | #define PAGES_PER_SGE_SHIFT 0 | 151 | #define PAGES_PER_SGE_SHIFT 0 |
152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) | 152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) |
153 | 153 | ||
154 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | ||
155 | |||
154 | /* SGE ring related macros */ | 156 | /* SGE ring related macros */ |
155 | #define NUM_RX_SGE_PAGES 2 | 157 | #define NUM_RX_SGE_PAGES 2 |
156 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) | 158 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) |
@@ -750,8 +752,7 @@ struct bnx2x { | |||
750 | 752 | ||
751 | u32 rx_csum; | 753 | u32 rx_csum; |
752 | u32 rx_offset; | 754 | u32 rx_offset; |
753 | u32 rx_buf_use_size; /* useable size */ | 755 | u32 rx_buf_size; |
754 | u32 rx_buf_size; /* with alignment */ | ||
755 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ | 756 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ |
756 | #define ETH_MIN_PACKET_SIZE 60 | 757 | #define ETH_MIN_PACKET_SIZE 60 |
757 | #define ETH_MAX_PACKET_SIZE 1500 | 758 | #define ETH_MAX_PACKET_SIZE 1500 |