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

From: Alexei Starovoitov <[email-masked]>
Date: Mon, 13 Apr 2015 09:13:18 -0700

On 4/13/15 7:28 AM, Jamal Hadi Salim wrote:
> On 04/10/15 18:35, Alexei Starovoitov wrote:
>
>>> To your "bugs" comments:
>>> - updating csum; earlier i said i was conflicted it being a
>>> useful "feature".
>>> You are repeating again that it is a bug. It is not.
>>> This action is intended to  mirror or redirect packets, period.
>>
>> without updating skb->csum act_mirred is breaking csum for
>> checksum_complete devices.
>
> Ok, could this then be checked for in dev features flags and
> only then recomputed?

that's what my v2 patch did :)
if ip_summed == checksum_complete -> recompute skb->csum

> Yes, I see your point here as reasonable dilema. But you could add an
> API call the user always make that resets and unsets the header?
> It would be a single branch failure for egress/stack source.

cannot do that from the program. skb->data and headerlen are already
cached by JITs and skb pointer itself is in some bpf registers,
so push/pull/skb_share_check is _not_ possible when program is running.
It can only be done before program starts. That's exactly what all my
patches are doing.