* [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
* Re: [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx
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
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Borkmann @ 2018-06-13 9:06 UTC (permalink / raw)
To: Toshiaki Makita, Jeff Kirsher; +Cc: John Fastabend, intel-wired-lan, netdev
On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
> 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>
Thanks Toshiaki, I sent a complete fix yesterday here:
https://lkml.org/lkml/2018/6/12/843
Cheers,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx
2018-06-13 9:06 ` Daniel Borkmann
@ 2018-06-14 0:25 ` Toshiaki Makita
2018-06-14 9:14 ` [Intel-wired-lan] " Malek, Patryk
0 siblings, 1 reply; 5+ messages in thread
From: Toshiaki Makita @ 2018-06-14 0:25 UTC (permalink / raw)
To: Daniel Borkmann, Jeff Kirsher; +Cc: John Fastabend, intel-wired-lan, netdev
On 2018/06/13 18:06, Daniel Borkmann wrote:
> On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
>> 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>
>
> Thanks Toshiaki, I sent a complete fix yesterday here:
>
> https://lkml.org/lkml/2018/6/12/843
Oh I was not aware of it. Thanks, let's go with your patch.
--
Toshiaki Makita
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx
2018-06-14 0:25 ` Toshiaki Makita
@ 2018-06-14 9:14 ` Malek, Patryk
2018-06-14 9:21 ` Toshiaki Makita
0 siblings, 1 reply; 5+ messages in thread
From: Malek, Patryk @ 2018-06-14 9:14 UTC (permalink / raw)
To: Toshiaki Makita, Daniel Borkmann, Kirsher, Jeffrey T
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
> On 2018/06/13 18:06, Daniel Borkmann wrote:
> > On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
> >> 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
Shouldn't this be fields instead of feilds?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-queue] i40e: Fix incorrect skb reserved size on rx
2018-06-14 9:14 ` [Intel-wired-lan] " Malek, Patryk
@ 2018-06-14 9:21 ` Toshiaki Makita
0 siblings, 0 replies; 5+ messages in thread
From: Toshiaki Makita @ 2018-06-14 9:21 UTC (permalink / raw)
To: Malek, Patryk
Cc: Daniel Borkmann, Kirsher, Jeffrey T,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
On 2018/06/14 18:14, Malek, Patryk wrote:
>> On 2018/06/13 18:06, Daniel Borkmann wrote:
>>> On 06/13/2018 10:08 AM, Toshiaki Makita wrote:
>>>> 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
>
> Shouldn't this be fields instead of feilds?
Thanks, but this is now superseded by Daniel's patch so dropped I think.
http://patchwork.ozlabs.org/patch/928778/
--
Toshiaki Makita
^ permalink raw reply [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).