aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-01-24 22:56:30 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-26 13:51:00 -0500
commitbb349bb4b19b39830e0486aedfd7c7dca23b7baf (patch)
treebda5193280dc62d5c82ccb0f450409657ed0aaba
parent85b26ea18ee63be83d65ec6db72ad7857980a04b (diff)
be2net: allocate more headroom in incoming skbs
Allocation of 64 bytes in skb headroom is not enough if we have to pull ethernet + ipv6 + tcp headers, and/or extra tunneling header. Its currently not noticed because netdev_alloc_skb_ip_align(64) give us more room, thanks to power-of-two kmalloc() roundups. Make sure we ask for 128 bytes so that side effects of upcoming patches from Ian Campbell dont decrease benet rx performance, because of extra skb head reallocations. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Cc: Vasundhara Volam <vasundhara.volam@emulex.com> Cc: Sathya Perla <sathya.perla@emulex.com> Cc: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h3
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index cbdec2536da6..453d48612f83 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -74,6 +74,9 @@ static inline char *nic_name(struct pci_dev *pdev)
74 74
75/* Number of bytes of an RX frame that are copied to skb->data */ 75/* Number of bytes of an RX frame that are copied to skb->data */
76#define BE_HDR_LEN ((u16) 64) 76#define BE_HDR_LEN ((u16) 64)
77/* allocate extra space to allow tunneling decapsulation without head reallocation */
78#define BE_RX_SKB_ALLOC_SIZE (BE_HDR_LEN + 64)
79
77#define BE_MAX_JUMBO_FRAME_SIZE 9018 80#define BE_MAX_JUMBO_FRAME_SIZE 9018
78#define BE_MIN_MTU 256 81#define BE_MIN_MTU 256
79 82
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index e703d64434f8..0fbf365f5c62 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1189,7 +1189,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
1189 struct net_device *netdev = adapter->netdev; 1189 struct net_device *netdev = adapter->netdev;
1190 struct sk_buff *skb; 1190 struct sk_buff *skb;
1191 1191
1192 skb = netdev_alloc_skb_ip_align(netdev, BE_HDR_LEN); 1192 skb = netdev_alloc_skb_ip_align(netdev, BE_RX_SKB_ALLOC_SIZE);
1193 if (unlikely(!skb)) { 1193 if (unlikely(!skb)) {
1194 rx_stats(rxo)->rx_drops_no_skbs++; 1194 rx_stats(rxo)->rx_drops_no_skbs++;
1195 be_rx_compl_discard(adapter, rxo, rxcp); 1195 be_rx_compl_discard(adapter, rxo, rxcp);