[ovs-dev] [PATCH v4 2/3] datapath-windows: Add code for OvsGetQueue.
Ankur Sharma
ankursharma at vmware.com
Thu Oct 23 21:24:27 UTC 2014
Signed-off-by: Ankur Sharma <ankursharma at vmware.com>
Acked-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
---
datapath-windows/ovsext/User.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index 213d606..f6b1157 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -609,14 +609,25 @@ OvsGetNextPacket(POVS_OPEN_INSTANCE instance)
return CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link);
}
-
+/*
+ * ---------------------------------------------------------------------------
+ * Given a pid, returns the corresponding USER_PACKET_QUEUE.
+ * gOvsCtrlLock must be acquired before calling this API.
+ * ---------------------------------------------------------------------------
+ */
POVS_USER_PACKET_QUEUE
OvsGetQueue(UINT32 pid)
{
- /* XXX To be implemented. Return the queue assoiated with the pid*/
- UNREFERENCED_PARAMETER(pid);
- ASSERT(FALSE);
- return NULL;
+ POVS_OPEN_INSTANCE instance;
+ POVS_USER_PACKET_QUEUE ret = NULL;
+
+ instance = OvsGetPidInstance(gOvsSwitchContext, pid);
+
+ if (instance) {
+ ret = instance->packetQueue;
+ }
+
+ return ret;
}
/*
--
1.9.1
More information about the dev
mailing list