From patchwork Thu Sep 17 14:54:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 518904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 45456140F8D for ; Fri, 18 Sep 2015 00:57:49 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 3ED4E10B3B; Thu, 17 Sep 2015 07:57:48 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id C10C8109EA for ; Thu, 17 Sep 2015 07:57:46 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id E0A04618FB0 for ; Thu, 17 Sep 2015 08:57:38 -0600 (MDT) X-ASG-Debug-ID: 1442501855-03dc215b1f004c0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id QmFUV7IZiORiz8EI (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 17 Sep 2015 08:57:35 -0600 (MDT) X-Barracuda-Envelope-From: aserdean@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx3-pf3.cudamail.com with SMTP; 17 Sep 2015 14:54:47 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at cloudbasesolutions.com designates 91.232.152.5 as permitted sender) X-Barracuda-Apparent-Source-IP: 91.232.152.5 X-Barracuda-RBL-IP: 91.232.152.5 Received: from localhost (localhost [127.0.0.1]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 3709742067 for ; Thu, 17 Sep 2015 17:54:46 +0300 (EEST) X-Virus-Scanned: amavisd-new at cloudbasesolutions.com Received: from cbssmtp1.cloudbase.local ([127.0.0.1]) by localhost (cbssmtp1.cloudbase.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gdw6yy1RyYyu for ; Thu, 17 Sep 2015 17:54:25 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id A731342022 for ; Thu, 17 Sep 2015 17:54:07 +0300 (EEST) Received: from CBSEX1.cloudbase.local ([10.77.78.3]) by CBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0224.002; Thu, 17 Sep 2015 16:54:07 +0200 X-CudaMail-Envelope-Sender: aserdean@cloudbasesolutions.com From: Alin Serdean To: "dev@openvswitch.org" X-CudaMail-MID: CM-V3-916024656 X-CudaMail-DTE: 091715 X-CudaMail-Originating-IP: 91.232.152.5 Thread-Topic: [PATCH v6] datapath-windows: Output to multiple VXLAN ports X-ASG-Orig-Subj: [##CM-V3-916024656##][PATCH v6] datapath-windows: Output to multiple VXLAN ports Thread-Index: AQHQ8VizJZCgzgH/KEeLnXhYlVb0Ag== Date: Thu, 17 Sep 2015 14:54:07 +0000 Message-ID: <1442501644-9596-1-git-send-email-aserdean@cloudbasesolutions.com> Accept-Language: en-US, it-IT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.78.1] MIME-Version: 1.0 X-GBUdb-Analysis: 0, 91.232.152.5, Ugly c=0.226425 p=-0.555556 Source Normal X-MessageSniffer-Rules: 0-0-0-7548-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1442501855 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22633 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Subject: [ovs-dev] [PATCH v6] datapath-windows: Output to multiple VXLAN ports X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" If we have a flow rule of the following form: actions=strip_vlan,set_tunnel:0x3e9,15,16,17 (Where port 15, 16 and 17 are VXLAN OF ports with different tunnelling information) Current implementation is that if a packet will hit that specific flow, only one packet will be sent out with the first tunnelling information. This patch saves the initial packet source port for further use of the currently implemented pipeline and ignores the latter if it is the last tunnelling port. Signed-off-by: Alin Gabriel Serdean Acked-by: Nithin Raju Acked-by: Sairam Venugopal Acked-by: Sorin Vinturis --- This patch is also intended for branch-2.4 v6 add acks v5 Address comments do not save nic index and portid v4 Relax condition when saving ports v3 Fix formatting v2 Address comments --- datapath-windows/ovsext/Actions.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index c8de7c5..bfe5d7f 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -947,7 +947,6 @@ OvsOutputBeforeSetAction(OvsForwardingContext *ovsFwdCtx) { PNET_BUFFER_LIST newNbl; NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PNET_BUFFER nb; /* * Create a copy and work on the copy after this point. The original NBL is @@ -967,14 +966,14 @@ OvsOutputBeforeSetAction(OvsForwardingContext *ovsFwdCtx) * XXX Head room needs to include the additional encap. * XXX copySize check is not considering multiple NBs. */ - nb = NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl); newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, 0, 0, TRUE /*copy NBL info*/); ASSERT(ovsFwdCtx->destPortsSizeOut > 0 || ovsFwdCtx->tunnelTxNic != NULL || ovsFwdCtx->tunnelRxNic != NULL); - /* Send the original packet out */ + /* Send the original packet out and save the original source port number */ + UINT32 tempVportNo = ovsFwdCtx->srcVportNo; status = OvsOutputForwardingCtx(ovsFwdCtx); ASSERT(ovsFwdCtx->curNbl == NULL); ASSERT(ovsFwdCtx->destPortsSizeOut == 0); @@ -992,7 +991,7 @@ OvsOutputBeforeSetAction(OvsForwardingContext *ovsFwdCtx) OvsCompleteNBL(ovsFwdCtx->switchContext, newNbl, TRUE); } else { status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, - newNbl, ovsFwdCtx->srcVportNo, 0, + newNbl, tempVportNo, 0, NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), ovsFwdCtx->completionList, &ovsFwdCtx->layers, FALSE);