From: David Miller <davem@davemloft.net>
To: toke@redhat.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
cake@lists.bufferbloat.net, dcaratti@redhat.com,
jiri@resnulli.us, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
mrv@mojatatu.com, brakmo@fb.com, i.ponetaev@ndmsystems.com
Subject: Re: [Cake] [PATCH net v3] sched: consistently handle layer3 header accesses in the presence of VLANs
Date: Fri, 03 Jul 2020 14:35:38 -0700 (PDT) [thread overview]
Message-ID: <20200703.143538.815540028775269364.davem@davemloft.net> (raw)
In-Reply-To: <20200703202643.12919-1-toke@redhat.com>
From: Toke Høiland-Jørgensen <toke@redhat.com>
Date: Fri, 3 Jul 2020 22:26:43 +0200
> There are a couple of places in net/sched/ that check skb->protocol and act
> on the value there. However, in the presence of VLAN tags, the value stored
> in skb->protocol can be inconsistent based on whether VLAN acceleration is
> enabled. The commit quoted in the Fixes tag below fixed the users of
> skb->protocol to use a helper that will always see the VLAN ethertype.
>
> However, most of the callers don't actually handle the VLAN ethertype, but
> expect to find the IP header type in the protocol field. This means that
> things like changing the ECN field, or parsing diffserv values, stops
> working if there's a VLAN tag, or if there are multiple nested VLAN
> tags (QinQ).
>
> To fix this, change the helper to take an argument that indicates whether
> the caller wants to skip the VLAN tags or not. When skipping VLAN tags, we
> make sure to skip all of them, so behaviour is consistent even in QinQ
> mode.
>
> To make the helper usable from the ECN code, move it to if_vlan.h instead
> of pkt_sched.h.
>
> v3:
> - Remove empty lines
> - Move vlan variable definitions inside loop in skb_protocol()
> - Also use skb_protocol() helper in IP{,6}_ECN_decapsulate() and
> bpf_skb_ecn_set_ce()
>
> v2:
> - Use eth_type_vlan() helper in skb_protocol()
> - Also fix code that reads skb->protocol directly
> - Change a couple of 'if/else if' statements to switch constructs to avoid
> calling the helper twice
>
> Reported-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
> Fixes: d8b9605d2697 ("net: sched: fix skb->protocol use in case of accelerated vlan path")
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Looks good, applied and queued up for -stable.
Thanks!
next prev parent reply other threads:[~2020-07-03 21:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 20:26 Toke Høiland-Jørgensen
2020-07-03 21:35 ` David Miller [this message]
2020-07-03 22:17 ` Daniel Borkmann
2020-07-04 11:28 ` Toke Høiland-Jørgensen
2020-07-04 3:24 ` Toshiaki Makita
2020-07-04 11:33 ` Toke Høiland-Jørgensen
2020-07-06 4:24 ` Toshiaki Makita
2020-07-06 10:53 ` Toke Høiland-Jørgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200703.143538.815540028775269364.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bpf@vger.kernel.org \
--cc=brakmo@fb.com \
--cc=cake@lists.bufferbloat.net \
--cc=dcaratti@redhat.com \
--cc=i.ponetaev@ndmsystems.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=mrv@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox