From patchwork Thu Sep 17 14:51:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 518899 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 298EC140081 for ; Fri, 18 Sep 2015 00:55:21 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B936E10999; Thu, 17 Sep 2015 07:55:20 -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 788AB10995 for ; Thu, 17 Sep 2015 07:55:19 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id 91178618FF6 for ; Thu, 17 Sep 2015 08:55:17 -0600 (MDT) X-ASG-Debug-ID: 1442501706-03dd7b2d0b04ec0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id eq40VWMDQEZejPsq (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 17 Sep 2015 08:55:06 -0600 (MDT) X-Barracuda-Envelope-From: aserdean@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx3-pf2.cudamail.com with SMTP; 17 Sep 2015 14:51:37 -0000 Received-SPF: pass (mx3-pf2.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 F0E7A42064 for ; Thu, 17 Sep 2015 17:51:35 +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 FSF7jCXOBguX for ; Thu, 17 Sep 2015 17:51:15 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id A303742066 for ; Thu, 17 Sep 2015 17:51:06 +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:51:06 +0200 X-CudaMail-Envelope-Sender: aserdean@cloudbasesolutions.com From: Alin Serdean To: "dev@openvswitch.org" X-CudaMail-MID: CM-V2-916024074 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-V2-916024074##][PATCH v6] datapath-windows: Output to multiple VXLAN ports Thread-Index: AQHQ8VhH+93W8YdfHUen0T+eFgTXWg== Date: Thu, 17 Sep 2015 14:51:05 +0000 Message-ID: <1442501465-4180-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.142858 p=-0.5 Source Normal X-MessageSniffer-Rules: 0-0-0-7488-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1442501706 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);