LG, minor comment. Thanks, Eitan
-----Original Message----- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ankur Sharma Sent: Tuesday, October 14, 2014 10:16 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2 2/2] datapath-windows: Transactional error fix for flow dump. My changes for trasacation error handling for not needed for dump commands. Fixed the same. Signed-off-by: Ankur Sharma <ankursha...@vmware.com> --- datapath-windows/ovsext/Flow.c | 50 +++++++++++------------------------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index f6e7bdb..3254223 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -381,48 +381,24 @@ OvsFlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, NTSTATUS rc = 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; + /* 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; [EITAN] rc is already set to STATUS_SUCCESS. (please use "status" rather than rc for NT status) + rc = STATUS_SUCCESS; + goto done; } + } else { + rc = _FlowNlDumpCmdHandler(usrParamsCtx, replyLen); } done: -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yTvML8OxA42Jb6ViHe7fUXbvPVOYDPVq87w43doxtlY%3D%0A&m=4EuZxka%2B05iR6xOM2wOxNMkeX7YabtEB0%2FIV11q%2FhmE%3D%0A&s=f10944ef49e74eb93788d4fd0cd2fa8211b3145f865c16a5f79b3bc8ee73fc5e _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
