From: Jiri Benc <jbenc@redhat.com>
To: Pravin Shelar <pshelar@nicira.com>
Cc: Jiri Pirko <jiri@resnulli.us>, netdev <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Tom Herbert <therbert@google.com>,
Eric Dumazet <edumazet@google.com>,
Willem de Bruijn <willemb@google.com>,
Daniel Borkmann <dborkman@redhat.com>,
mst@redhat.com, fw@strlen.de, Paul.Durrant@citrix.com,
Thomas Graf <tgraf@suug.ch>, Cong Wang <cwang@twopensource.com>
Subject: Re: [patch net-next v3 8/9] net: move vlan pop/push functions into common code
Date: Wed, 19 Nov 2014 14:03:57 +0100 [thread overview]
Message-ID: <20141119140357.5f9d0594@griffin> (raw)
In-Reply-To: <CALnjE+rJEtyL-QDrp0x+N_pCxDuR6soHkaY-OrswWrdZwfE2sQ@mail.gmail.com>
On Wed, 19 Nov 2014 00:06:19 -0800, Pravin Shelar wrote:
> skb_reset_mac_len() sets length according to ethernet and network
> offsets, but mpls expects mac-length to be offset to mpls header (ref.
> skb_mpls_header()). Therefore rather than reset we need to subtract
> VLAN_HLEN from mac_len. Same goes for vlan-push(), we can add
> VLAN_HLEN.
Subtracting VLAN_HLEN from mac_len would break the common vlan cases,
where skb->protocol is ETH_P_8021Q and skb->mac_len is 14 on input to
__skb_vlan_pop. After __skb_vlan_pop pops the vlan header, it changes
skb->protocol to the protocol of the actual frame and has to leave
skb->mac_len at 14.
You'll need something more sophisticated to support MPLS here, I'm
afraid.
Jiri
--
Jiri Benc
next prev parent reply other threads:[~2014-11-19 13:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 21:37 [patch net-next v3 0/9] sched: introduce vlan action Jiri Pirko
2014-11-18 21:37 ` [patch net-next v3 1/9] openvswitch: actions: use skb_postpull_rcsum when possible Jiri Pirko
2014-11-18 21:37 ` [patch net-next v3 2/9] vlan: make __vlan_hwaccel_put_tag return void Jiri Pirko
2014-11-19 8:05 ` Pravin Shelar
2014-11-18 21:37 ` [patch net-next v3 3/9] vlan: kill vlan_put_tag helper Jiri Pirko
2014-11-18 21:37 ` [patch net-next v3 4/9] vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto Jiri Pirko
2014-11-19 8:05 ` Pravin Shelar
2014-11-18 21:37 ` [patch net-next v3 5/9] vlan: introduce *vlan_hwaccel_push_inside helpers Jiri Pirko
2014-11-19 8:05 ` Pravin Shelar
2014-11-19 8:38 ` Jiri Pirko
2014-11-18 21:37 ` [patch net-next v3 6/9] vlan: introduce __vlan_insert_tag helper which does not free skb Jiri Pirko
2014-11-19 8:05 ` Pravin Shelar
2014-11-18 21:37 ` [patch net-next v3 7/9] net: move make_writable helper into common code Jiri Pirko
2014-11-18 21:37 ` [patch net-next v3 8/9] net: move vlan pop/push functions " Jiri Pirko
2014-11-19 8:06 ` Pravin Shelar
2014-11-19 10:03 ` Jiri Pirko
2014-11-19 13:03 ` Jiri Benc [this message]
2014-11-19 20:32 ` Pravin Shelar
2014-11-18 21:37 ` [patch net-next v3 9/9] sched: introduce vlan action Jiri Pirko
2014-11-18 21:39 ` [patch iproute2 v3] tc: add support for vlan tc action Jiri Pirko
2014-11-18 21:54 ` [patch net-next v3 0/9] sched: introduce vlan action Or Gerlitz
2014-11-18 22:04 ` Jiri Pirko
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=20141119140357.5f9d0594@griffin \
--to=jbenc@redhat.com \
--cc=Paul.Durrant@citrix.com \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
--cc=tgraf@suug.ch \
--cc=therbert@google.com \
--cc=willemb@google.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).