Re: [PATCH v2.42 2/5] ofp-actions: Add separate OpenFlow 1.3 action parser
From: Simon Horman <horms@verge.net.au>
Date: 2013-10-07 06:25:56
On Fri, Oct 04, 2013 at 09:31:05AM -0700, Ben Pfaff wrote:
On Fri, Oct 04, 2013 at 05:09:57PM +0900, Simon Horman wrote:quoted
From: Joe Stringer <redacted> This patch adds new ofpact_from_openflow13() and ofpacts_from_openflow13() functions parallel to the existing ofpact handling code. In the OpenFlow 1.3 version, push_mpls is handled differently, but all other actions are handled by the existing code. In the case of push_mpls for OpenFlow 1.3 the new mpls_before_vlan field of struct ofpact_push_mpls is set to true. This will be used by a subsequent patch to allow allow the correct VLAN+MPLS datapath behaviour to be determined at odp translation time. Signed-off-by: Joe Stringer <redacted> Signed-off-by: Simon Horman <horms@verge.net.au>The need for a huge comment on mpls_before_vlan suggests to me that breaking it out as a separate type would be helpful. How about this: /* The position in the packet at which to insert an MPLS header. * * Used NXAST_PUSH_MPLS, OFPAT11_PUSH_MPLS. */ enum ofpact_mpls_position { /* Add the MPLS LSE after the Ethernet header but before any VLAN tags. * OpenFlow 1.3+ requires this behavior. */ OFPACT_MPLS_BEFORE_VLAN, /* Add the MPLS LSE after the Ethernet header and any VLAN tags. * OpenFlow 1.1 and 1.2 require this behavior. */ OFPACT_MPLS_AFTER_VLAN }; /* OFPACT_PUSH_VLAN/MPLS/PBB * * Used for NXAST_PUSH_MPLS, OFPAT11_PUSH_MPLS. */ struct ofpact_push_mpls { struct ofpact ofpact; ovs_be16 ethertype; enum ofpact_mpls_position position; };
Hi Ben, thanks, that looks very nice. I will incorporate it in the next revision of the patchset.