From: Jiri Benc <jbenc@redhat.com>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: pravin shelar <pshelar@ovn.org>,
Simon Horman <simon.horman@netronome.com>,
Pravin B Shelar <pshelar@nicira.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
buytenh@wantstofly.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
rshearma@brocade.com, tom@herbertland.com,
Thomas Graf <tgraf@suug.ch>,
olivier.dugeon@orange.com,
Alexander Duyck <alexander.duyck@gmail.com>,
roopa@cumulusnetworks.com
Subject: Re: [PATCH net-next 2/3] net: mpls: Fixups for GSO
Date: Mon, 26 Sep 2016 17:56:22 +0200 [thread overview]
Message-ID: <20160926175622.3b00d478@griffin> (raw)
In-Reply-To: <586321df-72c6-0dee-4ce6-22ca2a0860fb@cumulusnetworks.com>
On Wed, 24 Aug 2016 10:37:51 -0600, David Ahern wrote:
> Something like this should be able to handle multiple labels. The
> inner network header is set once and the outer one pointing to MPLS
> is adjusted each time a label is pushed:
>
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index 1ecbd7715f6d..0f37b17e3a73 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -162,10 +162,16 @@ static int push_mpls(struct sk_buff *skb,
> struct sw_flow_key *key, if (skb_cow_head(skb, MPLS_HLEN) < 0)
> return -ENOMEM;
>
> + if (!skb->inner_protocol) {
> + skb_set_inner_network_header(skb, skb->mac_len);
> + skb_set_inner_protocol(skb, skb->protocol);
> + }
> +
> skb_push(skb, MPLS_HLEN);
> memmove(skb_mac_header(skb) - MPLS_HLEN, skb_mac_header(skb),
> skb->mac_len);
> skb_reset_mac_header(skb);
> + skb_set_network_header(skb, skb->mac_len);
Sorry for chiming in after a month. The code above got in
(48d2ab609b6bb), I'm currently looking at this and it looks very
suspicious to me.
After push_mpls, network_header points to the start of MPLS headers.
Which I understand was the point of this patch. However, push_mpls also
calls invalidate_flow_key. Meaning that, depending on actions, we may
end up calling key_extract soon after. And key_extract sets the network
header *after* the MPLS headers.
That means that on output, for otherwise identical packet,
network_header can point before or after MPLS headers based on what
actions happened to be executed (recirculation, mainly).
If I'm not misreading the code or missing something, this can't be
right.
mpls_gso_segment does not care, it resets the network_header anyway.
What about drivers? What is the correct behavior?
Jiri
next prev parent reply other threads:[~2016-09-26 15:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 17:08 [PATCH v3 net-next 0/3] net: mpls: fragmentation and gso fixes for locally originated traffic David Ahern
2016-08-19 17:09 ` [PATCH net-next 1/3] net: lwtunnel: Handle fragmentation David Ahern
2016-08-19 17:09 ` [PATCH net-next 2/3] net: mpls: Fixups for GSO David Ahern
2016-08-19 20:17 ` Alexander Duyck
2016-08-22 12:21 ` Simon Horman
2016-08-22 13:11 ` David Ahern
2016-08-22 14:51 ` Simon Horman
2016-08-23 19:24 ` David Ahern
2016-08-24 7:20 ` Simon Horman
2016-08-24 16:28 ` pravin shelar
2016-08-24 16:37 ` David Ahern
2016-08-24 17:41 ` pravin shelar
2016-08-24 18:53 ` David Ahern
2016-08-25 3:12 ` David Ahern
2016-08-25 3:58 ` pravin shelar
2016-09-26 15:56 ` Jiri Benc [this message]
2016-09-26 17:02 ` Jiri Benc
2016-09-27 2:04 ` David Ahern
2016-09-27 7:45 ` Jiri Benc
2016-09-27 16:38 ` David Ahern
2016-09-27 16:45 ` Jiri Benc
2016-08-19 17:09 ` [PATCH net-next 3/3] net: veth: Set features for MPLS David Ahern
-- strict thread matches above, loose matches on Subject: below --
2016-08-17 21:49 [PATCH v2 net-next 0/3] net: mpls: fragmentation and gso fixes for locally originated traffic David Ahern
2016-08-17 21:49 ` [PATCH net-next 2/3] net: mpls: Fixups for GSO David Ahern
2016-08-17 23:16 ` Alexander Duyck
2016-08-17 23:23 ` David Ahern
2016-08-18 1:06 ` Alexander Duyck
2016-08-18 2:59 ` David Ahern
2016-08-18 14:37 ` Alexander Duyck
2016-08-18 16:18 ` David Ahern
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=20160926175622.3b00d478@griffin \
--to=jbenc@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=buytenh@wantstofly.org \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=olivier.dugeon@orange.com \
--cc=pshelar@nicira.com \
--cc=pshelar@ovn.org \
--cc=roopa@cumulusnetworks.com \
--cc=rshearma@brocade.com \
--cc=simon.horman@netronome.com \
--cc=tgraf@suug.ch \
--cc=tom@herbertland.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;
as well as URLs for NNTP newsgroup(s).