summaryrefslogtreecommitdiff
path: root/datapath-windows
diff options
context:
space:
mode:
authorEitan Eliahu <eliahue@vmware.com>2014-10-20 18:23:00 -0700
committerBen Pfaff <blp@nicira.com>2014-10-20 15:49:39 -0700
commitf73dc82170af34e224dca703b93640134f0372af (patch)
tree197eab9c673460e5dde27def6a363e273a1b9c60 /datapath-windows
parentc48f691f3fcac853ee90d1219997147fc2af631b (diff)
downloadopenvswitch-f73dc82170af34e224dca703b93640134f0372af.tar.gz
datapath-windows: Implement missed packet kernel-to-user mode notification.
An I/O request is queued in Kernel to be completed upon a packet mismatch. This mechanism is similar to the port state notification. Access to instance data should be under a lock (TBD) Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Diffstat (limited to 'datapath-windows')
-rw-r--r--datapath-windows/include/OvsDpInterfaceExt.h1
-rw-r--r--datapath-windows/ovsext/Datapath.c30
2 files changed, 31 insertions, 0 deletions
diff --git a/datapath-windows/include/OvsDpInterfaceExt.h b/datapath-windows/include/OvsDpInterfaceExt.h
index 953c8ba31..cea9e4124 100644
--- a/datapath-windows/include/OvsDpInterfaceExt.h
+++ b/datapath-windows/include/OvsDpInterfaceExt.h
@@ -77,6 +77,7 @@
enum ovs_win_control_cmd {
OVS_CTRL_CMD_WIN_GET_PID,
OVS_CTRL_CMD_WIN_PEND_REQ,
+ OVS_CTRL_CMD_WIN_PEND_PACKET_REQ,
OVS_CTRL_CMD_MC_SUBSCRIBE_REQ,
OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ,
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index fae824a85..79e7c7d27 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -91,6 +91,7 @@ typedef struct _NETLINK_FAMILY {
/* Handlers for the various netlink commands. */
static NetlinkCmdHandler OvsGetPidCmdHandler,
OvsPendEventCmdHandler,
+ OvsPendPacketCmdHandler,
OvsSubscribeEventCmdHandler,
OvsSubscribePacketCmdHandler,
OvsReadEventCmdHandler,
@@ -131,6 +132,11 @@ NETLINK_CMD nlControlFamilyCmdOps[] = {
.supportedDevOp = OVS_WRITE_DEV_OP,
.validateDpIndex = TRUE,
},
+ { .cmd = OVS_CTRL_CMD_WIN_PEND_PACKET_REQ,
+ .handler = OvsPendPacketCmdHandler,
+ .supportedDevOp = OVS_WRITE_DEV_OP,
+ .validateDpIndex = TRUE,
+ },
{ .cmd = OVS_CTRL_CMD_MC_SUBSCRIBE_REQ,
.handler = OvsSubscribeEventCmdHandler,
.supportedDevOp = OVS_WRITE_DEV_OP,
@@ -2399,4 +2405,28 @@ OvsSubscribePacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
done:
return status;
}
+
+/*
+ * --------------------------------------------------------------------------
+ * Handler for queueing an IRP used for missed packet notification. The IRP is
+ * completed when a packet received and mismatched. STATUS_PENDING is returned
+ * on success. User mode keep a pending IRP at all times.
+ * --------------------------------------------------------------------------
+ */
+static NTSTATUS
+OvsPendPacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
+ UINT32 *replyLen)
+{
+ UNREFERENCED_PARAMETER(replyLen);
+
+ POVS_OPEN_INSTANCE instance =
+ (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance;
+
+ /*
+ * XXX access to packet queue must be through acquiring a lock as user mode
+ * could unsubscribe and the instnace will be freed.
+ */
+ return OvsWaitDpIoctl(usrParamsCtx->irp, instance->fileObject);
+}
+
#endif /* OVS_USE_NL_INTERFACE */