From patchwork Wed Dec 4 21:24:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 296634 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EBAEE2C00B8 for ; Thu, 5 Dec 2013 08:24:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084Ab3LDVYi (ORCPT ); Wed, 4 Dec 2013 16:24:38 -0500 Received: from na3sys009aog124.obsmtp.com ([74.125.149.151]:49256 "HELO na3sys009aog124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753864Ab3LDVYh (ORCPT ); Wed, 4 Dec 2013 16:24:37 -0500 Received: from mail-qa0-f46.google.com ([209.85.216.46]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKUp+dlC2zAhLca2JH9MpgAiXzhBlVGGPw@postini.com; Wed, 04 Dec 2013 13:24:37 PST Received: by mail-qa0-f46.google.com with SMTP id f11so7014061qae.19 for ; Wed, 04 Dec 2013 13:24:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=ulxduOI6wrsOPTkvLp+peqf2DWV+3eRDTAuV2mdrK0w=; b=ZLQjgRz9NxKEC1aGawiYP1166mBeCtzfbLO/8Py9PbJ/+prf/+Wex00KASxOHruKwu g6TKoHN7BqFVgMKymmPaimJBQ5H1G+3PrlQ/7WWtkD7vB9sIyGQX6dgUCdgSBk7ryj5Z pkSxdEGfxycHvfBU1l/jHZn4/3f8b91x0BLreP2Tj6DYLXub4uH7B7dmRK5TOR1rDf9r LYrhmLpDfC1lJBx0gvf3NDgGPcVUWaeP1mh0sLXl8MeF/Wy6BigXA00HBQEGKUGC19W6 oSjczYDk5O541mYGQ+dKd2KkRdfWt223mQSvGQFpo3GZL/L+z5YTPwq2VpOuC2s1wGCJ t/XQ== X-Gm-Message-State: ALoCoQkyhoo0diEPUoq9nu1kCuwjCZ1199ER2KKPIBTfkvyebRHEOOjfIhf4Uj7J7QcJxJWCa/IxbIQv/N1zFTVYR3gWHQdo/FngvBCQYH5EUPd5X8PBbqIolY9Cd1M53OsKGM0cn9uSoUcVQhl0M+U1V2LSW5umnl1KrhsRD7ryrqs9X+iZXQM= X-Received: by 10.49.2.132 with SMTP id 4mr95468350qeu.15.1386192275869; Wed, 04 Dec 2013 13:24:35 -0800 (PST) X-Received: by 10.49.2.132 with SMTP id 4mr95468333qeu.15.1386192275755; Wed, 04 Dec 2013 13:24:35 -0800 (PST) Received: from nicira.com (benpfaff.org. [66.246.76.178]) by mx.google.com with ESMTPSA id w5sm52949282qat.10.2013.12.04.13.24.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 04 Dec 2013 13:24:35 -0800 (PST) Date: Wed, 4 Dec 2013 13:24:29 -0800 From: Ben Pfaff To: Simon Horman Cc: dev@openvswitch.org, netdev@vger.kernel.org, Jesse Gross , Pravin B Shelar , Ravi K , Joe Stringer Subject: Re: [PATCH v2.51 1/5] ofp-actions: Allow Consistency checking of OF1.3+ VLAN actions after mpls_push Message-ID: <20131204212429.GA11354@nicira.com> References: <1385005606-30130-1-git-send-email-horms@verge.net.au> <1385005606-30130-2-git-send-email-horms@verge.net.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1385005606-30130-2-git-send-email-horms@verge.net.au> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 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? --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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: