@@ -34,6 +34,7 @@
#include "Vport.h"
#include "Vxlan.h"
#include "Geneve.h"
+#include "IpFragment.h"
#ifdef OVS_DBG_MOD
#undef OVS_DBG_MOD
@@ -873,6 +874,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
NDIS_STATUS status = STATUS_SUCCESS;
POVS_SWITCH_CONTEXT switchContext = ovsFwdCtx->switchContext;
PCWSTR dropReason;
+ PNET_BUFFER_LIST fragNbl = NULL;
/*
* Handle the case where the some of the destination ports are tunneled
@@ -918,6 +920,30 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
goto dropit;
}
+ if (ovsFwdCtx->mru != 0) {
+ /* fragment nbl based on mru */
+ fragNbl = OvsFragmentNBL(ovsFwdCtx->switchContext,ovsFwdCtx->curNbl, &(ovsFwdCtx->layers),
+ ovsFwdCtx->mru, 0, TRUE);
+ if (fragNbl != NULL) {
+ OvsCompleteNBLForwardingCtx(ovsFwdCtx,
+ L"Dropped, failed to create fragments");
+ ovsFwdCtx->sendFlags |= NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP;
+ status = OvsInitForwardingCtx(ovsFwdCtx,
+ ovsFwdCtx->switchContext,
+ fragNbl,
+ ovsFwdCtx->srcVportNo,
+ ovsFwdCtx->sendFlags,
+ NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(fragNbl),
+ ovsFwdCtx->mru,
+ ovsFwdCtx->completionList,
+ &ovsFwdCtx->layers, FALSE);
+ if (status != NDIS_STATUS_SUCCESS) {
+ dropReason = L"Dropped due to resouces";
+ goto dropit;
+ }
+ }
+ }
+
OvsSendNBLIngress(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl,
ovsFwdCtx->sendFlags);
/* End this pipeline by resetting the corresponding context. */