[ovs-dev] [PATCH v1 5/5] datapath-windows: Fragment NBL based on MRU size

Anand Kumar kumaranand at vmware.com
Tue Jan 10 00:59:24 UTC 2017


MRU value is updated only for the Ipv4 fragments. If it is non zero,
then fragment the NBL based on MRU value and send out the new NBL to
the vnic.
---
 datapath-windows/ovsext/Actions.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c
index 9cc79dc..3156fb6 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -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. */
-- 
2.9.3.windows.1



More information about the dev mailing list