[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200402110619.48f31a63@carbon>
Date: Thu, 2 Apr 2020 11:06:19 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Toshiaki Makita <toshiaki.makita1@...il.com>
Cc: Mao Wenan <maowenan@...wei.com>, davem@...emloft.net,
ast@...nel.org, daniel@...earbox.net, kuba@...nel.org,
hawk@...nel.org, john.fastabend@...il.com, kafai@...com,
songliubraving@...com, yhs@...com, andriin@...com,
jwi@...ux.ibm.com, jianglidong3@...com, edumazet@...gle.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, kernel-janitors@...r.kernel.org,
brouer@...hat.com
Subject: Re: [PATCH net v2] veth: xdp: use head instead of hard_start
On Thu, 2 Apr 2020 09:47:03 +0900
Toshiaki Makita <toshiaki.makita1@...il.com> wrote:
> On 2020/04/02 1:15, Jesper Dangaard Brouer wrote:
> ...
> > [PATCH RFC net-next] veth: adjust hard_start offset on redirect XDP frames
> >
> > When native XDP redirect into a veth device, the frame arrives in the
> > xdp_frame structure. It is then processed in veth_xdp_rcv_one(),
> > which can run a new XDP bpf_prog on the packet. Doing so requires
> > converting xdp_frame to xdp_buff, but the tricky part is that
> > xdp_frame memory area is located in the top (data_hard_start) memory
> > area that xdp_buff will point into.
> >
> > The current code tried to protect the xdp_frame area, by assigning
> > xdp_buff.data_hard_start past this memory. This results in 32 bytes
> > less headroom to expand into via BPF-helper bpf_xdp_adjust_head().
> >
> > This protect step is actually not needed, because BPF-helper
> > bpf_xdp_adjust_head() already reserve this area, and don't allow
> > BPF-prog to expand into it. Thus, it is safe to point data_hard_start
> > directly at xdp_frame memory area.
> >
> > Cc: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
>
> FYI: This mail address is deprecated.
>
> > Fixes: 9fc8d518d9d5 ("veth: Handle xdp_frames in xdp napi ring")
> > Reported-by: Mao Wenan <maowenan@...wei.com>
> > Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
>
> FWIW,
>
> Acked-by: Toshiaki Makita <toshiaki.makita1@...il.com>
Thanks.
I have updated your email and added your ack in my patchset. I will
submit this officially once net-next opens up again[1], as part my
larger patchset for introducing XDP frame_sz.
[1] http://vger.kernel.org/~davem/net-next.html
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists