Subject: Re: __sk_buff.data_end

From: Johannes Berg <[email-masked]>
Date: Thu, 20 Apr 2017 08:06:52 +0200

On Wed, 2017-04-19 at 17:12 -0700, Alexei Starovoitov wrote:
> 
> also didn't we discuss that wifi has crazy non-linear skb?

Not always, depends on the driver.

But also, you have to remember that this filter would be before the
conversion to Ethernet header. Right now, when packets enter the stack,
we always linearize the 802.11 header - or even the whole frame for the
(rare) management packets. We don't do this before monitor mode and
before this filter right now, but there's no super good reason we can't
(it was just so we still report there in case of allocation failures.)

> this data/data_end is used by cls_bpf with headlen only
this data/data_end is used by cls_bpf with headlen only
> for direct packet access where performance matters.

Well performance does matter, though perhaps not as much - the people
I'd think could be the first to use this were adding code way after
doing many function calls, so ... :)

> Since wifi skbs have only eth in headlen, there is not much
> pointing adding support for data/data_end to wifi.
> Just use ld_abs/ld_ind instructions and load_bytes() helper.

You guys just told me not to support the skb access instructions ;-)

But yeah I have the load_bytes helper working. Just thought it might be
nice to get more. But we can also leave that for later.

johannes