All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Matthias May <matthias.may@westermo.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
	<yoshfuji@linux-ipv6.org>, <dsahern@kernel.org>,
	<edumazet@google.com>, <pabeni@redhat.com>
Subject: Re: [PATCH net] ip_tunnel: allow to inherit from VLAN encapsulated IP frames
Date: Wed, 6 Jul 2022 13:17:35 -0700	[thread overview]
Message-ID: <20220706131735.4d9f4562@kernel.org> (raw)
In-Reply-To: <e829d8ae-ad2c-9cf5-88e3-0323e9f32d3c@westermo.com>

On Wed, 6 Jul 2022 09:07:36 +0200 Matthias May wrote:
> >> The current code allows to inherit the TOS, TTL, DF from the payload
> >> when skb->protocol is ETH_P_IP or ETH_P_IPV6.
> >> However when the payload is VLAN encapsulated (e.g because the tunnel
> >> is of type GRETAP), then this inheriting does not work, because the
> >> visible skb->protocol is of type ETH_P_8021Q.
> >>
> >> Add a check on ETH_P_8021Q and subsequently check the payload protocol.  
> > 
> > Do we need to check for 8021AD as well?
> 
> Yeah that would make sense.
> I can add the check for ETH_P_8021AD in v2.
> Will have to find some hardware that is AD capable to test.

Why HW, you should be able to test with two Linux endpoints, no?

> >> Signed-off-by: Matthias May <matthias.may@westermo.com>
> >> ---
> >>   net/ipv4/ip_tunnel.c | 21 +++++++++++++--------  
> > 
> > Does ipv6 need the same treatment?  
> 
> I don't think i changed anything regarding the behaviour for ipv6
> by allowing to skip from the outer protocol to the payload protocol.

Sorry, to be clear what I meant - we try to enforce feature parity for
IPv6 these days in Linux. So I was asking if ipv6 needs changes to be
able to deal with VLANs. I think you got that but just in case.

> The previous code already
> * got the TOS via ipv6_get_dsfield,
> * the TTL was derived from the hop_limit,
> * and DF does not exist for ipv6 so it doesn't check for ETH_P_IPV6.

Purely by looking at the code I thought that VLAN-enabled GRETAP frames
would fall into ip6gre_xmit_other() which passes dsfield=0 into
__gre6_xmit(). key->tos only overrides the field for "external" tunnels, 
not normal tunnels with a dedicated netdev per tunnel.

A selftest to check both ipv4 and ipv6 would be the ultimate win there.

  reply	other threads:[~2022-07-06 20:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 14:54 [PATCH net] ip_tunnel: allow to inherit from VLAN encapsulated IP frames Matthias May
2022-07-06  1:25 ` Jakub Kicinski
2022-07-06  7:07   ` Matthias May
2022-07-06 20:17     ` Jakub Kicinski [this message]
2022-07-07 11:57       ` Matthias May
2022-07-07 23:53         ` Jakub Kicinski
2022-07-07 13:59       ` Matthias May
2022-07-08  0:01         ` Jakub Kicinski
2022-07-09 20:09           ` Matthias May
2022-07-11 18:29             ` Jakub Kicinski
2022-07-11 22:06               ` Matthias May
2022-07-12  7:17                 ` Nicolas Dichtel
2022-07-12  7:51                   ` Matthias May
2022-07-12  8:09                     ` Nicolas Dichtel
2022-07-20 15:24                       ` Matthias May
2022-07-20 16:50                         ` Jakub Kicinski
2022-07-21  8:25                           ` Matthias May
2022-07-21  8:05                         ` Nicolas Dichtel

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706131735.4d9f4562@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=matthias.may@westermo.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.