datapath-windows: Cleanup OVS
authorSorin Vinturis <svinturis@cloudbasesolutions.com>
Thu, 11 Dec 2014 12:51:36 +0000 (12:51 +0000)
committerBen Pfaff <blp@nicira.com>
Wed, 31 Dec 2014 17:48:00 +0000 (09:48 -0800)
Removed duplicate include of "Switch.h" header.
Removed useless usage of UNREFERENCED_PARAMETER macro for a
referenced parameter.
Added debug logs for dropped packets.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/Actions.c
datapath-windows/ovsext/Datapath.c
datapath-windows/ovsext/Flow.c

index dfa5ecb..a93fe03 100644 (file)
@@ -764,6 +764,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
 {
     NDIS_STATUS status = STATUS_SUCCESS;
     POVS_SWITCH_CONTEXT switchContext = ovsFwdCtx->switchContext;
+    PCWSTR dropReason;
 
     /*
      * Handle the case where the some of the destination ports are tunneled
@@ -792,6 +793,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
             if (newNbl == NULL) {
                 status = NDIS_STATUS_RESOURCES;
                 ovsActionStats.noCopiedNbl++;
+                dropReason = L"Dropped due to failure to create NBL copy.";
                 goto dropit;
             }
         }
@@ -804,6 +806,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
         if (status != NDIS_STATUS_SUCCESS) {
             OvsCompleteNBL(ovsFwdCtx->switchContext, newNbl, TRUE);
             ovsActionStats.cannotGrowDest++;
+            dropReason = L"Dropped due to failure to update destinations.";
             goto dropit;
         }
 
@@ -819,8 +822,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
                                           ovsFwdCtx->completionList,
                                           &ovsFwdCtx->layers, FALSE);
             if (status != NDIS_STATUS_SUCCESS) {
-                OvsCompleteNBLForwardingCtx(ovsFwdCtx,
-                                            L"Dropped due to resouces");
+                dropReason = L"Dropped due to resouces.";
                 goto dropit;
             }
         }
@@ -841,7 +843,7 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx)
 
 dropit:
     if (status != NDIS_STATUS_SUCCESS) {
-        OvsCompleteNBLForwardingCtx(ovsFwdCtx, L"Dropped due to XXX");
+        OvsCompleteNBLForwardingCtx(ovsFwdCtx, dropReason);
     }
 
     return status;
index 7244b31..2d0ff00 100644 (file)
@@ -26,7 +26,6 @@
 #include "User.h"
 #include "Datapath.h"
 #include "Jhash.h"
-#include "Switch.h"
 #include "Vport.h"
 #include "Event.h"
 #include "User.h"
index 93f37a0..044fde5 100644 (file)
@@ -1882,7 +1882,6 @@ RemoveFlow(OVS_DATAPATH *datapath,
 {
     OvsFlow *f = *flow;
     *flow = NULL;
-    UNREFERENCED_PARAMETER(datapath);
 
     ASSERT(datapath->nFlows);
     datapath->nFlows--;