netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] igb: pass the correct maxlen for eth_get_headlen()
@ 2015-04-22 17:45 Cong Wang
  2015-04-22 17:45 ` [Patch net] fm10k: " Cong Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Cong Wang @ 2015-04-22 17:45 UTC (permalink / raw)
  To: netdev; +Cc: intel-wired-lan, Cong Wang, Jeff Kirsher

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@intel.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a0a9b1f..7b3a370 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6852,7 +6852,9 @@ static void igb_pull_tail(struct igb_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, IGB_RX_HDR_LEN);
+	pull_len = eth_get_headlen(va, skb_frag_size(frag));
+	if (unlikely(pull_len > IGB_RX_HDR_LEN))
+		pull_len = IGB_RX_HDR_LEN;
 
 	/* 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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-04-25  1:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22 17:45 [Patch net] igb: pass the correct maxlen for eth_get_headlen() Cong Wang
2015-04-22 17:45 ` [Patch net] fm10k: " Cong Wang
2015-04-22 17:45 ` [Patch net] ixgbe: " Cong Wang
2015-04-22 17:46 ` [Patch net] ixgbevf: " Cong Wang
2015-04-22 19:43 ` [Patch net] igb: " Alexander Duyck
2015-04-22 20:14   ` Cong Wang
2015-04-22 20:21     ` Alexander Duyck
2015-04-22 20:33       ` Cong Wang
2015-04-22 21:42         ` Alexander Duyck
2015-04-22 21:56           ` Cong Wang
2015-04-22 22:34             ` Alexander Duyck
2015-04-22 23:23               ` Cong Wang
2015-04-23  3:40                 ` Alexander Duyck
2015-04-23 18:06                   ` Cong Wang
2015-04-23 18:40                     ` Alexander Duyck
2015-04-23 19:14                       ` Cong Wang
2015-04-23 19:30                 ` Cong Wang
2015-04-23 19:45                   ` [Intel-wired-lan] " Alexander Duyck
2015-04-23 22:07                     ` Cong Wang
2015-04-25  1:07 ` Jeff Kirsher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).