netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@nicira.com>
To: Simon Horman <horms@verge.net.au>
Cc: dev@openvswitch.org, netdev@vger.kernel.org,
	Jesse Gross <jesse@nicira.com>,
	Pravin B Shelar <pshelar@nicira.com>, Ravi K <rkerur@gmail.com>,
	Joe Stringer <joe@wand.net.nz>
Subject: Re: [PATCH v2.51 1/5] ofp-actions: Allow Consistency checking of OF1.3+ VLAN actions after mpls_push
Date: Wed, 4 Dec 2013 13:24:29 -0800	[thread overview]
Message-ID: <20131204212429.GA11354@nicira.com> (raw)
In-Reply-To: <1385005606-30130-2-git-send-email-horms@verge.net.au>

On Thu, Nov 21, 2013 at 12:46:42PM +0900, Simon Horman wrote:
> The aim of this patch is to support provide infrastructure for verification
> of VLAN actions after an mpls_push action for OpenFlow1.3. This supplements
> existing support for verifying these actions for pre-OpenFlow1.3.
> 
> In OpenFlow1.1 and 1.2 MPLS tags are pushed after any VLAN tags that
> immediately follow the ethernet header. This is pre-OpenFlow1.3 tag
> ordering. Open vSwitch also uses this ordering when supporting MPLS
> actions via Nicira extensions to OpenFlow1.0.
> 
> When using pre-OpenFlow1.3 tag ordering an MPLS push action does not
> affect the VLANs of a packet. If VLAN tags are present immediately after
> the ethernet header then they remain present there.
> 
> In of OpenFlow1.3+ MPLS LSEs are pushed before any VLAN tags that
> immediately follow the ethernet header. This is OpenFlow1.3+ tag
> ordering.
> 
> When using OpenFlow1.3+ tag ordering an MPLS push action affects the
> VLANs of a packet as any VLAN tags previously present after the ethernet
> header are moved to be immediately after the newly pushed MPLS LSE. Thus
> for the purpose of action consistency checking a packet may be changed
> from a VLAN packet to a non-VLAN packet.
> 
> In this way the effective value of the VLAN TCI of a packet may differ
> after an MPLS push depending on the OpenFlow version in use.
> 
> This patch does not enable the logic described above.
> Rather it is disabled in ofpacts_check__(). It should
> be enabled when support for OpenFlow1.3+ tag order is added
> and enabled.
> 
> Signed-off-by: Simon Horman <horms@verge.net.au>

As far as I can tell this doesn't make sense, because where the MPLS
tag goes is a property of the action that we know at the time we parse
the push_mpls action.  So why isn't this patch just the following?

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index a02f842..f444374 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -2071,6 +2071,9 @@ ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a,
          * Thus nothing can be assumed about the network protocol.
          * Temporarily mark that we have no nw_proto. */
         flow->nw_proto = 0;
+        if (ofpact_get_PUSH_MPLS(a)->position == OFPACT_MPLS_BEFORE_VLAN) {
+            flow->vlan_tci = 0;
+        }
         return 0;
 
     case OFPACT_POP_MPLS:

  reply	other threads:[~2013-12-04 21:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  3:46 [PATCH v2.51 0/5] MPLS actions and matches Simon Horman
     [not found] ` <1385005606-30130-1-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-11-21  3:46   ` [PATCH v2.51 1/5] ofp-actions: Allow Consistency checking of OF1.3+ VLAN actions after mpls_push Simon Horman
2013-12-04 21:24     ` Ben Pfaff [this message]
2013-12-04 23:58       ` Simon Horman
2013-12-05  0:44         ` Ben Pfaff
2013-12-05  0:51           ` Simon Horman
2013-12-05  1:01             ` Ben Pfaff
     [not found]               ` <20131205010111.GE11354-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-12-05  2:26                 ` Simon Horman
2013-12-05 17:56                   ` Ben Pfaff
2013-12-06  3:29                     ` Simon Horman
     [not found]                       ` <20131206032924.GA20522-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-12-06  4:21                         ` Ben Pfaff
2013-11-21  3:46   ` [PATCH v2.51 2/5] odp: Allow VLAN actions after MPLS actions Simon Horman
2013-11-21  3:46   ` [PATCH v2.51 3/5] lib: Support pushing of MPLS LSE before or after VLAN tag Simon Horman
2013-11-21  3:46 ` [PATCH v2.51 4/5] datapath: Break out deacceleration portion of vlan_push Simon Horman
2013-11-21  3:46 ` [PATCH v2.51 5/5] datapath: Add basic MPLS support to kernel Simon Horman
2013-11-26  8:08 ` [ovs-dev] [PATCH v2.51 0/5] MPLS actions and matches Simon Horman
2013-11-26 15:33   ` Ben Pfaff
2013-11-27  0:12     ` Simon Horman
2013-12-04  9:16       ` Simon Horman

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=20131204212429.GA11354@nicira.com \
    --to=blp@nicira.com \
    --cc=dev@openvswitch.org \
    --cc=horms@verge.net.au \
    --cc=jesse@nicira.com \
    --cc=joe@wand.net.nz \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=rkerur@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;
as well as URLs for NNTP newsgroup(s).