[ovs-dev] [PATCH 1/4] datapath-windows: event read should not fail when no events
Ankur Sharma
ankursharma at vmware.com
Fri Oct 17 16:37:16 UTC 2014
Acked-by: Ankur Sharma <ankursharma at vmware.com>
________________________________________
From: dev <dev-bounces at openvswitch.org> on behalf of Nithin Raju <nithin at vmware.com>
Sent: Thursday, October 16, 2014 10:52 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH 1/4] datapath-windows: event read should not fail when no events
The semantics are read operation are generally to return 0 bytes and
STATUS_SUCCESS when there are no events.
Also, added a fix to assign the PID to the synthetic OVS_MESSAGE formed
for the command validation.
Signed-off-by: Nithin Raju <nithin at vmware.com>
---
datapath-windows/ovsext/Datapath.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index 6cb9398..0d87a6d 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -728,6 +728,7 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject,
ovsMsg = &ovsMsgReadOp;
ovsMsg->nlMsg.nlmsgType = OVS_WIN_NL_CTRL_FAMILY_ID;
+ ovsMsg->nlMsg.nlmsgPid = instance->pid;
/* An "artificial" command so we can use NL family function table*/
ovsMsg->genlMsg.cmd = (code == OVS_IOCTL_READ_EVENT) ?
OVS_CTRL_CMD_EVENT_NOTIFY :
@@ -2289,6 +2290,9 @@ OvsReadEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
/* remove an event entry from the event queue */
status = OvsRemoveEventEntry(usrParamsCtx->ovsInstance, &eventEntry);
if (status != STATUS_SUCCESS) {
+ /* If there were not elements, read should return no data. */
+ status = STATUS_SUCCESS;
+ *replyLen = 0;
goto cleanup;
}
--
1.7.4.1
_______________________________________________
dev mailing list
dev at openvswitch.org
https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=f6EhnZ0ORGZNt5QbYmRaOxfWfx%2Bqd3KEiPf3%2FYaollU%3D%0A&m=%2FM48eUyd5BYNGeIWYk67G8U7RLWOj6ZeioDQvBuNaaM%3D%0A&s=e084fcae0762e210e4e83ec84fd6525c6290b4bfbae4d92f7844f6ff532fce7e
More information about the dev
mailing list