netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Bridge zeros out skb->cb in 5.2 (not in 5.1)
       [not found] <CAB2AaTmtwpHKvuOi6a-54SW1JXUxt1N03Lb=GXMVv_-y+zYyEA@mail.gmail.com>
@ 2019-08-23  9:12 ` Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2019-08-23  9:12 UTC (permalink / raw)
  To: Dan Siemon; +Cc: netdev, bpf

Dan Siemon <dan@coverfire.com> wrote:

[ CCing bpf maling list ]

> Commit f12064d1b402c60c5db9c4b63d5ed6d7facb33f6 zeros out skb->cb in
> br_input.c:
> 
> memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
> 
> https://github.com/torvalds/linux/commit/f12064d1b402c60c5db9c4b63d5ed6d7facb33f6
> 
> Prior to 5.2, it was possible to store information in skb->cb and have it
> pass through the bridge to the output link.

I did not know this was even possible.

Any owner of the skb (bridge, ip stack, etc.) use skb->cb[] as they see fit.

> We leveraged this to have a BPF
> prog that runs on ingress and does custom packet parsing and stores the
> output qdisc:class in skb->cb. This enabled the egress BPF filter to be
> super simple and avoid having to parse the entire packet again.
> 
> Note I haven't built with this patch removed so it's possible this isn't
> the problem but the memset is unconditional...

You're not exactly saying what the problem is, so I have no idea.

> Is this a regression? Is it expected that the bridge would wipe this field
> when just passing frames?

Even if you remove the memset, that commit br_input_skb_cb
has existed, and is used.  Fields were just cleared on-demand rather
than unconditionally at the start.

I think the latter is better practice and also what other owners do.
So please explain what exactly the problem is and/or check that the
cb clearing "is the problem".

If it is, I have no idea how to fix it.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-23  9:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAB2AaTmtwpHKvuOi6a-54SW1JXUxt1N03Lb=GXMVv_-y+zYyEA@mail.gmail.com>
2019-08-23  9:12 ` Bridge zeros out skb->cb in 5.2 (not in 5.1) Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).