sendCompleteFlags);
}
+static VOID
+OvsAppendNativeForwardedPacket(POVS_SWITCH_CONTEXT switchContext,
+ PNET_BUFFER_LIST curNbl,
+ PNET_BUFFER_LIST *nativeNbls,
+ ULONG flags,
+ BOOLEAN isRecv)
+{
+ POVS_BUFFER_CONTEXT ctx = { 0 };
+ NDIS_STRING filterReason;
+
+ *nativeNbls = curNbl;
+ nativeNbls = &(curNbl->Next);
+
+ ctx = OvsInitExternalNBLContext(switchContext, curNbl, isRecv);
+ if (ctx == NULL) {
+ RtlInitUnicodeString(&filterReason,
+ L"Cannot allocate native NBL context.");
+
+ OvsStartNBLIngressError(switchContext, curNbl, flags, &filterReason,
+ NDIS_STATUS_RESOURCES);
+ }
+}
+
static VOID
OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext,
PNET_BUFFER_LIST netBufferLists,
LIST_ENTRY missedPackets;
UINT32 num = 0;
OvsCompletionList completionList;
- PNET_BUFFER_LIST ovsForwardedNbls = NULL;
PNET_BUFFER_LIST nativeForwardedNbls = NULL;
- PNET_BUFFER_LIST *nextOvsForwardNbl = &ovsForwardedNbls;
PNET_BUFFER_LIST *nextNativeForwardedNbl = &nativeForwardedNbls;
dispatch = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(SendFlags)?
InitializeListHead(&missedPackets);
OvsInitCompletionList(&completionList, switchContext, sendCompleteFlags);
-#if (NDIS_SUPPORT_NDIS640)
- /*
- * Split NBL list into NBLs to be forwarded by us, and those that require
- * native forwarding.
- */
for (curNbl = netBufferLists; curNbl != NULL; curNbl = nextNbl) {
- nextNbl = curNbl->Next;
- curNbl->Next = NULL;
- fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl);
-
- if (fwdDetail->NativeForwardingRequired) {
- POVS_BUFFER_CONTEXT ctx;
-
- *nextNativeForwardedNbl = curNbl;
- nextNativeForwardedNbl = &(curNbl->Next);
-
- ctx = OvsInitExternalNBLContext(switchContext, curNbl,
- sourcePort == switchContext->virtualExternalPortId);
- if (ctx == NULL) {
- RtlInitUnicodeString(&filterReason,
- L"Cannot allocate native NBL context.");
-
- OvsStartNBLIngressError(switchContext, curNbl,
- sendCompleteFlags, &filterReason,
- NDIS_STATUS_RESOURCES);
-
- continue;
- }
- } else {
- *nextOvsForwardNbl = curNbl;
- nextOvsForwardNbl = &(curNbl->Next);
- }
- }
-#else
- UNREFERENCED_PARAMETER(nativeForwardedNbls);
- UNREFERENCED_PARAMETER(nextNativeForwardedNbl);
- UNREFERENCED_PARAMETER(nextOvsForwardNbl);
-
- ovsForwardedNbls = netBufferLists;
-#endif
-
- for (curNbl = ovsForwardedNbls; curNbl != NULL; curNbl = nextNbl) {
POVS_VPORT_ENTRY vport;
UINT32 portNo;
OVS_DATAPATH *datapath = &switchContext->datapath;
nextNbl = curNbl->Next;
curNbl->Next = NULL;
+ fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl);
+ sourcePort = fwdDetail->SourcePortId;
+ sourceIndex = (NDIS_SWITCH_NIC_INDEX)fwdDetail->SourceNicIndex;
+
+#if (NDIS_SUPPORT_NDIS640)
+ if (fwdDetail->NativeForwardingRequired) {
+ /* Add current NBL to those that require native forwarding. */
+ OvsAppendNativeForwardedPacket(
+ switchContext,
+ curNbl,
+ nextNativeForwardedNbl,
+ sendCompleteFlags,
+ sourcePort == switchContext->virtualExternalPortId);
+ continue;
+ }
+#endif
+
/* Ethernet Header is a guaranteed safe access. */
curNb = NET_BUFFER_LIST_FIRST_NB(curNbl);
if (curNb->Next != NULL) {
POVS_BUFFER_CONTEXT ctx;
OvsFlow *flow;
- fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl);
- sourcePort = fwdDetail->SourcePortId;
- sourceIndex = (NDIS_SWITCH_NIC_INDEX)fwdDetail->SourceNicIndex;
-
/* Take the DispatchLock so none of the VPORTs disconnect while
* we are setting destination ports.
*