[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2790cb0a-d952-447f-8378-9e4c1ad49fa6@redhat.com>
Date: Mon, 27 Apr 2020 13:51:26 +0800
From: Jason Wang <jasowang@...hat.com>
To: Jesper Dangaard Brouer <brouer@...hat.com>, sameehj@...zon.com
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, zorik@...zon.com,
akiyano@...zon.com, gtzalik@...zon.com,
Toke Høiland-Jørgensen <toke@...hat.com>,
Daniel Borkmann <borkmann@...earbox.net>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
John Fastabend <john.fastabend@...il.com>,
Alexander Duyck <alexander.duyck@...il.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
David Ahern <dsahern@...il.com>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Saeed Mahameed <saeedm@...lanox.com>,
steffen.klassert@...unet.com
Subject: Re: [PATCH net-next 19/33] tun: add XDP frame size
On 2020/4/23 上午12:08, Jesper Dangaard Brouer wrote:
> The tun driver have two code paths for running XDP (bpf_prog_run_xdp).
> In both cases 'buflen' contains enough tailroom for skb_shared_info.
>
> Cc: Jason Wang <jasowang@...hat.com>
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
Acked-by: Jason Wang <jasowang@...hat.com>
> ---
> drivers/net/tun.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 44889eba1dbc..c54f967e2c66 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1671,6 +1671,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
> xdp_set_data_meta_invalid(&xdp);
> xdp.data_end = xdp.data + len;
> xdp.rxq = &tfile->xdp_rxq;
> + xdp.frame_sz = buflen;
>
> act = bpf_prog_run_xdp(xdp_prog, &xdp);
> if (act == XDP_REDIRECT || act == XDP_TX) {
> @@ -2411,6 +2412,7 @@ static int tun_xdp_one(struct tun_struct *tun,
> }
> xdp_set_data_meta_invalid(xdp);
> xdp->rxq = &tfile->xdp_rxq;
> + xdp->frame_sz = buflen;
>
> act = bpf_prog_run_xdp(xdp_prog, xdp);
> err = tun_xdp_act(tun, xdp_prog, xdp, act);
>
>
Powered by blists - more mailing lists