[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200907200245.0cdb63f1@carbon>
Date: Mon, 7 Sep 2020 20:02:45 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: David Ahern <dsahern@...il.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org, davem@...emloft.net,
lorenzo.bianconi@...hat.com, echaudro@...hat.com,
sameehj@...zon.com, kuba@...nel.org, john.fastabend@...il.com,
daniel@...earbox.net, ast@...nel.org, shayagr@...zon.com,
David Ahern <dsahern@...nel.org>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
brouer@...hat.com
Subject: Re: [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame
On Fri, 4 Sep 2020 10:30:48 -0600
David Ahern <dsahern@...il.com> wrote:
> On 9/4/20 9:59 AM, Jesper Dangaard Brouer wrote:
> >> dev_rx for example seems like it could just be the netdev
> >> index rather than a pointer or perhaps can be removed completely. I
> >> believe it is only used for 1 use case (redirects to CPUMAP); maybe that
> >> code can be refactored to handle the dev outside of xdp_frame.
> >
> > The dev_rx is needed when creating an SKB from a xdp_frame (basically
> > skb->dev = rx_dev). Yes, that is done in cpumap, but I want to
> > generalize this. The veth also creates SKBs from xdp_frame, but use
> > itself as skb->dev.
> >
> > And yes, we could save some space storing the index instead, and trade
> > space for cycles in a lookup.
>
> I think this can be managed without adding a reference to the xdp_frame.
> I'll start a separate thread on that.
>
> >>
> >> As for frame_sz, why does it need to be larger than a u16?
> >
> > Because PAGE_SIZE can be 64KiB on some archs.
> >
I also believe syzbot managed to create packets for generic-XDP with
frame_sz 128KiB, which was a bit weird (it's on my todo list to
investigate and fix).
> ok, is there any alignment requirement? can frame_sz be number of 32-bit
> words? I believe bit shifts are cheap.
No that is not possible, because some drivers and generic-XDP have a
fully dynamic frame_sz.
--
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