summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Actions.c
diff options
context:
space:
mode:
authorShashank Ram <rams@vmware.com>2016-12-08 13:31:49 -0800
committerGurucharan Shetty <guru@ovn.org>2016-12-15 13:30:47 -0800
commitba7283e97fe80920a222249eb9f6f4211ccb4ccf (patch)
treeeffbeb2f269f886fb86be9142fbe5bb5c7fb895a /datapath-windows/ovsext/Actions.c
parentebd39edacb0b3b2227e33db32a5afcbc3ba37fc0 (diff)
downloadopenvswitch-ba7283e97fe80920a222249eb9f6f4211ccb4ccf.tar.gz
datapath-windows: Fix issues related to packet completion
In OvsTunnelPortTx() function, for packets coming from the VIF port, the srcVportNo, srcPortId and srcNicIndex were getting modified for the original NBL prior to creation of newNbl. This is not correct since modifying the original packet's forwarding detail can cause completion issues. Instead, we should keep the forwarding detail of the original packet as is, and only update the forwarding detail for the newNbl. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Actions.c')
-rw-r--r--datapath-windows/ovsext/Actions.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c
index 9a58fbdbc..c1e0121cb 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -663,6 +663,9 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx)
{
NDIS_STATUS status = NDIS_STATUS_FAILURE;
PNET_BUFFER_LIST newNbl = NULL;
+ UINT32 srcVportNo;
+ NDIS_SWITCH_NIC_INDEX srcNicIndex;
+ NDIS_SWITCH_PORT_ID srcPortId;
/*
* Setup the source port to be the internal port to as to facilitate the
@@ -675,11 +678,15 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx)
L"OVS-Dropped since either internal or external port is absent");
return NDIS_STATUS_FAILURE;
}
- ovsFwdCtx->srcVportNo =
- ((POVS_VPORT_ENTRY)ovsFwdCtx->switchContext->internalVport)->portNo;
- ovsFwdCtx->fwdDetail->SourcePortId = ovsFwdCtx->switchContext->internalPortId;
- ovsFwdCtx->fwdDetail->SourceNicIndex =
+ /*
+ * Save the 'srcVportNo', 'srcPortId', 'srcNicIndex' so that
+ * this can be applied to the new NBL later on.
+ */
+ srcVportNo =
+ ((POVS_VPORT_ENTRY)ovsFwdCtx->switchContext->internalVport)->portNo;
+ srcPortId = ovsFwdCtx->switchContext->internalPortId;
+ srcNicIndex =
((POVS_VPORT_ENTRY)ovsFwdCtx->switchContext->internalVport)->nicIndex;
/* Do the encap. Encap function does not consume the NBL. */
@@ -715,12 +722,20 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx)
ASSERT(newNbl);
OvsCompleteNBLForwardingCtx(ovsFwdCtx,
L"Complete after cloning NBL for encapsulation");
+ status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext,
+ newNbl, srcVportNo, 0,
+ NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl),
+ ovsFwdCtx->completionList,
+ &ovsFwdCtx->layers, FALSE);
ovsFwdCtx->curNbl = newNbl;
+ /* Update the forwarding detail for the new NBL */
+ ovsFwdCtx->fwdDetail->SourcePortId = srcPortId;
+ ovsFwdCtx->fwdDetail->SourceNicIndex = srcNicIndex;
status = OvsDoFlowLookupOutput(ovsFwdCtx);
ASSERT(ovsFwdCtx->curNbl == NULL);
} else {
/*
- * XXX: Temporary freeing of the packet until we register a
+ * XXX: Temporary freeing of the packet until we register a
* callback to IP helper.
*/
OvsCompleteNBLForwardingCtx(ovsFwdCtx,