public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@nicira•com>
To: Joe Stringer <joe@wand•net.nz>
Cc: Simon Horman <horms@verge•net.au>,
	"dev@openvswitch•org" <dev@openvswitch•org>,
	netdev@vger•kernel.org, Jesse Gross <jesse@nicira•com>,
	Pravin B Shelar <pshelar@nicira•com>, Ravi K <rkerur@gmail•com>,
	Isaku Yamahata <yamahata@valinux•co.jp>
Subject: Re: [PATCH v2.40 2/7] odp: Allow VLAN actions after MPLS actions
Date: Sun, 29 Sep 2013 10:05:49 -0700	[thread overview]
Message-ID: <20130929170549.GC23836@nicira.com> (raw)
In-Reply-To: <CAOftzPg_FJoyS0oS8Ua7cpMaCh=BboWwyn8kVVoXGT9X9HQ0hg@mail.gmail.com>

On Sun, Sep 29, 2013 at 02:51:19PM +1300, Joe Stringer wrote:
> On Sat, Sep 28, 2013 at 7:21 AM, Ben Pfaff <blp@nicira•com> wrote:
> 
> > On Fri, Sep 27, 2013 at 09:18:31AM +0900, Simon Horman wrote:
> > > From: Joe Stringer <joe@wand•net.nz>
> > >
> > > OpenFlow 1.2 and 1.3 differ on their handling of MPLS actions in the
> > > presence of VLAN tags. To allow correct behaviour to be committed in
> > > each situation, this patch adds a second round of VLAN tag action
> > > handling to commit_odp_actions(), which occurs after MPLS actions. This
> > > is implemented with a new field in 'struct xlate_in' called 'vlan_tci'.
> > >
> > > When an push_mpls action is composed, the flow's current VLAN state is
> > > stored into xin->vlan_tci, and flow->vlan_tci is set to 0 (pop_vlan). If
> > > a VLAN tag is present, it is stripped; if not, then there is no change.
> > > Any later modifications to the VLAN state is written to xin->vlan_tci.
> > > When committing the actions, flow->vlan_tci is used before MPLS actions,
> > > and xin->vlan_tci is used afterwards. This retains the current datapath
> > > behaviour, but allows VLAN actions to be applied in a more flexible
> > > manner.
> > >
> > > Signed-off-by: Joe Stringer <joe@wand•net.nz>
> > > Signed-off-by: Simon Horman <horms@verge•net.au>
> >
> > The commit message talks about handling OpenFlow 1.2 and 1.3 both
> > properly, but I don't see how the code distinguishes between the cases.
> > Can you explain?  Maybe this is something added in a later patch, in
> > which case it would be nice to mention that in the commit message.
> >
> 
> It is added in patch #5. IIRC this patch should cause no difference in
> behaviour, but set up infrastructure to be used later.
> 
>  There seems to be a typo in the comment in vlan_tci_restore() here:
> > > +    /* If MPLS actions were executed after MPLS, copy the final
> > vlan_tci out
> > > +     * and restore the intermediate VLAN state. */
> >
> 
> Right, that should probably be "...executed after VLAN actions...".
> 
> I was a little confused by the new local variable 'vlan_tci' in
> > do_xlate_actions().  Partly this was because the fact that I didn't find
> > it obvious that sometimes it points to different VLAN tags.  I think
> > this would be easier to see if it were initially assigned just under the
> > big comment rather than in an initializer, so that one would know to
> > look at the comment.
> >
> 
> Perhaps the big comment could be rearranged and put above the initialiser,
> something like the following:-
> 
> /* VLAN actions are stored to '*vlan_tci'. This variable initially points
> to 'xin->flow->vlan_tci', so that
>  * VLAN actions are applied before any MPLS actions. When an MPLS action is
> translated,
>  * 'vlan_tci' is updated to point to 'xin->vlan_tci'. This causes later
> VLAN actions to be applied after MPLS actions.
>  * Each time through the loop, 'xin->vlan_tci' is updated to reflect the
> final VLAN state of the flow. */
> 
> Then, the place where 'xin->vlan_tci' is updated to '*vlan_tci' could have
> a simple comment to refer back:-
> 
> /* Update the final vlan state to match the current state. */

All that makes sense, thanks.

  reply	other threads:[~2013-09-29 17:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27  0:18 [PATCH v2.40 0/7] MPLS actions and matches Simon Horman
2013-09-27  0:18 ` [PATCH v2.40 1/7] odp: Only pass vlan_tci to commit_vlan_action() Simon Horman
2013-09-27 16:56   ` Ben Pfaff
2013-09-27  0:18 ` [PATCH v2.40 2/7] odp: Allow VLAN actions after MPLS actions Simon Horman
2013-09-27 19:21   ` Ben Pfaff
     [not found]     ` <20130927192108.GA17506-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-09-29  1:51       ` Joe Stringer
2013-09-29 17:05         ` Ben Pfaff [this message]
2013-09-30  1:10         ` Simon Horman
     [not found] ` <1380241116-7661-1-git-send-email-horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-27  0:18   ` [PATCH v2.40 3/7] ofp-actions: Add OFPUTIL_OFPAT13_PUSH_MPLS Simon Horman
2013-09-27 19:30     ` Ben Pfaff
     [not found]       ` <20130927193010.GB17506-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-09-29  2:07         ` Joe Stringer
2013-09-30  1:13       ` Simon Horman
2013-09-30  2:00         ` Ben Pfaff
2013-09-27  0:18   ` [PATCH v2.40 4/7] ofp-actions: Add separate OpenFlow 1.3 action parser Simon Horman
2013-09-27 19:41     ` Ben Pfaff
     [not found]       ` <20130927194119.GC17506-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-09-30  2:12         ` Simon Horman
     [not found]           ` <20130930021246.GC4768-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-09-30  2:19             ` Ben Pfaff
2013-09-29  2:35   ` [PATCH v2.40 0/7] MPLS actions and matches Joe Stringer
2013-09-27  0:18 ` [PATCH v2.40 5/7] lib: Push MPLS tags in the OpenFlow 1.3 ordering Simon Horman
2013-09-27 19:47   ` Ben Pfaff
2013-09-27  0:18 ` [PATCH v2.40 6/7] datapath: Break out deacceleration portion of vlan_push Simon Horman
2013-09-27 19:48   ` Ben Pfaff
2013-09-27 21:05     ` Jesse Gross
2013-09-27  0:18 ` [PATCH v2.40 7/7] datapath: Add basic MPLS support to kernel 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=20130929170549.GC23836@nicira.com \
    --to=blp@nicira$(echo .)com \
    --cc=dev@openvswitch$(echo .)org \
    --cc=horms@verge$(echo .)net.au \
    --cc=jesse@nicira$(echo .)com \
    --cc=joe@wand$(echo .)net.nz \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pshelar@nicira$(echo .)com \
    --cc=rkerur@gmail$(echo .)com \
    --cc=yamahata@valinux$(echo .)co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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