diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c
index bfe5d7f..b4644a7 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -566,9 +566,10 @@ OvsDoFlowLookupOutput(OvsForwardingContext *ovsFwdCtx)
 
     /* Assert that in the Rx direction, key is always setup. */
     ASSERT(ovsFwdCtx->tunnelRxNic == NULL || ovsFwdCtx->tunKey.dst != 0);
-    status = OvsExtractFlow(ovsFwdCtx->curNbl, ovsFwdCtx->srcVportNo,
-                          &key, &ovsFwdCtx->layers, ovsFwdCtx->tunKey.dst != 0 ?
-                                         &ovsFwdCtx->tunKey : NULL);
+    status =
+        OvsExtractFlow(ovsFwdCtx->curNbl, ovsFwdCtx->srcVportNo,
+                       &key, &ovsFwdCtx->layers,
+                       ovsFwdCtx->tunKey.dst != 0 ? &ovsFwdCtx->tunKey : NULL);
     if (status != NDIS_STATUS_SUCCESS) {
         OvsCompleteNBLForwardingCtx(ovsFwdCtx,
                                     L"OVS-Flow extract failed");
@@ -581,18 +582,17 @@ OvsDoFlowLookupOutput(OvsForwardingContext *ovsFwdCtx)
         OvsFlowUsed(flow, ovsFwdCtx->curNbl, &ovsFwdCtx->layers);
         ovsFwdCtx->switchContext->datapath.hits++;
         status = OvsActionsExecute(ovsFwdCtx->switchContext,
-                                 ovsFwdCtx->completionList, ovsFwdCtx->curNbl,
-                                 ovsFwdCtx->srcVportNo, ovsFwdCtx->sendFlags,
-                                 &key, &hash, &ovsFwdCtx->layers,
-                                 flow->actions, flow->actionsLen);
+                                   ovsFwdCtx->completionList, ovsFwdCtx->curNbl,
+                                   ovsFwdCtx->srcVportNo, ovsFwdCtx->sendFlags,
+                                   &key, &hash, &ovsFwdCtx->layers,
+                                   flow->actions, flow->actionsLen);
         ovsFwdCtx->curNbl = NULL;
     } else {
         LIST_ENTRY missedPackets;
         UINT32 num = 0;
         ovsFwdCtx->switchContext->datapath.misses++;
         InitializeListHead(&missedPackets);
-        status = OvsCreateAndAddPackets(NULL, 0, OVS_PACKET_CMD_MISS,
-                          ovsFwdCtx->srcVportNo,
+        status = OvsCreateAndAddPackets(NULL, 0, OVS_PACKET_CMD_MISS, vport,
                           &key,ovsFwdCtx->curNbl,
                           ovsFwdCtx->tunnelRxNic != NULL, &ovsFwdCtx->layers,
                           ovsFwdCtx->switchContext, &missedPackets, &num);
@@ -1530,7 +1530,7 @@ OvsActionsExecute(POVS_SWITCH_CONTEXT switchContext,
             elem = OvsCreateQueueNlPacket((PVOID)userdataAttr,
                                     userdataAttr->nlaLen,
                                     OVS_PACKET_CMD_ACTION,
-                                    portNo, key,ovsFwdCtx.curNbl,
+                                    vport, key, ovsFwdCtx.curNbl,
                                     NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx.curNbl),
                                     isRecv,
                                     layers);
diff --git a/datapath-windows/ovsext/PacketIO.c b/datapath-windows/ovsext/PacketIO.c
index d41335b..cfbae34 100644
--- a/datapath-windows/ovsext/PacketIO.c
+++ b/datapath-windows/ovsext/PacketIO.c
@@ -333,8 +333,8 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext,
                  * Otherwise, it adds it to the completionList. No need to
                  * check the return value. */
                 OvsActionsExecute(switchContext, &completionList, curNbl,
-                                portNo, SendFlags, &key, &hash, &layers,
-                                flow->actions, flow->actionsLen);
+                                  portNo, SendFlags, &key, &hash, &layers,
+                                  flow->actions, flow->actionsLen);
                 OvsReleaseDatapath(datapath, &dpLockState);
                 NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
                 continue;
@@ -343,7 +343,7 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext,
 
                 datapath->misses++;
                 status = OvsCreateAndAddPackets(NULL, 0, OVS_PACKET_CMD_MISS,
-                             portNo, &key, curNbl,
+                             vport, &key, curNbl,
                              sourcePort == switchContext->virtualExternalPortId,
                              &layers, switchContext, &missedPackets, &num);
                 if (status == NDIS_STATUS_SUCCESS) {
diff --git a/datapath-windows/ovsext/PacketIO.h b/datapath-windows/ovsext/PacketIO.h
index 4d29a18..7247869 100644
--- a/datapath-windows/ovsext/PacketIO.h
+++ b/datapath-windows/ovsext/PacketIO.h
@@ -49,11 +49,11 @@ VOID OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext,
                        ULONG sendFlags);
 
 NDIS_STATUS OvsActionsExecute(POVS_SWITCH_CONTEXT switchContext,
-                            OvsCompletionList *completionList,
-                            PNET_BUFFER_LIST curNbl, UINT32 srcVportNo,
-                            ULONG sendFlags, OvsFlowKey *key, UINT64 *hash,
-                            OVS_PACKET_HDR_INFO *layers,
-                            const PNL_ATTR actions, int actionsLen);
+                              OvsCompletionList *completionList,
+                              PNET_BUFFER_LIST curNbl, UINT32 srcVportNo,
+                              ULONG sendFlags, OvsFlowKey *key, UINT64 *hash,
+                              OVS_PACKET_HDR_INFO *layers,
+                              const PNL_ATTR actions, int actionsLen);
 
 VOID OvsLookupFlowOutput(POVS_SWITCH_CONTEXT switchContext,
                          VOID *compList, PNET_BUFFER_LIST curNbl);
diff --git a/datapath-windows/ovsext/Tunnel.c b/datapath-windows/ovsext/Tunnel.c
index ffb9c01..eea4a84 100644
--- a/datapath-windows/ovsext/Tunnel.c
+++ b/datapath-windows/ovsext/Tunnel.c
@@ -309,8 +309,8 @@ OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl,
             datapath->hits++;
 
             OvsActionsExecute(gOvsSwitchContext, &completionList, pNbl,
-                            portNo, SendFlags, &key, &hash, &layers,
-                            flow->actions, flow->actionsLen);
+                              portNo, SendFlags, &key, &hash, &layers,
+                              flow->actions, flow->actionsLen);
 
             OvsReleaseDatapath(datapath, &dpLockState);
         } else {
@@ -318,8 +318,8 @@ OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl,
 
             datapath->misses++;
             elem = OvsCreateQueueNlPacket(NULL, 0, OVS_PACKET_CMD_MISS,
-                                        portNo, &key, pNbl, curNb,
-                                        TRUE, &layers);
+                                          vport, &key, pNbl, curNb,
+                                          TRUE, &layers);
             if (elem) {
                 /* Complete the packet since it was copied to user buffer. */
                 InsertTailList(&missedPackets, &elem->link);
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index 8045e9a..7af4816 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -772,7 +772,7 @@ NTSTATUS
 OvsCreateAndAddPackets(PVOID userData,
                        UINT32 userDataLen,
                        UINT32 cmd,
-                       UINT32 inPort,
+                       POVS_VPORT_ENTRY vport,
                        OvsFlowKey *key,
                        PNET_BUFFER_LIST nbl,
                        BOOLEAN isRecv,
@@ -809,7 +809,7 @@ OvsCreateAndAddPackets(PVOID userData,
     nb = NET_BUFFER_LIST_FIRST_NB(nbl);
     while (nb) {
         elem = OvsCreateQueueNlPacket(userData, userDataLen,
-                                    cmd, inPort, key, nbl, nb,
+                                    cmd, vport, key, nbl, nb,
                                     isRecv, hdrInfo);
         if (elem) {
             InsertTailList(list, &elem->link);
@@ -988,7 +988,7 @@ POVS_PACKET_QUEUE_ELEM
 OvsCreateQueueNlPacket(PVOID userData,
                        UINT32 userDataLen,
                        UINT32 cmd,
-                       UINT32 inPort,
+                       POVS_VPORT_ENTRY vport,
                        OvsFlowKey *key,
                        PNET_BUFFER_LIST nbl,
                        PNET_BUFFER nb,
@@ -1007,10 +1007,6 @@ OvsCreateQueueNlPacket(PVOID userData,
     NL_BUFFER nlBuf;
     PNL_MSG_HDR nlMsg;
 
-    /* XXX pass vport in the stack rather than portNo */
-    POVS_VPORT_ENTRY vport =
-        OvsFindVportByPortNo(gOvsSwitchContext, inPort);
-
     if (vport == NULL){
         /* No vport is not fatal. */
         return NULL;
@@ -1062,7 +1058,7 @@ OvsCreateQueueNlPacket(PVOID userData,
     elem->packet.queue = 0;
     /* XXX  no need as the length is already in the NL attrib */
     elem->packet.userDataLen = userDataLen;
-    elem->packet.inPort = inPort;
+    elem->packet.inPort = vport->portNo;
     elem->packet.cmd = cmd;
     if (cmd == (UINT32)OVS_PACKET_CMD_MISS) {
         ovsUserStats.miss++;
diff --git a/datapath-windows/ovsext/User.h b/datapath-windows/ovsext/User.h
index 139b0ca..9182585 100644
--- a/datapath-windows/ovsext/User.h
+++ b/datapath-windows/ovsext/User.h
@@ -72,7 +72,8 @@ VOID OvsCleanupPacketQueue(struct _OVS_OPEN_INSTANCE *instance);
 
 POVS_PACKET_QUEUE_ELEM OvsCreateQueueNlPacket(PVOID userData,
                                               UINT32 userDataLen,
-                                              UINT32 cmd, UINT32 inPort,
+                                              UINT32 cmd, 
+                                              POVS_VPORT_ENTRY vport,
                                               OvsFlowKey *key,
                                               PNET_BUFFER_LIST nbl,
                                               PNET_BUFFER nb,
@@ -83,7 +84,7 @@ VOID OvsQueuePackets(PLIST_ENTRY packetList, UINT32 numElems);
 NTSTATUS OvsCreateAndAddPackets(PVOID userData,
                                 UINT32 userDataLen,
                                 UINT32 cmd,
-                                UINT32 inPort,
+                                POVS_VPORT_ENTRY vport,
                                 OvsFlowKey *key,
                                 PNET_BUFFER_LIST nbl,
                                 BOOLEAN isRecv,
