netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx
@ 2018-06-13  8:08 Toshiaki Makita
  2018-06-13  9:06 ` Daniel Borkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Toshiaki Makita @ 2018-06-13  8:08 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Toshiaki Makita, Daniel Borkmann, John Fastabend, intel-wired-lan,
	netdev

i40e_build_skb() reserves I40E_SKB_PAD + (xdp->data -
xdp->data_hard_start) but obviously I40E_SKB_PAD is unnecessary here
and mac_header/data feilds in skb becomes incorrect, and breaks normal
skb receive path as well as XDP receive path.

Fixes: cc5b114dcf98 ("bpf, i40e: add meta data support")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 8ffb7454e67c..6d59f51f1730 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2124,7 +2124,7 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,
 		return NULL;
 
 	/* update pointers within the skb to store the data */
-	skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start));
+	skb_reserve(skb, xdp->data - xdp->data_hard_start);
 	__skb_put(skb, xdp->data_end - xdp->data);
 	if (metasize)
 		skb_metadata_set(skb, metasize);
-- 
2.14.2

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

end of thread, other threads:[~2018-06-14  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-13  8:08 [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx Toshiaki Makita
2018-06-13  9:06 ` Daniel Borkmann
2018-06-14  0:25   ` Toshiaki Makita
2018-06-14  9:14     ` [Intel-wired-lan] " Malek, Patryk
2018-06-14  9:21       ` Toshiaki Makita

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).