Nithin,

This patch goes: Not acked-by: Samuel Ghinet <sghi...@cloudbasesolutions.com>

Regards,
Sam
________________________________________
Date: Fri, 29 Aug 2014 01:15:18 -0700
From: Nithin Raju <nit...@vmware.com>
To: dev@openvswitch.org
Subject: [ovs-dev] [PATCH 6/9 v2] datapath-windows: Check for device
        operation in OvsGetDpCmdHandler
Message-ID: <1409300121-13568-6-git-send-email-nit...@vmware.com>

A review comment was that we should check for device operation
rather than whether the dump context while deciding if the operation
is a dump start or a dump continue.

Signed-off-by: Nithin Raju <nit...@vmware.com>
Acked-by: Ankur Sharma <ankursha...@vmware.com>
Acked-by: Samuel Ghinet <sghi...@cloudbasesolutions.com>
---
 datapath-windows/ovsext/Datapath.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/Datapath.c 
b/datapath-windows/ovsext/Datapath.c
index 9a08556..417f463 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -827,14 +827,9 @@ OvsGetDpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
     POVS_OPEN_INSTANCE instance =
         (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance;

-    if (instance->dumpState.ovsMsg == NULL) {
+    if (usrParamsCtx->devOp == OVS_WRITE_DEV_OP) {
         NTSTATUS status;

-        if (usrParamsCtx->devOp != OVS_WRITE_DEV_OP) {
-            ASSERT(FALSE);
-            return STATUS_INVALID_DEVICE_STATE;
-        }
-
         /* input buffer has been validated while validating write dev op. */
         ASSERT(msgIn != NULL && usrParamsCtx->inputLength >= sizeof *msgIn);

@@ -844,12 +839,21 @@ OvsGetDpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
         }
         /* XXX: Handle other NLM_F_* flags in the future. */

+        /*
+         * This operation should be setting up the dump state. If there's any
+         * previous state, clear it up so as to set it up afresh.
+         */
+        if (instance->dumpState.ovsMsg != NULL) {
+            FreeUserDumpState(instance);
+        }
         status = InitUserDumpState(instance, msgIn);
         if (status != STATUS_SUCCESS) {
             return STATUS_NO_MEMORY;
         }
     } else {
-        if (usrParamsCtx->devOp != OVS_READ_DEV_OP) {
+        ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP);
+
+        if (instance->dumpState.ovsMsg == NULL) {
             ASSERT(FALSE);
             return STATUS_INVALID_DEVICE_STATE;
         }
--
1.7.4.1



------------------------------

Subject: Digest Footer

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


------------------------------

End of dev Digest, Vol 61, Issue 413
************************************
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to