[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1429724760-10075-3-git-send-email-xiyou.wangcong@gmail.com>
Date: Wed, 22 Apr 2015 10:45:59 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: intel-wired-lan@...ts.osuosl.org,
Cong Wang <xiyou.wangcong@...il.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Subject: [Patch net] ixgbe: pass the correct maxlen for eth_get_headlen()
The second parameter of eth_get_headlen() is the length of
the frame buffer, not the header length of skb.
Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index d3f4b0c..b4abacd 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1707,7 +1707,9 @@ static void ixgbe_pull_tail(struct ixgbe_ring *rx_ring,
* we need the header to contain the greater of either ETH_HLEN or
* 60 bytes if the skb->len is less than 60 for skb_pad.
*/
- pull_len = eth_get_headlen(va, IXGBE_RX_HDR_SIZE);
+ pull_len = eth_get_headlen(va, skb_frag_size(frag));
+ if (unlikely(pull_len > IXGBE_RX_HDR_SIZE))
+ pull_len = IXGBE_RX_HDR_SIZE;
/* align pull length to size of long to optimize memcpy performance */
skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists