Subject: Re: [PATCH v3 net-next 2/2] tc: add 'needs_l2' flag to ingress qdisc

From: Jamal Hadi Salim <[email-masked]>
Date: Thu, 09 Apr 2015 07:02:52 -0400

On 04/09/15 06:49, Jamal Hadi Salim wrote:
> On 04/08/15 23:05, Alexei Starovoitov wrote:
> [..]
>> As I said I'd rather disable them attaching to ingress than force
>> all program authors to always use network_offset.
>> Offset 0 points to L2 was always fundamental assumption of BPF.
>
> The issue is not really the ingress qdisc here - rather the ingress
> qdisc tries to cope with _how things work_.
> The challenge is *some netdevs* (not all) strip off the link
> layer _before_ the ingres qdisc sees them. You have to recognize
> those devices and only speacial case with them. Your assumptions of
> blindly pushing/pulling will break  in some cases (take a look at
> mirred).
>

To be precise look at:
tcf_mirred_init() and how ok_push based on dev->type is decided.
So we do this in the slow path and make a simple compare in the
fast path on whether push the l2 header.

cheers,
jamal