[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <107260d3-1fea-b582-84d3-2d092f3112b1@gmail.com>
Date: Fri, 4 Sep 2020 10:30:48 -0600
From: David Ahern <dsahern@...il.com>
To: Jesper Dangaard Brouer <brouer@...hat.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>
Subject: Re: [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame
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.
>
ok, is there any alignment requirement? can frame_sz be number of 32-bit
words? I believe bit shifts are cheap.
Powered by blists - more mailing lists