[ovs-dev] [PATCH v2 2/2] datapath-windows: Transactional error fix for flow dump.

Nithin Raju nithin at vmware.com
Tue Oct 14 21:44:47 UTC 2014


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

We can retain this code as:
     if (usrParamsCtx->devOp == OVS_TRANSACTION_DEV_OP && !(usrParamsCtx->outputBuffer)) {
                    //
     }


> 
>     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)) {

No need to check for outputBuffer if we checked earlier.

Looks good otherwise.

Acked-by: Nithin Raju <nithin at vmware.com>




More information about the dev mailing list