Skip to content

Commit

Permalink
datapath-windows: Transactional error fix for flow dump.
Browse files Browse the repository at this point in the history
My changes for trasacation error handling for not needed for dump commands.
Fixed the same.

Signed-off-by: Ankur Sharma <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Acked-by: Eitan Eliahu <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
ankursh authored and blp committed Oct 15, 2014
1 parent 640ebde commit 8aec999
Showing 1 changed file with 18 additions and 43 deletions.
61 changes: 18 additions & 43 deletions datapath-windows/ovsext/Flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,

done:

if ((nlError != NL_ERROR_SUCCESS) &&
(usrParamsCtx->outputBuffer)) {
if (nlError != NL_ERROR_SUCCESS) {
POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)
usrParamsCtx->outputBuffer;
BuildErrorMsg(msgIn, msgError, nlError);
Expand All @@ -374,55 +373,31 @@ NTSTATUS
OvsFlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
UINT32 *replyLen)
{
NTSTATUS rc = STATUS_SUCCESS;
NTSTATUS status = STATUS_SUCCESS;
NL_ERROR nlError = NL_ERROR_SUCCESS;
POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx->inputBuffer;
POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer;
PNL_MSG_HDR nlMsgHdr = &(msgIn->nlMsg);
PGENL_MSG_HDR genlMsgHdr = &(msgIn->genlMsg);
POVS_HDR ovsHdr = &(msgIn->ovsHdr);

NL_BUFFER nlBuf;

if (!(usrParamsCtx->outputBuffer)) {
/* No output buffer */
rc = STATUS_INVALID_BUFFER_SIZE;
goto done;
}

if (usrParamsCtx->devOp == OVS_TRANSACTION_DEV_OP) {
rc = _FlowNlGetCmdHandler(usrParamsCtx, replyLen);
} else {
rc = _FlowNlDumpCmdHandler(usrParamsCtx, replyLen);
}

if ((nlError != NL_ERROR_SUCCESS) &&
(usrParamsCtx->outputBuffer)) {
POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)
usrParamsCtx->outputBuffer;
BuildErrorMsg(msgIn, msgError, nlError);
*replyLen = msgError->nlMsg.nlmsgLen;
rc = STATUS_SUCCESS;
goto done;
}

if (rc == STATUS_SUCCESS) {
NlBufInit(&nlBuf, usrParamsCtx->outputBuffer,
usrParamsCtx->outputLength);

/* Prepare nl Msg headers */
rc = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0,
nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid,
genlMsgHdr->cmd, OVS_FLOW_VERSION,
ovsHdr->dp_ifindex);

if (rc == STATUS_SUCCESS) {
*replyLen = msgOut->nlMsg.nlmsgLen;
status = _FlowNlGetCmdHandler(usrParamsCtx, replyLen);

/* No trasanctional errors as of now.
* If we have something then we need to convert rc to
* nlError. */
if ((nlError != NL_ERROR_SUCCESS) &&
(usrParamsCtx->outputBuffer)) {
POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)
usrParamsCtx->outputBuffer;
BuildErrorMsg(msgIn, msgError, nlError);
*replyLen = msgError->nlMsg.nlmsgLen;
status = STATUS_SUCCESS;
goto done;
}
} else {
status = _FlowNlDumpCmdHandler(usrParamsCtx, replyLen);
}

done:
return rc;
return status;
}

/*
Expand Down

0 comments on commit 8aec999

Please sign in to comment.