diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-07-26 16:07:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-27 14:15:30 -0400 |
commit | 9b08beba2d1bf7e4598deba2800a9ea5e5c3a282 (patch) | |
tree | 9074bf9ee63c967e24820a1800bcd9f8b590e5b9 | |
parent | f17443f4b01659a5c44d5fc6f5c502c39c293959 (diff) |
netxen: fix skb alloc size for legacy firmware
Request 1532 bytes skb data size for NX3031. NX2031 firmware
needs 1760 sized buffers.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 11 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 13 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index b58d0b217424..e7702f603346 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -143,18 +143,13 @@ | |||
143 | #define NX_ETHERMTU 1500 | 143 | #define NX_ETHERMTU 1500 |
144 | #define NX_MAX_ETHERHDR 32 /* This contains some padding */ | 144 | #define NX_MAX_ETHERHDR 32 /* This contains some padding */ |
145 | 145 | ||
146 | #define NX_RX_NORMAL_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU) | 146 | #define NX_P2_RX_BUF_MAX_LEN 1760 |
147 | #define NX_P3_RX_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU) | ||
147 | #define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) | 148 | #define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) |
148 | #define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) | 149 | #define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) |
149 | #define NX_CT_DEFAULT_RX_BUF_LEN 2048 | 150 | #define NX_CT_DEFAULT_RX_BUF_LEN 2048 |
150 | 151 | ||
151 | #define MAX_RX_BUFFER_LENGTH 1760 | 152 | #define NX_RX_LRO_BUFFER_LENGTH (8060) |
152 | #define MAX_RX_JUMBO_BUFFER_LENGTH 8062 | ||
153 | #define MAX_RX_LRO_BUFFER_LENGTH (8062) | ||
154 | #define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2) | ||
155 | #define RX_JUMBO_DMA_MAP_LEN \ | ||
156 | (MAX_RX_JUMBO_BUFFER_LENGTH - 2) | ||
157 | #define RX_LRO_DMA_MAP_LEN (MAX_RX_LRO_BUFFER_LENGTH - 2) | ||
158 | 153 | ||
159 | /* | 154 | /* |
160 | * Maximum number of ring contexts | 155 | * Maximum number of ring contexts |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index ef7f1b1b8454..a6b244a9f4a1 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -247,9 +247,14 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
247 | rds_ring->skb_size = | 247 | rds_ring->skb_size = |
248 | NX_CT_DEFAULT_RX_BUF_LEN; | 248 | NX_CT_DEFAULT_RX_BUF_LEN; |
249 | } else { | 249 | } else { |
250 | rds_ring->dma_size = RX_DMA_MAP_LEN; | 250 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
251 | rds_ring->dma_size = | ||
252 | NX_P3_RX_BUF_MAX_LEN; | ||
253 | else | ||
254 | rds_ring->dma_size = | ||
255 | NX_P2_RX_BUF_MAX_LEN; | ||
251 | rds_ring->skb_size = | 256 | rds_ring->skb_size = |
252 | MAX_RX_BUFFER_LENGTH; | 257 | rds_ring->dma_size + NET_IP_ALIGN; |
253 | } | 258 | } |
254 | break; | 259 | break; |
255 | 260 | ||
@@ -267,8 +272,8 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
267 | 272 | ||
268 | case RCV_RING_LRO: | 273 | case RCV_RING_LRO: |
269 | rds_ring->num_desc = adapter->num_lro_rxd; | 274 | rds_ring->num_desc = adapter->num_lro_rxd; |
270 | rds_ring->dma_size = RX_LRO_DMA_MAP_LEN; | 275 | rds_ring->dma_size = NX_RX_LRO_BUFFER_LENGTH; |
271 | rds_ring->skb_size = MAX_RX_LRO_BUFFER_LENGTH; | 276 | rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN; |
272 | break; | 277 | break; |
273 | 278 | ||
274 | } | 279 | } |