diff options
author | Dhananjay Phadke <dhananjay@qlogic.com> | 2009-09-03 09:10:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 23:01:56 -0400 |
commit | bc75e5bfad2a6d24fc5a9885a2f6b93f82c6c5f1 (patch) | |
tree | 52c4b697f034607cc6cc3b8505a26819cffc572e | |
parent | d4ab88194e982a0d213000a75475d3e76b2626f0 (diff) |
netxen: fix lro buffer allocation
Alloc 12k skbuffs so that firmware can aggregate more
packets into one buffer. This doesn't raise memory
consumption since 9k skbs use 16k slab cache anyway.
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 | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 224a74691312..ede2fa7477ac 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -149,6 +149,7 @@ | |||
149 | #define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) | 149 | #define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) |
150 | #define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) | 150 | #define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) |
151 | #define NX_CT_DEFAULT_RX_BUF_LEN 2048 | 151 | #define NX_CT_DEFAULT_RX_BUF_LEN 2048 |
152 | #define NX_LRO_BUFFER_EXTRA 2048 | ||
152 | 153 | ||
153 | #define NX_RX_LRO_BUFFER_LENGTH (8060) | 154 | #define NX_RX_LRO_BUFFER_LENGTH (8060) |
154 | 155 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 8d4aa6f74bff..04e36f2b1a93 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -265,6 +265,10 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
265 | else | 265 | else |
266 | rds_ring->dma_size = | 266 | rds_ring->dma_size = |
267 | NX_P2_RX_JUMBO_BUF_MAX_LEN; | 267 | NX_P2_RX_JUMBO_BUF_MAX_LEN; |
268 | |||
269 | if (adapter->capabilities & NX_CAP0_HW_LRO) | ||
270 | rds_ring->dma_size += NX_LRO_BUFFER_EXTRA; | ||
271 | |||
268 | rds_ring->skb_size = | 272 | rds_ring->skb_size = |
269 | rds_ring->dma_size + NET_IP_ALIGN; | 273 | rds_ring->dma_size + NET_IP_ALIGN; |
270 | break; | 274 | break; |
@@ -1217,6 +1221,7 @@ netxen_process_rcv(struct netxen_adapter *adapter, | |||
1217 | if (pkt_offset) | 1221 | if (pkt_offset) |
1218 | skb_pull(skb, pkt_offset); | 1222 | skb_pull(skb, pkt_offset); |
1219 | 1223 | ||
1224 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
1220 | skb->protocol = eth_type_trans(skb, netdev); | 1225 | skb->protocol = eth_type_trans(skb, netdev); |
1221 | 1226 | ||
1222 | napi_gro_receive(&sds_ring->napi, skb); | 1227 | napi_gro_receive(&sds_ring->napi, skb); |
@@ -1278,8 +1283,7 @@ netxen_process_lro(struct netxen_adapter *adapter, | |||
1278 | 1283 | ||
1279 | skb_put(skb, lro_length + data_offset); | 1284 | skb_put(skb, lro_length + data_offset); |
1280 | 1285 | ||
1281 | skb->truesize = (skb->len + sizeof(struct sk_buff) + | 1286 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); |
1282 | ((unsigned long)skb->data - (unsigned long)skb->head)); | ||
1283 | 1287 | ||
1284 | skb_pull(skb, l2_hdr_offset); | 1288 | skb_pull(skb, l2_hdr_offset); |
1285 | skb->protocol = eth_type_trans(skb, netdev); | 1289 | skb->protocol = eth_type_trans(skb, netdev); |