Re: [ovs-dev] [PATCH]lib/stream-windows.c: Grant Access Privilege of Named Pipe to Creator

2020-01-24 Thread Anand Kumar via dev
Acked-by: Anand Kumar  

Thanks,
Anand Kumar

On 1/22/20, 12:19 AM, "Ning Wu"  wrote:

From e42950665acee9aab941b26ebdd067ca0de908a3 Mon Sep 17 00:00:00 2001
From: Ning Wu 
Date: Tue, 21 Jan 2020 23:46:58 -0800
Subject: [PATCH]lib/stream-windows.c: Grant Access Privilege of Named Pipe 
to Creator

Current implementation of ovs on windows only allows LocalSystem and
Administrators to access the named pipe created with API of ovs.
Thus any service that needs to invoke the API to create named pipe
has to run as System account to interactive with ovs. It causes the
system more vulnerable if one of those services was break into.
The patch adds the creator owner account to allowed ACLs.

Signed-off-by: Ning Wu 
---
 Documentation/ref/ovsdb.7.rst |  3 ++-
 lib/stream-windows.c  | 33 -
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/Documentation/ref/ovsdb.7.rst b/Documentation/ref/ovsdb.7.rst
index b1f3f5d..da4dbed 100644
--- a/Documentation/ref/ovsdb.7.rst
+++ b/Documentation/ref/ovsdb.7.rst
@@ -422,7 +422,8 @@ punix:
 named .
 
 On Windows, listens on a local named pipe, creating a named pipe
- to mimic the behavior of a Unix domain socket.
+ to mimic the behavior of a Unix domain socket. The ACLs of the 
named
+pipe include LocalSystem, Administrators, and Creator Owner.
 
 All IP-based connection methods accept IPv4 and IPv6 addresses.  To 
specify an
 IPv6 address, wrap it in square brackets, e.g.  ``ssl:[::1]:6640``.  
Passive
diff --git a/lib/stream-windows.c b/lib/stream-windows.c
index 34bc610..5c4c55e 100644
--- a/lib/stream-windows.c
+++ b/lib/stream-windows.c
@@ -41,7 +41,7 @@ static void maybe_unlink_and_free(char *path);
 #define LOCAL_PREFIX ".\\pipe\\"
 
 /* Size of the allowed PSIDs for securing Named Pipe. */
-#define ALLOWED_PSIDS_SIZE 2
+#define ALLOWED_PSIDS_SIZE 3
 
 /* This function has the purpose to remove all the slashes received in s. 
*/
 static char *
@@ -412,6 +412,9 @@ create_pnpipe(char *name)
 PACL acl = NULL;
 PSECURITY_DESCRIPTOR psd = NULL;
 HANDLE npipe;
+HANDLE hToken = NULL;
+DWORD dwBufSize = 0;
+PTOKEN_USER pTokenUsr = NULL;
 
 /* Disable access over network. */
 if (!AllocateAndInitializeSid(, 1, SECURITY_NETWORK_RID,
@@ -438,6 +441,32 @@ create_pnpipe(char *name)
 goto handle_error;
 }
 
+/* Open the access token of calling process */
+if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, )) {
+VLOG_ERR_RL(, "Error opening access token of calling process.");
+goto handle_error;
+}
+
+/* get the buffer size buffer needed for SID */
+GetTokenInformation(hToken, TokenUser, NULL, 0, );
+
+pTokenUsr = xmalloc(dwBufSize);
+memset(pTokenUsr, 0, dwBufSize);
+
+/* Retrieve the token information in a TOKEN_USER structure. */
+if (!GetTokenInformation(hToken, TokenUser, pTokenUsr, dwBufSize,
+)) {
+VLOG_ERR_RL(, "Error retrieving token information.");
+goto handle_error;
+}
+CloseHandle(hToken);
+
+if (!IsValidSid(pTokenUsr->User.Sid)) {
+VLOG_ERR_RL(, "Invalid SID.");
+goto handle_error;
+}
+allowedPsid[2] = pTokenUsr->User.Sid;
+
 for (int i = 0; i < ALLOWED_PSIDS_SIZE; i++) {
 aclSize += sizeof(ACCESS_ALLOWED_ACE) +
GetLengthSid(allowedPsid[i]) -
@@ -490,11 +519,13 @@ create_pnpipe(char *name)
 npipe = CreateNamedPipe(name, PIPE_ACCESS_DUPLEX | 
FILE_FLAG_OVERLAPPED,
 PIPE_TYPE_MESSAGE | PIPE_READMODE_BYTE | 
PIPE_WAIT,
 64, BUFSIZE, BUFSIZE, 0, );
+free(pTokenUsr);
 free(acl);
 free(psd);
 return npipe;
 
 handle_error:
+free(pTokenUsr);
 free(acl);
 free(psd);
 return INVALID_HANDLE_VALUE;
-- 
2.6.2

-Original Message-
From: Alin Serdean  
Sent: Wednesday, January 22, 2020 12:19
To: Ning Wu ; d...@openvswitch.org; Anand Kumar 

Cc: Lina Li ; Roy Luo 
Subject: RE: [PATCH] Grant Access Privilege of Named Pipe to Creator

Hi,

Sorry I missed the email.

The direction sounds ok with me. It will surely help with unit tests, since 
right now they require elevated permissions.

Adding also Anand in the loop.
Anand do you like the idea?

Please also add a few lines to the documentation so users are aware of the 
change.

The patch as is, fails to apply. Rebase on master.

Also please change the title so it is in compliance 

[ovs-dev] [PATCH v1] datapath-windows: Fix updating ct label when mask is specified

2019-08-15 Thread Anand Kumar via dev
From: kumaranand 

When an existing label needs to be changed by specifing bits to be
updated using mask, instead of updating only the masked bits,
new label was getting overridden. This patch fixes this issue.

Signed-off-by: Anand Kumar 
---
 datapath-windows/ovsext/Conntrack.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
index bc00b60..ba56116 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -807,6 +807,7 @@ OvsConntrackSetLabels(OvsFlowKey *key,
 ovs_u128 v, m, pktMdLabel = {0};
 memcpy(, val, sizeof v);
 memcpy(, mask, sizeof m);
+memcpy(, >labels, sizeof(struct ovs_key_ct_labels));
 
 pktMdLabel.u64.lo = v.u64.lo | (pktMdLabel.u64.lo & ~(m.u64.lo));
 pktMdLabel.u64.hi = v.u64.hi | (pktMdLabel.u64.hi & ~(m.u64.hi));
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] [windows][wmi] Switch from internal port to all ports defined

2019-07-31 Thread Anand Kumar via dev
Acked-by: Anand Kumar 

Thanks,
Anand Kumar

-- Forwarded message -
From: Alin Gabriel Serdean mailto:aserd...@ovn.org>>
Date: Mon, Mar 25, 2019 at 3:13 AM
Subject: [ovs-dev] [PATCH] [windows][wmi] Switch from internal port to all 
ports defined
To: mailto:d...@openvswitch.org>>
Cc: Danting Liu mailto:danti...@vmware.com>>


This patch changes the way we try to figure out if a port is defined on a given 
switch.

Instead of looking only in the internal ports defined switch to all ports 
defined.

This caused issues when trying to add a Hyper-V container port to a given OVS 
bridge.

Reported-by: Danting Liu mailto:danti...@vmware.com>>
Signed-off-by: Alin Gabriel Serdean mailto:aserd...@ovn.org>>
---
 lib/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/wmi.c b/lib/wmi.c
index e6dc63cde..44c1d75e9 100644
--- a/lib/wmi.c
+++ b/lib/wmi.c
@@ -686,7 +686,7 @@ create_wmi_port(char *name) {

 /* Check if the element already exists on the switch. */
 wchar_t internal_port_query[WMI_QUERY_COUNT] = L"SELECT * FROM "
-L"Msvm_InternalEthernetPort WHERE ElementName = \"";
+L"CIM_EthernetPort WHERE ElementName = \"";

 wide_name = xmalloc((strlen(name) + 1) * sizeof(wchar_t));

--
2.21.0.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] datapath-windows: Copy mru information when cloning a nbl.

2019-05-17 Thread Anand Kumar via dev
When a nbl is cloned, mru value stored in the original nbl
context is lost, which skips refragemting the cloned nbls.

This patch fixes it.

Signed-off-by: Anand Kumar 
---
 datapath-windows/ovsext/BufferMgmt.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.c 
b/datapath-windows/ovsext/BufferMgmt.c
index 6627acf..acf3c13 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -260,14 +260,15 @@ static VOID
 OvsInitNBLContext(POVS_BUFFER_CONTEXT ctx,
   UINT16 flags,
   UINT32 origDataLength,
-  UINT32 srcPortNo)
+  UINT32 srcPortNo,
+  UINT16 mru)
 {
 ctx->magic = OVS_CTX_MAGIC;
 ctx->refCount = 1;
 ctx->flags = flags;
 ctx->srcPortNo = srcPortNo;
 ctx->origDataLength = origDataLength;
-ctx->mru = 0;
+ctx->mru = mru;
 ctx->pendingSend = 0;
 }
 
@@ -434,7 +435,7 @@ OvsAllocateFixSizeNBL(PVOID ovsContext,
 
 OvsInitNBLContext(ctx, OVS_BUFFER_FROM_FIX_SIZE_POOL |
   OVS_BUFFER_PRIVATE_FORWARD_CONTEXT, size,
-  OVS_DPPORT_NUMBER_INVALID);
+  OVS_DPPORT_NUMBER_INVALID, 0);
 line = __LINE__;
 allocate_done:
 OVS_LOG_LOUD("Allocate Fix NBL: %p, line: %d", nbl, line);
@@ -547,7 +548,7 @@ OvsAllocateVariableSizeNBL(PVOID ovsContext,
 OvsInitNBLContext(ctx, OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA |
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT |
OVS_BUFFER_FROM_ZERO_SIZE_POOL,
-   size, OVS_DPPORT_NUMBER_INVALID);
+   size, OVS_DPPORT_NUMBER_INVALID, 0);
 
 OVS_LOG_LOUD("Allocate variable size NBL: %p", nbl);
 return nbl;
@@ -600,7 +601,7 @@ OvsInitExternalNBLContext(PVOID ovsContext,
  * complete.
  */
 OvsInitNBLContext(ctx, flags, NET_BUFFER_DATA_LENGTH(nb),
-  OVS_DPPORT_NUMBER_INVALID);
+  OVS_DPPORT_NUMBER_INVALID, 0);
 return ctx;
 }
 
@@ -817,7 +818,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
 srcNb = NET_BUFFER_LIST_FIRST_NB(nbl);
 ASSERT(srcNb);
 OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize,
-  OVS_DPPORT_NUMBER_INVALID);
+  OVS_DPPORT_NUMBER_INVALID, srcCtx->mru);
 
 InterlockedIncrement((LONG volatile *)>refCount);
 
@@ -1074,7 +1075,7 @@ OvsFullCopyNBL(PVOID ovsContext,
  OVS_BUFFER_PRIVATE_FORWARD_CONTEXT;
 
 OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(firstNb),
-  OVS_DPPORT_NUMBER_INVALID);
+  OVS_DPPORT_NUMBER_INVALID, srcCtx->mru);
 
 #ifdef DBG
 OvsDumpNetBufferList(nbl);
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] datapath-windows: Add Win10Analyze target

2019-05-01 Thread Anand Kumar via dev
Thanks for the adding windows 10 analyze target.

Acked-by: Anand Kumar 

Regards,
Anand Kumar

On 4/3/19, 10:48 AM, "Alin Gabriel Serdean"  wrote:

This patch adds a new target called `Win10Analyze` to the driver solution.

It enables us to trigger static analysis over the Win10 target.

Since the location of the ruleset of drivers is somewhat random
starting from 1803:

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.osr.com%2Fblog%2F2018%2F05%2F21%2Fwdk-1803-ca%2Fdata=02%7C01%7Ckumaranand%40vmware.com%7C2580925eae8c4b9a4e4608d6b85c8b60%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636899104959730588sdata=%2FLesq2PWVRbSB55zyEQbRTrsL2W07s6on8SGlhGTg0w%3Dreserved=0

Commit the ruleset inside our repository. This is the same ruleset used for
8,8.1 and 10.

Signed-off-by: Alin Gabriel Serdean 
---
 datapath-windows/Package/package.VcxProj  | 21 -
 datapath-windows/Package/package.VcxProj.user |  5 +-
 datapath-windows/automake.mk  |  2 +
 .../misc/DriverRecommendedRules.ruleset   | 86 +++
 datapath-windows/ovsext.sln   |  5 ++
 datapath-windows/ovsext/ovsext.vcxproj| 39 -
 datapath-windows/ovsext/ovsext.vcxproj.user   |  5 +-
 7 files changed, 159 insertions(+), 4 deletions(-)
 create mode 100644 datapath-windows/misc/DriverRecommendedRules.ruleset

diff --git a/datapath-windows/Package/package.VcxProj 
b/datapath-windows/Package/package.VcxProj
index de747eed2..5939a8816 100644
--- a/datapath-windows/Package/package.VcxProj
+++ b/datapath-windows/Package/package.VcxProj
@@ -9,6 +9,10 @@
   Win10 Release
   x64
 
+
+  Win10Analyze
+  x64
+
 
   Win8.1 Debug
   x64
@@ -71,6 +75,13 @@
 
WindowsKernelModeDriver$(PlatformToolsetVer)
 Desktop
   
+  
+
+true
+10.0
+
WindowsKernelModeDriver$(PlatformToolsetVer)
+Desktop
+  
   
 Windows8
 true
@@ -113,6 +124,9 @@
   
 true
   
+  
+true
+  
   
 DbgengKernelDebugger
 False
@@ -148,6 +162,11 @@
   true
 
   
+  
+
+  true
+
+  
   
 
   true
@@ -185,4 +204,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/datapath-windows/Package/package.VcxProj.user 
b/datapath-windows/Package/package.VcxProj.user
index 6231d93f7..5b0c53539 100644
--- a/datapath-windows/Package/package.VcxProj.user
+++ b/datapath-windows/Package/package.VcxProj.user
@@ -15,6 +15,9 @@
   
 TestSign
   
+  
+TestSign
+  
   
 TestSign
   
@@ -24,4 +27,4 @@
   
 TestSign
   
-
+
\ No newline at end of file
diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk
index 3820041f6..b8cf5dd95 100644
--- a/datapath-windows/automake.mk
+++ b/datapath-windows/automake.mk
@@ -3,6 +3,7 @@ EXTRA_DIST += \
datapath-windows/Package/package.VcxProj.user \
datapath-windows/include/OvsDpInterfaceExt.h \
datapath-windows/include/OvsDpInterfaceCtExt.h \
+   datapath-windows/misc/DriverRecommendedRules.ruleset \
datapath-windows/misc/OVS.psm1 \
datapath-windows/misc/install.cmd \
datapath-windows/misc/uninstall.cmd \
@@ -86,5 +87,6 @@ EXTRA_DIST += \
datapath-windows/ovsext/resource.h
 
 datapath_windows_analyze: all
+   MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln 
/target:Build /property:Configuration="Win10Analyze"
MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln 
/target:Build /property:Configuration="Win8.1Analyze"
MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln 
/target:Build /property:Configuration="Win8Analyze"
diff --git a/datapath-windows/misc/DriverRecommendedRules.ruleset 
b/datapath-windows/misc/DriverRecommendedRules.ruleset
new file mode 100644
index 0..0faae599c
--- /dev/null
+++ b/datapath-windows/misc/DriverRecommendedRules.ruleset
@@ -0,0 +1,86 @@
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 

Re: [ovs-dev] [PATCH] compiler: Fix compilation when using VStudio 2015/2017

2019-04-15 Thread Anand Kumar via dev
Acked-by: Anand Kumar 

Thanks,
Anand Kumar

On 4/3/19, 5:02 AM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Gabriel 
Serdean"  wrote:

This is somewhat a regression of:

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenvswitch%2Fovs%2Fcommit%2F27f141d44d95b4cabfd7eac47ace8d1201668b2cdata=02%7C01%7Ckumaranand%40vmware.com%7C8c1a3cec316246469a7408d6b82c379e%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898897407724956sdata=ALCufRrll3wawrYBVISSBDuI%2FoLONal%2FnkbH9JwrW1c%3Dreserved=0

The main issue using `offsetof` from  via the C compiler from
MSVC 2015/2017 has issues and is buggy:

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbit.ly%2F2UvWwtidata=02%7C01%7Ckumaranand%40vmware.com%7C8c1a3cec316246469a7408d6b82c379e%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898897407734950sdata=NqGbZONawrVrvtb57jh%2FYIRxAu4A1blZAYFOpyDtHEQ%3Dreserved=0

Until it is fixed, we define our own definition of `offsetof`.

Signed-off-by: Alin Gabriel Serdean 
---
 include/openvswitch/compiler.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h
index c7cb9308d..5289a70f6 100644
--- a/include/openvswitch/compiler.h
+++ b/include/openvswitch/compiler.h
@@ -236,6 +236,18 @@
 #define OVS_PREFETCH_WRITE(addr)
 #endif
 
+/* Since Visual Studio 2015 there has been an effort to make offsetof a
+ * builtin_offsetof, unfortunately both implementation (the regular define 
and
+ * the built in one) are buggy and cause issues when using them via
+ * the C compiler.
+ * e.g.: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbit.ly%2F2UvWwtidata=02%7C01%7Ckumaranand%40vmware.com%7C8c1a3cec316246469a7408d6b82c379e%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898897407734950sdata=NqGbZONawrVrvtb57jh%2FYIRxAu4A1blZAYFOpyDtHEQ%3Dreserved=0
+ */
+#if _MSC_VER >= 1900
+#undef offsetof
+#define offsetof(type, member) \
+((size_t)((char *)&(((type *)0)->member) - (char *)0))
+#endif
+
 /* Build assertions.
  *
  * Use BUILD_ASSERT_DECL as a declaration or a statement, or BUILD_ASSERT 
as
-- 
2.21.0.windows.1

___
dev mailing list
d...@openvswitch.org

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-devdata=02%7C01%7Ckumaranand%40vmware.com%7C8c1a3cec316246469a7408d6b82c379e%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898897407734950sdata=MmmiiH7FfvcAfTB7FUybE6icufW5vebGuY0DqKljnZ8%3Dreserved=0


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] datapath-windows: Do not send out nbls when cloned nbls are being accessed

2019-04-11 Thread Anand Kumar via dev
As per MSDN documentation, "As soon as a filter driver calls the
NdisFSendNetBufferLists function, it relinquishes ownership of
the NET_BUFFER_LIST structures and all associated resources.
A filter driver should never try to examine the NET_BUFFER_LIST
structures or any associated data after calling NdisFSendNetBufferLists".

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ndis/nf-ndis-ndisfsendnetbufferlists

When freeing up memory of a cloned nbl, parent's nbl and context
is being accessed, which is incorrect can cause BSOD.
With this patch, original nbl is sent out only when cloned nbl is done
with packet processing and its memory is freed.

Signed-off-by: Anand Kumar 
---
v1->v2:
- Remove the else block and by default try to send the packet out.
---
 datapath-windows/ovsext/BufferMgmt.c |  9 -
 datapath-windows/ovsext/BufferMgmt.h |  2 ++
 datapath-windows/ovsext/PacketIO.c   | 10 ++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.c 
b/datapath-windows/ovsext/BufferMgmt.c
index 47d872d..6627acf 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -81,6 +81,7 @@
 #include "Flow.h"
 #include "Offload.h"
 #include "NetProto.h"
+#include "PacketIO.h"
 #include "PacketParser.h"
 #include "Switch.h"
 #include "Vport.h"
@@ -267,6 +268,7 @@ OvsInitNBLContext(POVS_BUFFER_CONTEXT ctx,
 ctx->srcPortNo = srcPortNo;
 ctx->origDataLength = origDataLength;
 ctx->mru = 0;
+ctx->pendingSend = 0;
 }
 
 
@@ -1746,8 +1748,13 @@ OvsCompleteNBL(PVOID switch_ctx,
 if (parent != NULL) {
 ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(parent);
 ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC);
+UINT16 pendingSend = 1, exchange = 0;
 value = InterlockedDecrement((LONG volatile *)>refCount);
-if (value == 0) {
+InterlockedCompareExchange16((SHORT volatile *), exchange, 
(SHORT)ctx->pendingSend);
+if (value == 1 && pendingSend == exchange) {
+InterlockedExchange16((SHORT volatile *)>pendingSend, 0);
+OvsSendNBLIngress(context, parent, ctx->sendFlags);
+} else if (value == 0){
 return OvsCompleteNBL(context, parent, FALSE);
 }
 }
diff --git a/datapath-windows/ovsext/BufferMgmt.h 
b/datapath-windows/ovsext/BufferMgmt.h
index 2a74988..2ae3272 100644
--- a/datapath-windows/ovsext/BufferMgmt.h
+++ b/datapath-windows/ovsext/BufferMgmt.h
@@ -55,7 +55,9 @@ typedef union _OVS_BUFFER_CONTEXT {
 UINT32 origDataLength;
 UINT32 dataOffsetDelta;
 };
+ULONG sendFlags;
 UINT16 mru;
+UINT16 pendingSend; /* Indicates packet can be sent or not. */
 };
 
 CHAR value[MEM_ALIGN_SIZE(sizeof(struct dummy))];
diff --git a/datapath-windows/ovsext/PacketIO.c 
b/datapath-windows/ovsext/PacketIO.c
index 57c583c..cc08407 100644
--- a/datapath-windows/ovsext/PacketIO.c
+++ b/datapath-windows/ovsext/PacketIO.c
@@ -161,6 +161,16 @@ OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext,
 
 ASSERT(switchContext->dataFlowState == OvsSwitchRunning);
 
+POVS_BUFFER_CONTEXT ctx = 
(POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(netBufferLists);
+LONG refCount = 1, exchange = 0;
+InterlockedCompareExchange((LONG volatile *), exchange, 
(LONG)ctx->refCount);
+if (refCount != exchange) {
+InterlockedExchange((LONG volatile *)>sendFlags, sendFlags);
+InterlockedExchange16((SHORT volatile *)>pendingSend, 1);
+return;
+}
+
+InterlockedExchange16((SHORT volatile *)>pendingSend, 0);
 NdisFSendNetBufferLists(switchContext->NdisFilterHandle, netBufferLists,
 NDIS_DEFAULT_PORT_NUMBER, sendFlags);
 }
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v1] datapath-windows: Do not send out nbls when cloned nbls are being accessed

2019-04-09 Thread Anand Kumar via dev
As per MSDN documentation, "As soon as a filter driver calls the
NdisFSendNetBufferLists function, it relinquishes ownership of
the NET_BUFFER_LIST structures and all associated resources.
A filter driver should never try to examine the NET_BUFFER_LIST
structures or any associated data after calling NdisFSendNetBufferLists".

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ndis/nf-ndis-ndisfsendnetbufferlists

When freeing up memory of a cloned nbl, parent's nbl and context
is being accessed, which is incorrect can cause BSOD.
With this patch, original nbl is sent out only when cloned nbl is done
with packet processing and its memory is freed.

Signed-off-by: Anand Kumar 

Change-Id: Ie662133a6fcd5a26ca3c87d31c9cee1fc56c2d27
---
 datapath-windows/ovsext/BufferMgmt.c |  9 -
 datapath-windows/ovsext/BufferMgmt.h |  2 ++
 datapath-windows/ovsext/PacketIO.c   | 13 +++--
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.c 
b/datapath-windows/ovsext/BufferMgmt.c
index 47d872d..6627acf 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -81,6 +81,7 @@
 #include "Flow.h"
 #include "Offload.h"
 #include "NetProto.h"
+#include "PacketIO.h"
 #include "PacketParser.h"
 #include "Switch.h"
 #include "Vport.h"
@@ -267,6 +268,7 @@ OvsInitNBLContext(POVS_BUFFER_CONTEXT ctx,
 ctx->srcPortNo = srcPortNo;
 ctx->origDataLength = origDataLength;
 ctx->mru = 0;
+ctx->pendingSend = 0;
 }
 
 
@@ -1746,8 +1748,13 @@ OvsCompleteNBL(PVOID switch_ctx,
 if (parent != NULL) {
 ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(parent);
 ASSERT(ctx && ctx->magic == OVS_CTX_MAGIC);
+UINT16 pendingSend = 1, exchange = 0;
 value = InterlockedDecrement((LONG volatile *)>refCount);
-if (value == 0) {
+InterlockedCompareExchange16((SHORT volatile *), exchange, 
(SHORT)ctx->pendingSend);
+if (value == 1 && pendingSend == exchange) {
+InterlockedExchange16((SHORT volatile *)>pendingSend, 0);
+OvsSendNBLIngress(context, parent, ctx->sendFlags);
+} else if (value == 0){
 return OvsCompleteNBL(context, parent, FALSE);
 }
 }
diff --git a/datapath-windows/ovsext/BufferMgmt.h 
b/datapath-windows/ovsext/BufferMgmt.h
index 2a74988..2ae3272 100644
--- a/datapath-windows/ovsext/BufferMgmt.h
+++ b/datapath-windows/ovsext/BufferMgmt.h
@@ -55,7 +55,9 @@ typedef union _OVS_BUFFER_CONTEXT {
 UINT32 origDataLength;
 UINT32 dataOffsetDelta;
 };
+ULONG sendFlags;
 UINT16 mru;
+UINT16 pendingSend; /* Indicates packet can be sent or not. */
 };
 
 CHAR value[MEM_ALIGN_SIZE(sizeof(struct dummy))];
diff --git a/datapath-windows/ovsext/PacketIO.c 
b/datapath-windows/ovsext/PacketIO.c
index 57c583c..56876f2 100644
--- a/datapath-windows/ovsext/PacketIO.c
+++ b/datapath-windows/ovsext/PacketIO.c
@@ -161,8 +161,17 @@ OvsSendNBLIngress(POVS_SWITCH_CONTEXT switchContext,
 
 ASSERT(switchContext->dataFlowState == OvsSwitchRunning);
 
-NdisFSendNetBufferLists(switchContext->NdisFilterHandle, netBufferLists,
-NDIS_DEFAULT_PORT_NUMBER, sendFlags);
+POVS_BUFFER_CONTEXT ctx = 
(POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(netBufferLists);
+LONG refCount = 1, exchange = 0;
+InterlockedCompareExchange((LONG volatile *), exchange, 
(LONG)ctx->refCount);
+if (refCount != exchange) {
+InterlockedExchange((LONG volatile *)>sendFlags, sendFlags);
+InterlockedExchange16((SHORT volatile *)>pendingSend, 1);
+} else {
+InterlockedExchange16((SHORT volatile *)>pendingSend, 0);
+NdisFSendNetBufferLists(switchContext->NdisFilterHandle, 
netBufferLists,
+NDIS_DEFAULT_PORT_NUMBER, sendFlags);
+}
 }
 
 static __inline VOID
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] datapath-windows: Fix vlan key getting stored in host byte order.

2019-04-05 Thread Anand Kumar via dev
Update flowkey to set vlan information in network byte order.

Signed-off-by: Anand Kumar 
---
 datapath-windows/ovsext/Flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index 7994786..fdb1010 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -2350,8 +2350,8 @@ OvsExtractFlow(const NET_BUFFER_LIST *packet,
 } else {
 if (eth->dix.typeNBO == ETH_TYPE_802_1PQ_NBO) {
 Eth_802_1pq_Tag *tag= (Eth_802_1pq_Tag *)>dix.typeNBO;
-flow->l2.vlanKey.vlanTci = ((UINT16)tag->priority << 13) |
-OVSWIN_VLAN_CFI | ((UINT16)tag->vidHi << 8) | tag->vidLo;
+flow->l2.vlanKey.vlanTci = htons(((UINT16)tag->priority << 13) |
+OVSWIN_VLAN_CFI | ((UINT16)tag->vidHi << 8) | tag->vidLo);
 flow->l2.vlanKey.vlanTpid = htons(ETH_TYPE_802_1PQ);
 offset = sizeof (Eth_802_1pq_Tag);
 } else {
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] datapath-windows: Address memory allocation issues for OVS_BUFFER_CONTEXT

2019-03-20 Thread Anand Kumar via dev
With current implementation, when nbl pool is allocated, context size is
specified as 64 bytes, while the OVS_BUFFER_CONTEXT size is only 32 bytes.
Since context size is never changed, additional memory is not required.

This patch makes it simpler to allocate memory for OVS_BUFFER_CONTEXT so
that it is always aligned to MEMORY_ALLOCATION_ALIGNMENT.
This is acheived by updating "value" field in the context
structure, so that number of elements in array is always a multiple of
MEMORY_ALLOCATION_ALIGNMENT.

Also change the DEFAULT_CONTEXT_SIZE to accomodate OVS_BUFFER_CONTEXT size.

Signed-off-by: Anand Kumar 
---
 datapath-windows/ovsext/BufferMgmt.h | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.h 
b/datapath-windows/ovsext/BufferMgmt.h
index dcf310a..2a74988 100644
--- a/datapath-windows/ovsext/BufferMgmt.h
+++ b/datapath-windows/ovsext/BufferMgmt.h
@@ -20,11 +20,8 @@
 #define MEM_ALIGN   MEMORY_ALLOCATION_ALIGNMENT
 #define MEM_ALIGN_SIZE(_x)  ((MEM_ALIGN - 1 + (_x))/MEM_ALIGN * MEM_ALIGN)
 #define OVS_CTX_MAGIC   0xabcd
-
-#define OVS_DEFAULT_NBL_CONTEXT_SIZEMEM_ALIGN_SIZE(64)
-#define OVS_DEFAULT_NBL_CONTEXT_FILL\
-  (OVS_DEFAULT_NBL_CONTEXT_SIZE - sizeof (OVS_BUFFER_CONTEXT))
-
+#define OVS_DEFAULT_NBL_CONTEXT_SIZEsizeof(OVS_BUFFER_CONTEXT)
+#define OVS_DEFAULT_NBL_CONTEXT_FILL0
 #define OVS_DEFAULT_DATA_SIZE   256
 #define OVS_DEFAULT_HEADROOM_SIZE   128
 #define OVS_FIX_NBL_DATA_SIZE(OVS_DEFAULT_DATA_SIZE + 
OVS_DEFAULT_HEADROOM_SIZE)
@@ -49,7 +46,7 @@ enum {
 };
 
 typedef union _OVS_BUFFER_CONTEXT {
-struct {
+struct dummy {
 UINT16 magic;
 UINT16 flags;
 UINT32 srcPortNo;
@@ -61,7 +58,7 @@ typedef union _OVS_BUFFER_CONTEXT {
 UINT16 mru;
 };
 
-UINT64 value[MEM_ALIGN_SIZE(32) >> 3];
+CHAR value[MEM_ALIGN_SIZE(sizeof(struct dummy))];
 } OVS_BUFFER_CONTEXT, *POVS_BUFFER_CONTEXT;
 
 typedef struct _OVS_NBL_POOL {
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] datapath-windows: Address memory allocation issues for OVS_BUFFER_CONTEXT

2019-03-19 Thread Anand Kumar via dev
With current implementation, when nbl pool is allocated, context size is
specified as 64 bytes, while the OVS_BUFFER_CONTEXT size is only 32 bytes.
Since context size is never changed, additional memory is not required.

This patch makes it simpler to allocate memory for OVS_BUFFER_CONTEXT so
that it is always aligned to MEMORY_ALLOCATION_ALIGNMENT.
This is acheived by updating "value" field in the context
structure, so that number of elements in array is always a multiple of
MEMORY_ALLOCATION_ALIGNMENT.

Also change the DEFAULT_CONTEXT_SIZE to accomodate OVS_BUFFER_CONTEXT size.

Signed-off-by: Anand Kumar 
---
 datapath-windows/ovsext/BufferMgmt.h | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.h 
b/datapath-windows/ovsext/BufferMgmt.h
index dcf310a..714ab3d 100644
--- a/datapath-windows/ovsext/BufferMgmt.h
+++ b/datapath-windows/ovsext/BufferMgmt.h
@@ -20,11 +20,8 @@
 #define MEM_ALIGN   MEMORY_ALLOCATION_ALIGNMENT
 #define MEM_ALIGN_SIZE(_x)  ((MEM_ALIGN - 1 + (_x))/MEM_ALIGN * MEM_ALIGN)
 #define OVS_CTX_MAGIC   0xabcd
-
-#define OVS_DEFAULT_NBL_CONTEXT_SIZEMEM_ALIGN_SIZE(64)
-#define OVS_DEFAULT_NBL_CONTEXT_FILL\
-  (OVS_DEFAULT_NBL_CONTEXT_SIZE - sizeof (OVS_BUFFER_CONTEXT))
-
+#define OVS_DEFAULT_NBL_CONTEXT_SIZEsizeof(OVS_BUFFER_CONTEXT))
+#define OVS_DEFAULT_NBL_CONTEXT_FILL0
 #define OVS_DEFAULT_DATA_SIZE   256
 #define OVS_DEFAULT_HEADROOM_SIZE   128
 #define OVS_FIX_NBL_DATA_SIZE(OVS_DEFAULT_DATA_SIZE + 
OVS_DEFAULT_HEADROOM_SIZE)
@@ -49,7 +46,7 @@ enum {
 };
 
 typedef union _OVS_BUFFER_CONTEXT {
-struct {
+struct dummy {
 UINT16 magic;
 UINT16 flags;
 UINT32 srcPortNo;
@@ -61,7 +58,7 @@ typedef union _OVS_BUFFER_CONTEXT {
 UINT16 mru;
 };
 
-UINT64 value[MEM_ALIGN_SIZE(32) >> 3];
+CHAR value[MEM_ALIGN_SIZE(sizeof(struct dummy))];
 } OVS_BUFFER_CONTEXT, *POVS_BUFFER_CONTEXT;
 
 typedef struct _OVS_NBL_POOL {
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] datapath-windows: Fix nbl cleanup when memory allocation fails

2019-03-12 Thread Anand Kumar via dev
Acked-by: Anand Kumar 

Thanks,
Anand Kumar

On 3/8/19, 1:23 PM, "ovs-dev-boun...@openvswitch.org on behalf of Sairam 
Venugopal via dev"  wrote:

StartNblIngressError should be called only when an NBL hasn't been
modified. In this case the nbl context was initialized. Rely on existing
packet completion mechanism to cleanup the NBL.

Found while testing with DriverVerifier with limited memory setting
enabled.

Signed-off-by: Sairam Venugopal 
---
 datapath-windows/ovsext/PacketIO.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/PacketIO.c 
b/datapath-windows/ovsext/PacketIO.c
index 38e3e5f..57c583c 100644
--- a/datapath-windows/ovsext/PacketIO.c
+++ b/datapath-windows/ovsext/PacketIO.c
@@ -283,9 +283,8 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext,
 RtlInitUnicodeString(,
  L"Cannot allocate NBLs with single 
NB.");
 
-OvsStartNBLIngressError(switchContext, curNbl,
-sendCompleteFlags, ,
-NDIS_STATUS_RESOURCES);
+OvsAddPktCompletionList(, TRUE, sourcePort,
+curNbl, 0, );
 continue;
 }
 
-- 
2.9.0.windows.1

___
dev mailing list
d...@openvswitch.org

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-devdata=02%7C01%7Ckumaranand%40vmware.com%7Cf88cb293def34509deba08d6a40c3a25%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636876769821233618sdata=zY5NZ0d2F9esM76HXvWahDOOFLSQ%2FFBUqioPBJ8Tdqo%3Dreserved=0


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] datapath-windows: Guard vport usage in user.c

2019-03-12 Thread Anand Kumar via dev
Acked-by: Anand Kumar  

Thanks,
Anand Kumar

On 2/27/19, 6:10 AM, "ovs-dev-boun...@openvswitch.org on behalf of Alin 
Gabriel Serdean"  wrote:

When using a vport we need to guard its usage with the dispatch lock.

Signed-off-by: Alin Gabriel Serdean 
---
 datapath-windows/ovsext/User.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index b43d7cc04..ed1fcbea8 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -452,14 +452,6 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
 }
 
 fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl);
-vport = OvsFindVportByPortNo(gOvsSwitchContext, execute->inPort);
-if (vport) {
-fwdDetail->SourcePortId = vport->portId;
-fwdDetail->SourceNicIndex = vport->nicIndex;
-} else {
-fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID;
-fwdDetail->SourceNicIndex = 0;
-}
 // XXX: Figure out if any of the other members of fwdDetail need to be 
set.
 
 status = OvsGetFlowMetadata(, execute->keyAttrs);
@@ -502,6 +494,14 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
 
 if (ndisStatus == NDIS_STATUS_SUCCESS) {
 NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, , 
0);
+vport = OvsFindVportByPortNo(gOvsSwitchContext, execute->inPort);
+if (vport) {
+fwdDetail->SourcePortId = vport->portId;
+fwdDetail->SourceNicIndex = vport->nicIndex;
+} else {
+fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID;
+fwdDetail->SourceNicIndex = 0;
+}
 ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl,
vport ? vport->portNo :
OVS_DPPORT_NUMBER_INVALID,
-- 
2.16.1.windows.1

___
dev mailing list
d...@openvswitch.org

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-devdata=02%7C01%7Ckumaranand%40vmware.com%7C0bd42693441d43f12bfa08d69cbd589d%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636868734386921985sdata=KCb%2FeQOwJIyXj6C7ZS9QePNUW6CZp7CwBWJ1obSHMvA%3Dreserved=0


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] datapath-windows: Add annotations to find vport functions

2019-03-12 Thread Anand Kumar via dev
Acked-by: Anand Kumar 

Thanks,
Anand Kumar

On 2/27/19, 9:34 AM, "ovs-dev-boun...@openvswitch.org on behalf of Alin 
Gabriel Serdean"  wrote:

Add annotations to find vport functions to check if the dispatch lock is
held.

Signed-off-by: Alin Gabriel Serdean 
---
 datapath-windows/ovsext/Vport.c | 7 ++-
 datapath-windows/ovsext/Vport.h | 5 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/Vport.c 
b/datapath-windows/ovsext/Vport.c
index e08cb90ce..f79324d28 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -135,7 +135,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
  * Lookup by port name to see if this port with this name had been 
added
  * (and deleted) previously.
  */
-vport = OvsFindVportByHvNameW(gOvsSwitchContext,
+vport = OvsFindVportByHvNameW(switchContext,
   portParam->PortFriendlyName.String,
   portParam->PortFriendlyName.Length);
 if (vport && vport->isAbsentOnHv == FALSE) {
@@ -693,6 +693,7 @@ done:
 /*
  * OVS Vport related functionality.
  */
+_Use_decl_annotations_
 POVS_VPORT_ENTRY
 OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext,
  UINT32 portNo)
@@ -787,6 +788,7 @@ OvsFindTunnelVportByPortType(POVS_SWITCH_CONTEXT 
switchContext,
 return NULL;
 }
 
+_Use_decl_annotations_
 POVS_VPORT_ENTRY
 OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext,
   PSTR name)
@@ -810,6 +812,7 @@ OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext,
 }
 
 /* OvsFindVportByHvName: "name" is assumed to be null-terminated */
+_Use_decl_annotations_
 POVS_VPORT_ENTRY
 OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext,
   PWSTR wsName, SIZE_T wstrSize)
@@ -862,6 +865,7 @@ Cleanup:
 return vport;
 }
 
+_Use_decl_annotations_
 POVS_VPORT_ENTRY
 OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext,
   PSTR name)
@@ -884,6 +888,7 @@ OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext,
 return vport;
 }
 
+_Use_decl_annotations_
 POVS_VPORT_ENTRY
 OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext,
 NDIS_SWITCH_PORT_ID portId,
diff --git a/datapath-windows/ovsext/Vport.h 
b/datapath-windows/ovsext/Vport.h
index 7d88f86fb..32cbf8bcc 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -122,15 +122,20 @@ typedef struct _OVS_VPORT_ENTRY {
 
 struct _OVS_SWITCH_CONTEXT;
 
+_Requires_lock_held_(switchContext->dispatchLock)
 POVS_VPORT_ENTRY OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext,
   UINT32 portNo);
 /* "name" is null-terminated */
+_Requires_lock_held_(switchContext->dispatchLock)
 POVS_VPORT_ENTRY OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext,
PSTR name);
+_Requires_lock_held_(switchContext->dispatchLock)
 POVS_VPORT_ENTRY OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext,
PSTR name);
+_Requires_lock_held_(switchContext->dispatchLock)
 POVS_VPORT_ENTRY OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext,
PWSTR wsName, SIZE_T wstrSize);
+_Requires_lock_held_(switchContext->dispatchLock)
 POVS_VPORT_ENTRY OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT 
switchContext,
  NDIS_SWITCH_PORT_ID 
portId,
  NDIS_SWITCH_NIC_INDEX 
index);
-- 
2.16.1.windows.1

___
dev mailing list
d...@openvswitch.org

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-devdata=02%7C01%7Ckumaranand%40vmware.com%7C5ae778841e0345fbaf6608d69cd9d189%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636868856711003678sdata=fUVDFay5I8qBsqoUyiCckwN%2BrEv8BtFIjHgOIwuNMYY%3Dreserved=0


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] faq: Update features supported on Hyper-V

2019-03-11 Thread Anand Kumar via dev
These features were added a while back, so updating
the documentation.

Signed-off-by: Anand Kumar 
---
 Documentation/faq/releases.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index fd45efd..cd5aad1 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -110,8 +110,8 @@ Q: Are all features available with all datapaths?
 == == == = ===
 Connection tracking 4.3YES  YES  YES
 Conntrack Fragment Reass.   4.3YES  YES  YES
-NAT 4.6YES  YES  NO
-Conntrack zone limit4.18   YES  NO   NO
+NAT 4.6YES  YES  YES
+Conntrack zone limit4.18   YES  NO   YES
 Tunnel - LISP   NO YES  NO   NO
 Tunnel - STTNO YES  NO   YES
 Tunnel - GRE3.11   YES  YES  YES
@@ -125,7 +125,7 @@ Q: Are all features available with all datapaths?
 QoS - Policing  YESYES  YES  NO
 QoS - Shaping   YESYES  NO   NO
 sFlow   YESYES  YES  NO
-IPFIX   3.10   YES  YES  NO
+IPFIX   3.10   YES  YES  YES
 Set action  YESYES  YESPARTIAL
 NIC Bonding YESYES  YES  YES
 Multiple VTEPs  YESYES  YES  YES
-- 
2.9.3.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev