Skip to content

Commit

Permalink
datapath-windows: Cleanup OVS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
svinturis authored and blp committed Dec 31, 2014
1 parent 1c1e46e commit eda457f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions datapath-windows/ovsext/Actions.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}

Expand All @@ -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;
}
}
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion datapath-windows/ovsext/Datapath.c
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion datapath-windows/ovsext/Flow.c
Expand Up @@ -1882,7 +1882,6 @@ RemoveFlow(OVS_DATAPATH *datapath,
{
OvsFlow *f = *flow;
*flow = NULL;
UNREFERENCED_PARAMETER(datapath);

ASSERT(datapath->nFlows);
datapath->nFlows--;
Expand Down

0 comments on commit eda457f

Please sign in to comment.