Subject: Re: [PATCH v3 net-next RFC] Generic XDP

From: Johannes Berg <[email-masked]>
Date: Tue, 18 Apr 2017 11:47:59 +0200

On Fri, 2017-04-14 at 12:41 -0700, Alexei Starovoitov wrote:
> 
> ahh. i thought all drivers do at least copy-break (256) bytes 

We do copy-break, but that's only applicable when there's no non-linear 
data left afterwards :)

> or copy
> get_headlen or build_skb the whole thing.
> Since wireless does eth_hlen, then yeah, skb_linearize() is the only
> way.

It's rather difficult to do this in wifi because we'd need to parse
deep into the packet - at a point where we haven't even parsed the
802.11 header (which has variable length) fully.

So that leaves us to do it at the very end, after conversion to
ethernet format, but then it feels pointless since we might as well let
the rest of the stack do it.

> I guess any driver that would care about XDP performance would either
> implement in-driver XDP or make sure that skb_linearize() doesn't
> happen in generic XDP by doing build_skb() with the whole packet.
> The driver can be smart and avoid doing copy-break if generic XDP is
> on.

Indeed. I think this is less about performance than ease of
experimentation.

johannes