[ovs-dev] [PATCH 6/9 v2] datapath-windows: Check for device operation in OvsGetDpCmdHandler

Samuel Ghinet sghinet at cloudbasesolutions.com
Fri Aug 29 10:42:31 UTC 2014


Nithin,

This patch goes: Not acked-by: Samuel Ghinet <sghinet at cloudbasesolutions.com>

Regards,
Sam
________________________________________
Date: Fri, 29 Aug 2014 01:15:18 -0700
From: Nithin Raju <nithin at vmware.com>
To: dev at 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-nithin at 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 <nithin at vmware.com>
Acked-by: Ankur Sharma <ankursharma at vmware.com>
Acked-by: Samuel Ghinet <sghinet at 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 at openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


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

End of dev Digest, Vol 61, Issue 413
************************************



More information about the dev mailing list