[ovs-dev] [PATCH] datapath-windows Event read handler

Samuel Ghinet sghinet at cloudbasesolutions.com
Thu Sep 25 17:08:53 UTC 2014


Hey Eitan,

>   */
>  #if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 1
> 
> +#pragma warning( push )
> +#pragma warning( disable:4127 )
> +
>  #include "precomp.h"
Could you put some doc comment saying what warning you are disabling, and perhaps, why? :)

You've got a few "else"-s like this:
>         }
>         else {
>             status = STATUS_NDIS_INVALID_LENGTH;
>             goto done;
>         }
And an added new line, I see.

>     msgOutTmp.ovsHdr.dp_ifindex = gOvsSwitchContext->dpNo;
> 
>     do {
> 
>         rc = NlMsgPutHead(nlBuf, (PCHAR)&msgOutTmp, sizeof msgOutTmp);
>         if (!rc) {
>             status = STATUS_INVALID_BUFFER_SIZE;
>             break;
>         }
> 
>         vport = OvsFindVportByPortNo(gOvsSwitchContext, eventEntry->portNo);
>         if (!vport) {
>             status = STATUS_DEVICE_DOES_NOT_EXIST;
>             break;
>         }
> 
>         rc = NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_PORT_NO, eventEntry->portNo) ||
>              NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_TYPE, vport->ovsType) ||
>              NlMsgPutTailString(nlBuf, OVS_VPORT_ATTR_NAME, vport->ovsName);
>         if (!rc) {
>             status = STATUS_INVALID_BUFFER_SIZE;
>             break;
>         }
> 
>         /* XXXX Should we add the port stats attributes?*/
>         nlMsg = (PNL_MSG_HDR)NlBufAt(nlBuf, 0, 0);
>         nlMsg->nlmsgLen = NlBufSize(nlBuf);
>         rc = STATUS_SUCCESS;
>     } while (FALSE);
1. What does "rc" stand for?
2. will it not be a problem if it would fail at the second "break", so that you put a message header (what length will it have?), and then you're out of buffer space?

How many events do you expect to be put there?
Also, I think the proper method would be to put as many as we can, and return success, not put as many as we can, and return STATUS_INVALID_BUFFER_SIZE. Am I missing something?
Also, what would be the case when rc will be STATUS_SUCCESS and it will break out of the loop?

Also, note that NlMsgPutTailU32 returns BOOLEAN: FALSE means error. If you break from the loop it will return rc == FALSE == STATUS_SUCCESS.

Also,
>     case OVS_IOCTL_READ_EVENT:
>         /* This IOCTL is used to read events */
>         if (outputBufferLen != 0) {
I see it shares some code with "case OVS_IOCTL_READ:"
An idea would be to extract a common function of the two.

Regards,
Sam

________________________________________
Message: 1
Date: Wed, 24 Sep 2014 16:36:28 -0700
From: Eitan Eliahu <eliahue at vmware.com>
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH] datapath-windows Event read handler
Message-ID: <1411601788-2024-1-git-send-email-eliahue at vmware.com>

The Read event handler is executed when user mode issues a socket receive on
an MC socket associated with the event queue. A new IOCTL READ command is
used to differentiate between transaction based and packet miss sockets.
An entry for the handler will be added once the Vport family implementation
checked in.
User mode code for setting the socket type will follow

Signed-off-by: Eitan Eliahu <eliahue at vmware.com>
---
 build-aux/extract-odp-netlink-windows-dp-h   |   4 +
 datapath-windows/include/OvsDpInterfaceExt.h |  10 +-
 datapath-windows/ovsext/Datapath.c           | 164 ++++++++++++++++++++++++++-
 datapath-windows/ovsext/Event.c              |  42 +++++++
 datapath-windows/ovsext/Event.h              |   2 +
 5 files changed, 219 insertions(+), 3 deletions(-)

diff --git a/build-aux/extract-odp-netlink-windows-dp-h b/build-aux/extract-odp-netlink-windows-dp-h
index 70514cb..82d95f1 100755
--- a/build-aux/extract-odp-netlink-windows-dp-h
+++ b/build-aux/extract-odp-netlink-windows-dp-h
@@ -23,3 +23,7 @@ s,#include <linux/if_ether\.h>,\n#ifndef ETH_ADDR_LEN \

 # Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN.
 s/ETH_ALEN/ETH_ADDR_LEN/
+
+s/OVS_VPORT_CMD_GET,/OVS_VPORT_CMD_GET,\
+       OVS_VPORT_CMD_NOTIFY,/
+
diff --git a/datapath-windows/include/OvsDpInterfaceExt.h b/datapath-windows/include/OvsDpInterfaceExt.h
index 64fd20e..be1e49f 100644
--- a/datapath-windows/include/OvsDpInterfaceExt.h
+++ b/datapath-windows/include/OvsDpInterfaceExt.h
@@ -34,11 +34,17 @@
 #define OVS_IOCTL_READ \
     CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x0, METHOD_OUT_DIRECT,\
               FILE_READ_ACCESS)
+#define OVS_IOCTL_READ_PACKET \
+    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x1, METHOD_OUT_DIRECT, \
+              FILE_READ_ACCESS)
+#define OVS_IOCTL_READ_EVENT \
+    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x2, METHOD_OUT_DIRECT, \
+              FILE_READ_ACCESS)
 #define OVS_IOCTL_WRITE \
-    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x1, METHOD_IN_DIRECT,\
+    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x3, METHOD_IN_DIRECT,\
               FILE_READ_ACCESS)
 #define OVS_IOCTL_TRANSACT \
-    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x2, METHOD_OUT_DIRECT,\
+    CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x4, METHOD_OUT_DIRECT,\
               FILE_WRITE_ACCESS)

 /*
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index 0dfdd57..bd34fdd 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -22,6 +22,9 @@
  */
 #if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 1

+#pragma warning( push )
+#pragma warning( disable:4127 )
+
 #include "precomp.h"
 #include "Datapath.h"
 #include "Jhash.h"
@@ -99,7 +102,8 @@ static NetlinkCmdHandler OvsGetPidCmdHandler,
                          OvsGetDpCmdHandler,
                          OvsPendEventCmdHandler,
                          OvsSubscribeEventCmdHandler,
-                         OvsSetDpCmdHandler;
+                         OvsSetDpCmdHandler,
+                         OvsReadEventCmdHandler;

 static NTSTATUS HandleGetDpTransaction(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
                                        UINT32 *replyLen);
@@ -620,6 +624,30 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject,
         devOp = OVS_TRANSACTION_DEV_OP;
         break;

+    case OVS_IOCTL_READ_EVENT:
+        /* This IOCTL is used to read events */
+        if (outputBufferLen != 0) {
+            status = MapIrpOutputBuffer(irp, outputBufferLen,
+                sizeof *ovsMsg, &outputBuffer);
+            if (status != STATUS_SUCCESS) {
+                goto done;
+            }
+            ASSERT(outputBuffer);
+        }
+        else {
+            status = STATUS_NDIS_INVALID_LENGTH;
+            goto done;
+        }
+        inputBuffer = NULL;
+        inputBufferLen = 0;
+
+        ovsMsg = &ovsMsgReadOp;
+        ovsMsg->nlMsg.nlmsgType = OVS_WIN_NL_VPORT_FAMILY_ID;
+        /* An "artificial" command so we can use NL family function table*/
+        ovsMsg->genlMsg.cmd = OVS_VPORT_CMD_NOTIFY;
+        devOp = OVS_READ_DEV_OP;
+        break;
+
     case OVS_IOCTL_READ:
         /* Output buffer is mandatory. */
         if (outputBufferLen != 0) {
@@ -924,6 +952,7 @@ OvsPendEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
     return status;
 }

+
 /*
  * --------------------------------------------------------------------------
  *  Handler for the subscription for the event queue
@@ -1214,4 +1243,137 @@ MapIrpOutputBuffer(PIRP irp,
     return STATUS_SUCCESS;
 }

+
+
+/*
+ * --------------------------------------------------------------------------
+ * Utility function to fill up information about the state of a port in a reply
+ * to* userspace.
+ * Assumes that 'gOvsCtrlLock' lock is acquired.
+ * --------------------------------------------------------------------------
+ */
+static NTSTATUS
+OvsPortFillInfo(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
+                POVS_EVENT_ENTRY eventEntry,
+                PNL_BUFFER nlBuf)
+{
+    NTSTATUS status;
+    BOOLEAN rc;
+    OVS_MESSAGE msgOutTmp;
+    PNL_MSG_HDR nlMsg;
+    POVS_VPORT_ENTRY vport;
+
+    ASSERT(NlBufAt(nlBuf, 0, 0) != 0 && nlBuf->bufRemLen >= sizeof msgOutTmp);
+
+    msgOutTmp.nlMsg.nlmsgType = OVS_WIN_NL_VPORT_FAMILY_ID;
+    msgOutTmp.nlMsg.nlmsgFlags = 0;  /* XXX: ? */
+    msgOutTmp.nlMsg.nlmsgSeq = 0; /* driver intiated messages should have */
+    msgOutTmp.nlMsg.nlmsgPid = usrParamsCtx->ovsInstance->pid;
+
+    msgOutTmp.genlMsg.version = nlVportFamilyOps.version;
+    msgOutTmp.genlMsg.reserved = 0;
+
+    /* we don't have netdev yet, treat link up/down a adding/removing a port*/
+    if (eventEntry->status & (OVS_EVENT_LINK_UP | OVS_EVENT_CONNECT)) {
+        msgOutTmp.genlMsg.cmd = OVS_VPORT_CMD_NEW;
+    }
+    else if (eventEntry->status &
+             (OVS_EVENT_LINK_DOWN | OVS_EVENT_DISCONNECT)){
+        msgOutTmp.genlMsg.cmd = OVS_VPORT_CMD_DEL;
+    }
+    else {
+        ASSERT(FALSE);
+        return STATUS_UNSUCCESSFUL;
+    }
+    msgOutTmp.ovsHdr.dp_ifindex = gOvsSwitchContext->dpNo;
+
+    do {
+
+        rc = NlMsgPutHead(nlBuf, (PCHAR)&msgOutTmp, sizeof msgOutTmp);
+        if (!rc) {
+            status = STATUS_INVALID_BUFFER_SIZE;
+            break;
+        }
+
+        vport = OvsFindVportByPortNo(gOvsSwitchContext, eventEntry->portNo);
+        if (!vport) {
+            status = STATUS_DEVICE_DOES_NOT_EXIST;
+            break;
+        }
+
+        rc = NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_PORT_NO, eventEntry->portNo) ||
+             NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_TYPE, vport->ovsType) ||
+             NlMsgPutTailString(nlBuf, OVS_VPORT_ATTR_NAME, vport->ovsName);
+        if (!rc) {
+            status = STATUS_INVALID_BUFFER_SIZE;
+            break;
+        }
+
+        /* XXXX Should we add the port stats attributes?*/
+        nlMsg = (PNL_MSG_HDR)NlBufAt(nlBuf, 0, 0);
+        nlMsg->nlmsgLen = NlBufSize(nlBuf);
+        rc = STATUS_SUCCESS;
+    } while (FALSE);
+
+    return rc;
+}
+
+
+/*
+ * --------------------------------------------------------------------------
+ * Handler for reading events from the driver event queue. This handler is
+ * executed when user modes issues a socket receive on a socket assocaited
+ * with the MC group for events.
+ * XXX user mode should read multiple events in one system call
+ * --------------------------------------------------------------------------
+ */
+static NTSTATUS
+OvsReadEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
+                       UINT32 *replyLen)
+{
+    POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx->outputBuffer;
+    POVS_OPEN_INSTANCE instance =
+        (POVS_OPEN_INSTANCE)usrParamsCtx->ovsInstance;
+    NL_BUFFER nlBuf;
+    NTSTATUS status;
+    OVS_EVENT_ENTRY eventEntry;
+
+    ASSERT(usrParamsCtx->devOp == OVS_READ_DEV_OP);
+
+    /* Should never read events with a dump socket */
+    ASSERT(instance->dumpState.ovsMsg == NULL);
+
+    /* Must have an event queue */
+    ASSERT(instance->eventQueue != NULL);
+
+    /* Output buffer has been validated while validating read dev op. */
+    ASSERT(msgOut != NULL && usrParamsCtx->outputLength >= sizeof *msgOut);
+
+    NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, usrParamsCtx->outputLength);
+
+    OvsAcquireCtrlLock();
+    if (!gOvsSwitchContext) {
+        OvsReleaseCtrlLock();
+        return status;
+    }
+
+    /* remove an event entry from the event queue */
+    status = OvsRemoveEventEntry(usrParamsCtx->ovsInstance, &eventEntry);
+    if (status != STATUS_SUCCESS) {
+        OvsReleaseCtrlLock();
+        return status;
+    }
+
+    status = OvsPortFillInfo(usrParamsCtx, &eventEntry, &nlBuf);
+    OvsReleaseCtrlLock();
+    if (status != STATUS_SUCCESS) {
+        return status;
+    }
+
+    *replyLen = NlBufSize(&nlBuf);;
+    return STATUS_SUCCESS;
+}
+
+#pragma warning( push )
 #endif /* OVS_USE_NL_INTERFACE */
+
diff --git a/datapath-windows/ovsext/Event.c b/datapath-windows/ovsext/Event.c
index fec3485..351d752 100644
--- a/datapath-windows/ovsext/Event.c
+++ b/datapath-windows/ovsext/Event.c
@@ -292,6 +292,7 @@ done_event_subscribe:
     return status;
 }

+#if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 0
 /*
  * --------------------------------------------------------------------------
  * Poll event queued in the event queue. always synchronous.
@@ -376,6 +377,7 @@ event_poll_done:
     OVS_LOG_TRACE("Exit: numEventPolled: %d", numEntry);
     return STATUS_SUCCESS;
 }
+#endif /* OVS_USE_NL_INTERFACE */


 /*
@@ -494,3 +496,43 @@ OvsWaitEventIoctl(PIRP irp,
     OVS_LOG_TRACE("Exit: return status: %#x", status);
     return status;
 }
+
+/*
+ *--------------------------------------------------------------------------
+ * Poll event queued in the event queue.always synchronous.
+ *
+ * Results:
+ *     STATUS_SUCCESS event was dequeued
+ *     STATUS_UNSUCCESSFUL the queue is empty.
+ * --------------------------------------------------------------------------
+ */
+NTSTATUS
+OvsRemoveEventEntry(POVS_OPEN_INSTANCE instance,
+                    POVS_EVENT_ENTRY entry)
+{
+    NTSTATUS status = STATUS_UNSUCCESSFUL;
+    POVS_EVENT_QUEUE queue;
+    POVS_EVENT_QUEUE_ELEM elem;
+
+    OvsAcquireEventQueueLock();
+
+    queue = (POVS_EVENT_QUEUE)instance->eventQueue;
+
+    if (queue == NULL) {
+        ASSERT(queue);
+        goto remove_event_done;
+    }
+
+    if (queue->numElems) {
+        elem = (POVS_EVENT_QUEUE_ELEM)RemoveHeadList(&queue->elemList);
+        entry->portNo = elem->portNo;
+        entry->status = elem->status;
+        OvsFreeMemory(elem);
+        queue->numElems--;
+        status = STATUS_SUCCESS;
+    }
+
+remove_event_done:
+    OvsReleaseEventQueueLock();
+    return status;
+}
diff --git a/datapath-windows/ovsext/Event.h b/datapath-windows/ovsext/Event.h
index f4801b9..a43a0bb 100644
--- a/datapath-windows/ovsext/Event.h
+++ b/datapath-windows/ovsext/Event.h
@@ -47,4 +47,6 @@ NTSTATUS OvsPollEventIoctl(PFILE_OBJECT fileObject, PVOID inputBuffer,
                            UINT32 outputLength, UINT32 *replyLen);
 NTSTATUS OvsWaitEventIoctl(PIRP irp, PFILE_OBJECT fileObject,
                            PVOID inputBuffer, UINT32 inputLength);
+NTSTATUS OvsRemoveEventEntry(PVOID instance, POVS_EVENT_ENTRY entry);
+
 #endif /* __EVENT_H_ */
--
1.9.4.msysgit.0



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

Message: 2
Date: Wed, 24 Sep 2014 16:13:59 +0000
From: Eitan Eliahu <eliahue at vmware.com>
To: Samuel Ghinet <sghinet at cloudbasesolutions.com>,
        "dev at openvswitch.org" <dev at openvswitch.org>
Cc: Kaushik Guha <kguha at vmware.com>
Subject: Re: [ovs-dev] [PATCH 1/3] datapath-windows: Add file
        NetlinkError.h
Message-ID: <87ffae5b375c4c2583bf540ff82a402a at EX13-MBX-018.vmware.com>
Content-Type: text/plain; charset="us-ascii"

Acked-by: Eitan Eliahu <eliahue at vmware.com>

-----Original Message-----
From: Samuel Ghinet [mailto:sghinet at cloudbasesolutions.com]
Sent: Wednesday, September 24, 2014 8:41 AM
To: dev at openvswitch.org
Cc: Alin Serdean; Eitan Eliahu; Nithin Raju; Saurabh Shah; Ankur Sharma; Kaushik Guha
Subject: [PATCH 1/3] datapath-windows: Add file NetlinkError.h

Contains error codes for netlink transactional errors.
These errors are passed to the "error" field of the NL_MSG_ERR struct.
The userspace requires them to be negative values: the nl_msg_nlmsgerr userspace function transforms them from negative to positive values.

These error codes correspond to the userspace error codes defined in:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\errno.h"

The transactional errors will be used for all netlink transactional operations.
This patch is required for the "vport get" netlink operation and will be used by most or all netlink transactional operations.

Signed-off-by: Samuel Ghinet <sghinet at cloudbasesolutions.com>
---
 datapath-windows/automake.mk                   |   1 +
 datapath-windows/ovsext/Datapath.c             |  10 ++
 datapath-windows/ovsext/Datapath.h             |  10 +-
 datapath-windows/ovsext/Netlink/NetlinkError.h | 200 +++++++++++++++++++++++++
 datapath-windows/ovsext/Netlink/NetlinkProto.h |   2 +-
 datapath-windows/ovsext/ovsext.vcxproj         |   3 +-
 datapath-windows/ovsext/precomp.h              |   1 +
 7 files changed, 224 insertions(+), 3 deletions(-)  create mode 100644 datapath-windows/ovsext/Netlink/NetlinkError.h

diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk index 297a809..ac9f28f 100644
--- a/datapath-windows/automake.mk
+++ b/datapath-windows/automake.mk
@@ -34,6 +34,7 @@ EXTRA_DIST += \
        datapath-windows/ovsext/Netlink/Netlink.h \
        datapath-windows/ovsext/Netlink/NetlinkBuf.c \
        datapath-windows/ovsext/Netlink/NetlinkBuf.h \
+    datapath-windows/ovsext/Netlink/NetlinkError.h \
        datapath-windows/ovsext/Netlink/NetlinkProto.h \
        datapath-windows/ovsext/NetProto.h \
        datapath-windows/ovsext/Oid.c \
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index c4c3b71..05c06b6 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -1211,6 +1211,16 @@ BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, UINT16 flags)
                 flags);
 }

+static VOID
+BuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgOut, UINT
+errorCode) {
+    BuildMsgOut(msgIn, (POVS_MESSAGE)msgOut, NLMSG_ERROR,
+                sizeof(OVS_MESSAGE_ERROR), 0);
+
+    msgOut->errorMsg.error = errorCode;
+    msgOut->errorMsg.nlMsg = msgIn->nlMsg; }
+
 static NTSTATUS
 OvsCreateMsgFromVport(POVS_VPORT_ENTRY vport,
                       POVS_MESSAGE msgIn, diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h
index 4e6c9b1..73e6654 100644
--- a/datapath-windows/ovsext/Datapath.h
+++ b/datapath-windows/ovsext/Datapath.h
@@ -29,7 +29,7 @@
 #define __DATAPATH_H_ 1

 /*
- * Structure of any message passed between userspace and kernel.
+ * Structure of a general message passed between userspace and kernel.
  */
 typedef struct _OVS_MESSAGE {
     NL_MSG_HDR nlMsg;
@@ -38,6 +38,14 @@ typedef struct _OVS_MESSAGE {
     /* Variable length nl_attrs follow. */  } OVS_MESSAGE, *POVS_MESSAGE;

+/*
+ * Structure of an error message sent as a reply from kernel.
+ */
+typedef struct _OVS_MESSAGE_ERROR {
+    NL_MSG_HDR nlMsg;
+    NL_MSG_ERR errorMsg;
+} OVS_MESSAGE_ERROR, *POVS_MESSAGE_ERROR;
+
 typedef struct _OVS_DEVICE_EXTENSION {
     INT numberOpenInstance;
     INT pidCount;
diff --git a/datapath-windows/ovsext/Netlink/NetlinkError.h b/datapath-windows/ovsext/Netlink/NetlinkError.h
new file mode 100644
index 0000000..46ebc5e
--- /dev/null
+++ b/datapath-windows/ovsext/Netlink/NetlinkError.h
@@ -0,0 +1,200 @@
+/*
+* Copyright 2014 Cloudbase Solutions Srl
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http :/*www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#pragma once
+
+#include "precomp.h"
+
+/*
+ * These are error codes to be used by netlink transactional operations.
+ * The error code is assigned to the "error" field (INT) of the
+NL_MSG_ERR
+ * struct.
+*/
+
+typedef enum _NL_ERROR_
+{
+    NL_ERROR_SUCCESS = 0,
+    /* The operation is not permitted */
+    NL_ERROR_PERM = ((ULONG)-1),
+    /* There is no such file or directory */
+    NL_ERROR_NOENT = ((ULONG)-2),
+    /* There is no such process */
+    NL_ERROR_SRCH = ((ULONG)-3),
+    /* An interrupted system call / interrupted function */
+    NL_ERROR_INTR = ((ULONG)-4),
+    /* An I/O error */
+    NL_ERROR_IO = ((ULONG)-5),
+    /* There is no such device or address */
+    NL_ERROR_NXIO = ((ULONG)-6),
+    /* The argument list is too long */
+    NL_ERROR_2BIG = ((ULONG)-7),
+    /* Executable file format error */
+    NL_ERROR_NOEXEC = ((ULONG)-8),
+    /* A bad file descriptor / number */
+    NL_ERROR_BADF = ((ULONG)-9),
+    /* Have no child processes */
+    NL_ERROR_CHILD = ((ULONG)-10),
+    /* resource unavailable => try again later */
+    NL_ERROR_AGAIN = ((ULONG)-11),
+    /* We're out of memory */
+    NL_ERROR_NOMEM = ((ULONG)-12),
+    /* Permission is denied */
+    NL_ERROR_ACCES = ((ULONG)-13),
+    /* A bad address */
+    NL_ERROR_FAULT = ((ULONG)-14),
+
+    /* The device or the resource is busy */
+    NL_ERROR_BUSY = ((ULONG)-16),
+    /* The file exists */
+    NL_ERROR_EXIST = ((ULONG)-17),
+    /* A cross-device link */
+    NL_ERROR_XDEV = ((ULONG)-18),
+    /* There is no such device */
+    NL_ERROR_NODEV = ((ULONG)-19),
+    /* It is not a directory, nor a symbolic link to a directory. */
+    NL_ERROR_NOTDIR = ((ULONG)-20),
+    /* This is a directory */
+    NL_ERROR_ISDIR = ((ULONG)-21),
+    /* An invalid argument */
+    NL_ERROR_INVAL = ((ULONG)-22),
+    /*
+     * There are too many files open in system (i.e. no room for another file
+     * descriptor)
+     */
+    NL_ERROR_NFILE = ((ULONG)-23),
+    /* The file descriptor value is too large. */
+    NL_ERROR_MFILE = ((ULONG)-24),
+    /* And Inappropriate I/O control operation. Or, this is not a typewriter */
+    NL_ERROR_NOTTY = ((ULONG)-25),
+
+    /* The file is too large */
+    NL_ERROR_FBIG = ((ULONG)-27),
+    /* There is no space left on the device */
+    NL_ERROR_NOSPC = ((ULONG)-28),
+    /* This is an invalid seek */
+    NL_ERROR_SPIPE = ((ULONG)-29),
+    /* A read-only file system */
+    NL_ERROR_ROFS = ((ULONG)-30),
+    /* There are too many links */
+    NL_ERROR_MLINK = ((ULONG)-31),
+    /* A broken pipe */
+    NL_ERROR_PIPE = ((ULONG)-32),
+    /* The mathematics argument is out of the domain of the function. */
+    NL_ERROR_DOM = ((ULONG)-33),
+    /* The result is too large / cannot be represented */
+    NL_ERROR_RANGE = ((ULONG)-34),
+    /* A resource deadlock would occur */
+    NL_ERROR_DEADLK = ((ULONG)-36),
+
+    /* The file name is too long */
+    NL_ERROR_NAMETOOLONG = ((ULONG)-38),
+    /* There are no locks available */
+    NL_ERROR_NOLCK = ((ULONG)-39),
+
+    /* The function is not implemented / not supported */
+    NL_ERROR_NOSYS = ((ULONG)-40),
+    /* The directory is not empty */
+    NL_ERROR_NOTEMPTY = ((ULONG)-41),
+    /* The byte sequence is illegal */
+    NL_ERROR_ILSEQ = ((ULONG)-42),
+
+    NL_ERROR_STRUNCATE = ((ULONG)-80),
+
+    /* The address is already in use */
+    NL_ERROR_ADDRINUSE = ((ULONG)-100),
+    /* The requested address cannot be assigned: is is not available */
+    NL_ERROR_ADDRNOTAVAIL = ((ULONG)-101),
+    /* the address family is not supported by the protocol */
+    NL_ERROR_AFNOSUPPORT = ((ULONG)-102),
+    /* The operation / connection is already in progress */
+    NL_ERROR_ALREADY = ((ULONG)-103),
+    /* The message is bad */
+    NL_ERROR_BADMSG = ((ULONG)-104),
+    /* The operation was canceled */
+    NL_ERROR_CANCELED = ((ULONG)-105),
+    /* The software has caused a connection abort */
+    NL_ERROR_CONNABORTED = ((ULONG)-106),
+    /*The connection was refused */
+    NL_ERROR_CONNREFUSED = ((ULONG)-107),
+    /* The connection was reset by the peer */
+    NL_ERROR_CONNRESET = ((ULONG)-108),
+    /* The destination address is required */
+    NL_ERROR_DESTADDRREQ = ((ULONG)-109),
+    /*The host is unreachable */
+    NL_ERROR_HOSTUNREACH = ((ULONG)-110),
+    /* The identifier was removed */
+    NL_ERROR_IDRM = ((ULONG)-111),
+    /* The operations is in progress */
+    NL_ERROR_INPROGRESS = ((ULONG)-112),
+    /* The socket is already connected */
+    NL_ERROR_ISCONN = ((ULONG)-113),
+    /* There are too many levels of symbolic links. */
+    NL_ERROR_LOOP = ((ULONG)-114),
+    /*The message is too large */
+    NL_ERROR_MSGSIZE = ((ULONG)-115),
+    /* The network is down */
+    NL_ERROR_NETDOWN = ((ULONG)-116),
+    /* The network has dropped connection because of a reset (i.e. the
+     * connection was aborted by the network)
+    */
+    NL_ERROR_NETRESET = ((ULONG)-117),
+    /* The network is unreachable */
+    NL_ERROR_NETUNREACH = ((ULONG)-118),
+    /* There is no buffer space available */
+    NL_ERROR_NOBUFS = ((ULONG)-119),
+    /* There is no data available (on the stream head read queue) */
+    NL_ERROR_NODATA = ((ULONG)-120),
+    /* The link has been severed (it's reserved in posix) */
+    NL_ERROR_NOLINK = ((ULONG)-121),
+    /* There is no message of the desired type */
+    NL_ERROR_NOMSG = ((ULONG)-122),
+    /* The protocol is not available */
+    NL_ERROR_NOPROTOOPT = ((ULONG)-123),
+    /* We're out of streams resources */
+    NL_ERROR_NOSR = ((ULONG)-124),
+    /* This is not a stream */
+    NL_ERROR_NOSTR = ((ULONG)-125),
+    /* The socket is not connected */
+    NL_ERROR_NOTCONN = ((ULONG)-126),
+    /* The state is not recoverable */
+    NL_ERROR_NOTRECOVERABLE = ((ULONG)-127),
+    /* This is not a socket */
+    NL_ERROR_NOTSOCK = ((ULONG)-128),
+    /* The operation is not supported */
+    NL_ERROR_NOTSUPP = ((ULONG)-129),
+    /* The operation is not supported on socket */
+    NL_ERROR_OPNOTSUPP = ((ULONG)-130),
+
+    NL_ERROR_OTHER = ((ULONG)-131),
+    /* The value is too large for the data type */
+    NL_ERROR_OVERFLOW = ((ULONG)-132),
+    /* The previous owner died */
+    NL_ERROR_OWNERDEAD = ((ULONG)-133),
+    /* A protocol error */
+    NL_ERROR_PROTO = ((ULONG)-134),
+    /* The protocol is not supported */
+    NL_ERROR_PROTONOSUPPORT = ((ULONG)-135),
+    /* This is a wrong protocol type for the socket */
+    NL_ERROR_PROTOTYPE = ((ULONG)-136),
+    /* The timer has expired (or, the stream ioctl has timed out) */
+    NL_ERROR_TIME = ((ULONG)-137),
+    /* The connection has timed out */
+    NL_ERROR_TIMEDOUT = ((ULONG)-138),
+    /* The given text file is busy */
+    NL_ERROR_TXTBSY = ((ULONG)-139),
+    /*the operation would block */
+    NL_ERROR_WOULDBLOCK = ((ULONG)-140), } NL_ERROR;
\ No newline at end of file
diff --git a/datapath-windows/ovsext/Netlink/NetlinkProto.h b/datapath-windows/ovsext/Netlink/NetlinkProto.h
index 2c438a6..f2e9aee 100644
--- a/datapath-windows/ovsext/Netlink/NetlinkProto.h
+++ b/datapath-windows/ovsext/Netlink/NetlinkProto.h
@@ -87,7 +87,7 @@ BUILD_ASSERT_DECL(sizeof(NL_MSG_HDR) == 16);  typedef struct _NlMsgErr  {
     INT error;
-    NL_MSG_HDR msg;
+    NL_MSG_HDR nlMsg;
 } NL_MSG_ERR, *PNL_MSG_ERR;
 BUILD_ASSERT_DECL(sizeof(NL_MSG_ERR) == 20);

diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj
index a918361..190ce12 100644
--- a/datapath-windows/ovsext/ovsext.vcxproj
+++ b/datapath-windows/ovsext/ovsext.vcxproj
@@ -85,6 +85,7 @@
     <ClInclude Include="Netlink/Netlink.h" />
     <ClInclude Include="Netlink/NetlinkBuf.h" />
     <ClInclude Include="Netlink/NetlinkProto.h" />
+    <ClInclude Include="Netlink\NetlinkError.h" />
     <ClInclude Include="NetProto.h" />
     <ClInclude Include="Oid.h" />
     <ClInclude Include="PacketIO.h" />
@@ -170,4 +171,4 @@
     <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
+</Project>
\ No newline at end of file
diff --git a/datapath-windows/ovsext/precomp.h b/datapath-windows/ovsext/precomp.h
index 6e40308..3c088d0 100644
--- a/datapath-windows/ovsext/precomp.h
+++ b/datapath-windows/ovsext/precomp.h
@@ -26,6 +26,7 @@
 #include "..\include\OvsDpInterface.h"

 #include "Util.h"
+#include "Netlink/NetlinkError.h"
 #include "Netlink/Netlink.h"
 #include "Netlink/NetlinkProto.h"

--
1.8.3.msysgit.0



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

Subject: Digest Footer

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


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

End of dev Digest, Vol 62, Issue 324
************************************



More information about the dev mailing list