]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2net: allocate more headroom in incoming skbs
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 25 Jan 2012 03:56:30 +0000 (03:56 +0000)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 7 May 2012 21:44:14 +0000 (14:44 -0700)
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>
drivers/net/benet/be.h
drivers/net/benet/be_main.c

index d0b74abc012f402dda343f65b9aee7766fdb7673..67299b9b9db489aa3488ab2e4c9cf14e08a0c0eb 100644 (file)
@@ -75,6 +75,9 @@ static inline char *nic_name(struct pci_dev *pdev)
 
 /* Number of bytes of an RX frame that are copied to skb->data */
 #define BE_HDR_LEN             ((u16) 64)
+/* allocate extra space to allow tunneling decapsulation without head reallocation */
+#define BE_RX_SKB_ALLOC_SIZE (BE_HDR_LEN + 64)
+
 #define BE_MAX_JUMBO_FRAME_SIZE        9018
 #define BE_MIN_MTU             256
 
index 48dff7d747d41d12189ce8197332d10bc741b408..f2b6d3e56a8c2a0369c462331f46188165a8aaa2 100644 (file)
@@ -1183,7 +1183,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
        struct net_device *netdev = adapter->netdev;
        struct sk_buff *skb;
 
-       skb = netdev_alloc_skb_ip_align(netdev, BE_HDR_LEN);
+       skb = netdev_alloc_skb_ip_align(netdev, BE_RX_SKB_ALLOC_SIZE);
        if (unlikely(!skb)) {
                rx_stats(rxo)->rx_drops_no_skbs++;
                be_rx_compl_discard(adapter, rxo, rxcp);