[ovs-dev,v6] datapath-windows: Output to multiple VXLAN ports
diff mbox

Message ID 1442501644-9596-1-git-send-email-aserdean@cloudbasesolutions.com
State Accepted
Headers show

Commit Message

Alin Serdean Sept. 17, 2015, 2:54 p.m. UTC
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 <aserdean@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
---
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(-)

Comments

Ben Pfaff Sept. 18, 2015, 6:34 p.m. UTC | #1
On Thu, Sep 17, 2015 at 02:54:07PM +0000, Alin Serdean wrote:
> 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 <aserdean@cloudbasesolutions.com>
> Acked-by: Nithin Raju <nithin@vmware.com>
> Acked-by: Sairam Venugopal <vsairam@vmware.com>
> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
> ---
> This patch is also intended for branch-2.4

Thanks, applied to master and branch-2.4.

Patch
diff mbox

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);