Re: [ovs-dev] [PATCH] INSTALL.Windows.md: Update the minimum required compiler.
Acked-by: Eitan Eliahu elia...@vmware.com It would be good if we could verify that the driver is compiled and run when compiled with VS Update 4 and Winddk 8.1. Thanks Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Tuesday, July 14, 2015 11:57 AM To: dev@openvswitch.org Cc: Gurucharan Shetty Subject: [ovs-dev] [PATCH] INSTALL.Windows.md: Update the minimum required compiler. MSVC 2013 update 4 was released in Nov 2014. Its release notes says that it has fixed the problem wherein using designated initializers to initialize unions within structs would fail to compile. Using designated initializers is useful in OVS and so this commit updates the minimum required compiler for Windows. Signed-off-by: Gurucharan Shetty gshe...@nicira.com --- INSTALL.Windows.md |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 6d870ed..889bb0b 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -28,9 +28,9 @@ the following entry in /etc/fstab - 'C:/MinGW /mingw'. * Install the latest Python 2.x from python.org and verify that its path is part of Windows' PATH environment variable. -* You will need at least Visual Studio 2013 to compile userspace binaries. In -addition to that, if you want to compile the kernel module you will also need to -install Windows Driver Kit (WDK) 8.1 Update. +* You will need at least Visual Studio 2013 (update 4) to compile +userspace binaries. In addition to that, if you want to compile the +kernel module you will also need to install Windows Driver Kit (WDK) 8.1 Update. It is important to get the Visual Studio related environment variables and to have the $PATH inside the bash to point to the proper compiler and linker. One -- 1.7.9.5 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=j7iHpo0VgVdmCO_wv2COlEnWbdn-uyYnVKITELN9pcws=zM2m3mB4cNPSETWfrgDi3I-HnJJgvSwU8eNRJrCXZMce= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Realease dispatch lock after processing
Alin, it seems that RtlUnicodeStringToAnsiString() can't be called in an elevated IRQL. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, July 13, 2015 10:06 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Realease dispatch lock after processing Release the switch context dispatch lock after all possible processing is done over the vport. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/ovsext/Vport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index 4315464..7cbe59e 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -1563,7 +1563,7 @@ OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet, extInfo-vmUUID[0] = 0; extInfo-vifUUID[0] = 0; } -NdisReleaseRWLock(gOvsSwitchContext-dispatchLock, lockState); + if (doConvert) { status = OvsConvertIfCountedStrToAnsiStr(vport-portFriendlyName, extInfo-name, @@ -1593,6 +1593,7 @@ OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet, */ status = STATUS_SUCCESS; } +NdisReleaseRWLock(gOvsSwitchContext-dispatchLock, lockState); ext_info_done: return status; -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=GAWhBhugfvlx6aF4gdmQcZ32qoLSuu3_v0x8Ms7qdXos=hLdaxR10BjtU410yb92nRFmN3i3nTsFc_5lgrjnzia4e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: update extension information
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, July 13, 2015 10:18 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: update extension information This patch sets additional information about the driver used by various applications. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/.gitignore|1 + datapath-windows/ovsext/ovsext.rc | 104 ++- datapath-windows/ovsext/ovsext.vcxproj |1 + datapath-windows/ovsext/resource.h | 1576 4 files changed, 1662 insertions(+), 20 deletions(-) create mode 100644 datapath-windows/ovsext/resource.h diff --git a/datapath-windows/.gitignore b/datapath-windows/.gitignore index 356a6da..a3ed49b 100644 --- a/datapath-windows/.gitignore +++ b/datapath-windows/.gitignore @@ -3,3 +3,4 @@ *.sdf /ovsext/x64/ /x64 +/ovsext/ovsext.aps diff --git a/datapath-windows/ovsext/ovsext.rc b/datapath-windows/ovsext/ovsext.rc index 8f6e121..6446590 100644 --- a/datapath-windows/ovsext/ovsext.rc +++ b/datapath-windows/ovsext/ovsext.rc @@ -1,23 +1,87 @@ +// Microsoft Visual C++ generated resource script. // -// Copyright (c) Microsoft Corporation. All Rights Reserved. +#include resource.h +/ +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +/ +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 6,3,9600,17298 + PRODUCTVERSION 6,3,9600,17298 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x9L +#else + FILEFLAGS 0x8L +#endif + FILEOS 0x40004L + FILETYPE 0x3L + FILESUBTYPE 0x6L +BEGIN +BLOCK StringFileInfo +BEGIN +BLOCK 04b0 +BEGIN +VALUE CompanyName, Open vSwitch +VALUE FileDescription, Open vSwitch Extension +VALUE FileVersion, 6.3.9600.17298 +VALUE InternalName, OVSExt.SYS +VALUE LegalCopyright, � Licensed under the Apache License, Version 2.0 (the License) +VALUE OriginalFilename, OVSExt.SYS +VALUE ProductName, Open vSwitch 8/8.1 DDK driver +VALUE ProductVersion, 6.3.9600.17298 +END +END +BLOCK VarFileInfo +BEGIN +VALUE Translation, 0x0, 1200 +END +END + + +#ifdef APSTUDIO_INVOKED +/ +// +// TEXTINCLUDE // -#include windows.h -#include ntverp.h - -/*---*/ -/* the following lines are specific to this file */ -/*---*/ - -/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR - * and VER_INTERNALNAME_STR must be defined before including COMMON.VER - * The strings don't need a '\0', since common.ver has them. - */ -#defineVER_FILETYPEVFT_DRV -#defineVER_FILESUBTYPE VFT2_DRV_NETWORK -#define VER_FILEDESCRIPTION_STR VMWare OVS Extension -#define VER_INTERNALNAME_STROVSExt.SYS -#define VER_ORIGINALFILENAME_STROVSExt.SYS -#define VER_LANGNEUTRAL - -#include common.ver +1 TEXTINCLUDE +BEGIN +resource.h\0 +END + +2 TEXTINCLUDE +BEGIN +\0 +END + +3 TEXTINCLUDE +BEGIN +\r\n +\0 +END + +#endif// APSTUDIO_INVOKED + +#endif// English (United States) resources +/ + + + +#ifndef APSTUDIO_INVOKED +/ +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +/ +#endif// not APSTUDIO_INVOKED diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj index 7050015..3367ca6 100644 --- a/datapath-windows/ovsext/ovsext.vcxproj +++ b/datapath-windows/ovsext/ovsext.vcxproj @@ -90,6 +90,7 @@ ClInclude Include=PacketIO.h / ClInclude Include=PacketParser.h / ClInclude Include=precomp.h / +ClInclude Include=resource.h / ClInclude Include=Stt.h / ClInclude Include=Switch.h / ClInclude Include=Tunnel.h / diff --git a/datapath-windows/ovsext/resource.h b/datapath-windows/ovsext/resource.h new file mode 100644 index 000..3294ef6 --- /dev/null +++ b/datapath-windows/ovsext/resource.h @@ -0,0 +1,1576 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ovsext.rc +// +#define SW_HIDE 0 +#define HIDE_WINDOW
Re: [ovs-dev] [PATCH] datapath-windows: Modified dump start message memory representation
Alin, it is a different one. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, July 13, 2015 11:58 AM To: Ben Pfaff; Sorin Vinturis Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Modified dump start message memory representation I am biased about the patch since this patch is already in: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs_commit_216e1c149a5c6d83884db447e16d30e063e1275dd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SNEISd9_Eld6TNkho7w3ebxXpWc_qJRQUxswVpcxOMIs=hiz_0swvd7FH-mSqSjuAuEduyuI7C6654LfexQhiWmIe= Alin. -Mesaj original- De la: dev [mailto:dev-boun...@openvswitch.org] În numele Ben Pfaff Trimis: Monday, July 13, 2015 8:54 PM Către: Sorin Vinturis Cc: dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH] datapath-windows: Modified dump start message memory representation On Fri, Jul 03, 2015 at 03:36:37PM +, Sorin Vinturis wrote: Changed the dump start message memory representation to be static. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com It's been over a week without a review. I hope that someone looks at this soon. ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SNEISd9_Eld6TNkho7w3ebxXpWc_qJRQUxswVpcxOMIs=77JFN63KVczTH9Qw9T0Vu-6-WXCqFhHYqKsljgZATDwe= ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SNEISd9_Eld6TNkho7w3ebxXpWc_qJRQUxswVpcxOMIs=77JFN63KVczTH9Qw9T0Vu-6-WXCqFhHYqKsljgZATDwe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Modified dump start message memory representation
Hi Sorin, Thank you for addressing my comments. Can we please use a flag which indicates that the a dump process is in progress rather than setting the whole buffer to zero? Besides of that, everything is good. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, July 03, 2015 8:37 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Modified dump start message memory representation Changed the dump start message memory representation to be static. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com --- datapath-windows/ovsext/Datapath.c | 53 +- datapath-windows/ovsext/Datapath.h | 8 +++--- datapath-windows/ovsext/Flow.c | 4 +-- datapath-windows/ovsext/Util.h | 5 datapath-windows/ovsext/Vport.c| 9 --- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 4af909c..603008d 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -347,21 +347,16 @@ NDIS_SPIN_LOCK ovsCtrlLockObj; PNDIS_SPIN_LOCK gOvsCtrlLock; NTSTATUS -InitUserDumpState(POVS_OPEN_INSTANCE instance, - POVS_MESSAGE ovsMsg) +SetUserDumpState(POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg) { /* Clear the dumpState from a previous dump sequence. */ -ASSERT(instance-dumpState.ovsMsg == NULL); +ASSERT(OvsBufferIsEmpty((char*)instance-dumpState.ovsMsg, + sizeof(instance-dumpState.ovsMsg))); ASSERT(ovsMsg); -instance-dumpState.ovsMsg = -(POVS_MESSAGE)OvsAllocateMemoryWithTag(sizeof(OVS_MESSAGE), - OVS_DATAPATH_POOL_TAG); -if (instance-dumpState.ovsMsg == NULL) { -return STATUS_NO_MEMORY; -} -RtlCopyMemory(instance-dumpState.ovsMsg, ovsMsg, - sizeof *instance-dumpState.ovsMsg); +RtlCopyMemory(instance-dumpState.ovsMsg, ovsMsg, + sizeof instance-dumpState.ovsMsg); RtlZeroMemory(instance-dumpState.index, sizeof instance-dumpState.index); @@ -369,13 +364,9 @@ InitUserDumpState(POVS_OPEN_INSTANCE instance, } VOID -FreeUserDumpState(POVS_OPEN_INSTANCE instance) +ClearUserDumpState(POVS_OPEN_INSTANCE instance) { -if (instance-dumpState.ovsMsg != NULL) { -OvsFreeMemoryWithTag(instance-dumpState.ovsMsg, - OVS_DATAPATH_POOL_TAG); -RtlZeroMemory(instance-dumpState, sizeof instance-dumpState); -} +RtlZeroMemory(instance-dumpState, sizeof instance-dumpState); } VOID @@ -588,7 +579,6 @@ OvsRemoveOpenInstance(PFILE_OBJECT fileObject) OvsReleaseCtrlLock(); ASSERT(instance-eventQueue == NULL); ASSERT (instance-packetQueue == NULL); -FreeUserDumpState(instance); OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); } @@ -839,12 +829,14 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, * * In the absence of a dump start, return 0 bytes. */ -if (instance-dumpState.ovsMsg == NULL) { +if (OvsBufferIsEmpty((char*)instance-dumpState.ovsMsg, + sizeof(instance-dumpState.ovsMsg))) { replyLen = 0; status = STATUS_SUCCESS; goto done; } -RtlCopyMemory(ovsMsgReadOp, instance-dumpState.ovsMsg, + +RtlCopyMemory(ovsMsgReadOp, instance-dumpState.ovsMsg, sizeof (ovsMsgReadOp)); /* Create an NL message for consumption. */ @@ -1263,11 +1255,12 @@ HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx, } else { NL_BUFFER nlBuf; NTSTATUS status; -POVS_MESSAGE msgIn = instance-dumpState.ovsMsg; +POVS_MESSAGE msgIn = instance-dumpState.ovsMsg; ASSERT(usrParamsCtx-devOp == OVS_READ_DEV_OP); -if (instance-dumpState.ovsMsg == NULL) { +if (OvsBufferIsEmpty((char*)instance-dumpState.ovsMsg, + sizeof(instance-dumpState.ovsMsg))) { ASSERT(FALSE); return STATUS_INVALID_DEVICE_STATE; } @@ -1285,7 +1278,7 @@ HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx, if (status != STATUS_SUCCESS) { *replyLen = 0; -FreeUserDumpState(instance); +ClearUserDumpState(instance); return status; } @@ -1293,8 +1286,8 @@ HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx, instance-dumpState.index[0] = 1; *replyLen = msgOut-nlMsg.nlmsgLen; -/* Free up the dump state, since there's no more data to continue. */ -FreeUserDumpState(instance); +/* Clear the dump state, since there's no more data to continue. */ +ClearUserDumpState(instance); } return STATUS_SUCCESS; @@
Re: [ovs-dev] [PATCH] datapath-windows: Update VXLAN header information
Hi Alin, Can you please explain why the FilterID is used to maintain the number of transmitted bytes? The FilterID is sent to WFP when we add a filter so the filter can be deleted later by specifying this ID. Once the ID is modified the removal of the filter will fail. I think we want to use as separate variable for it (e.g. STT code). Thank you, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, July 13, 2015 8:39 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Update VXLAN header information Use tunnel key information on the IP header preceding the VXLAN header. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/ovsext/Vxlan.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/Vxlan.c b/datapath-windows/ovsext/Vxlan.c index f43805a..16c80b9 100644 --- a/datapath-windows/ovsext/Vxlan.c +++ b/datapath-windows/ovsext/Vxlan.c @@ -15,6 +15,7 @@ */ #include precomp.h +#include Atomic.h #include NetProto.h #include Switch.h #include Vport.h @@ -263,11 +264,13 @@ OvsDoEncapVxlan(POVS_VPORT_ENTRY vport, ipHdr = (IPHdr *)((PCHAR)ethHdr + sizeof *ethHdr); ipHdr-ihl = sizeof *ipHdr / 4; -ipHdr-version = IPV4; -ipHdr-tos = 0; +ipHdr-version = IPPROTO_IPV4; +ipHdr-tos = tunKey-tos; ipHdr-tot_len = htons(NET_BUFFER_DATA_LENGTH(curNb) - sizeof *ethHdr); -ipHdr-id = 0; -ipHdr-frag_off = IP_DF_NBO; +ipHdr-id = (uint16)atomic_add64(vportVxlan-filterID, + NET_BUFFER_DATA_LENGTH(curNb)); +ipHdr-frag_off = (tunKey-flags OVS_TNL_F_DONT_FRAGMENT) ? + IP_DF_NBO : 0; ipHdr-ttl = tunKey-ttl ? tunKey-ttl : VXLAN_DEFAULT_TTL; ipHdr-protocol = IPPROTO_UDP; ASSERT(tunKey-dst == fwdInfo-dstIpAddr); @@ -279,7 +282,7 @@ OvsDoEncapVxlan(POVS_VPORT_ENTRY vport, /* UDP header */ udpHdr = (UDPHdr *)((PCHAR)ipHdr + sizeof *ipHdr); -udpHdr-source = htons(tunKey-flow_hash | 32768); +udpHdr-source = htons(tunKey-flow_hash | MAXINT16); udpHdr-dest = htons(vportVxlan-dstPort); udpHdr-len = htons(NET_BUFFER_DATA_LENGTH(curNb) - headRoom + sizeof *udpHdr + sizeof *vxlanHdr); -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Gka-eilVbOezK04WXSr9wUJYN7f8vbr2ZVKTk4ck4eos=-IPN21a76q0_LvUuzMjrtWNsLoKW1CQxqCzWu1QlB_Ae= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Solved memory leak in OVS datapath
Hi Sorin, Please consider to have the dump state as part of the usermode instance (regardless if dump initiated or not). This would save the whole housekeeping around this insignificant dynamic memory allocation. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Thursday, July 02, 2015 12:24 AM To: Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Solved memory leak in OVS datapath Acked-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com -Mesaj original- De la: dev [mailto:dev-boun...@openvswitch.org] În numele Sorin Vinturis Trimis: Thursday, July 2, 2015 9:53 AM Către: dev@openvswitch.org Subiect: [ovs-dev] [PATCH] datapath-windows: Solved memory leak in OVS datapath When closing opened instances, make sure the user dump state is cleared. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_90d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=y9vDcTc0RXTftcLjlqfZ62P-E9kaIrToeowiiE1Xsx4s=2ysWHleKrgA8nBthYFZPPmIcC0WCECIbOSO4Am6j_M8e= --- This patch should be applied both on master and branch 2.4. --- datapath-windows/ovsext/Datapath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index d8024c8..4af909c 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -588,6 +588,7 @@ OvsRemoveOpenInstance(PFILE_OBJECT fileObject) OvsReleaseCtrlLock(); ASSERT(instance-eventQueue == NULL); ASSERT (instance-packetQueue == NULL); +FreeUserDumpState(instance); OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=y9vDcTc0RXTftcLjlqfZ62P-E9kaIrToeowiiE1Xsx4s=ZlPfSZTKWL7e49wkW7YE6wpMtK_43vjgKepE_68sKqoe= ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=y9vDcTc0RXTftcLjlqfZ62P-E9kaIrToeowiiE1Xsx4s=ZlPfSZTKWL7e49wkW7YE6wpMtK_43vjgKepE_68sKqoe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Failed initialization for datapath tunnel ports
Hi Sorin, Can you explain which change broke this code. I recall validating connectivity on STT and I believe Nithin validated on STT and on VXLAN channel as well. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 12:52 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Failed initialization for datapath tunnel ports Tunnel ports are not initialized with the corresponding default port. The newly allocated vport is not yet initialized and the ovsType member does not reflect the correct tunnel port type, thus the transport port destination won't be correctly initialized. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_88d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=pfesL1KVpNw4qmTq5MZIQqau5e5kp7SsBE2NKZPDZ-cs=SNm8Qtz_cxNIYVDKYh4l_LI6uE5u2TiHBhM3JAF_WA4e= --- datapath-windows/ovsext/Vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index 9139545..bff3ff6 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -2160,7 +2160,7 @@ OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, if (OvsIsTunnelVportType(portType)) { UINT16 transportPortDest = 0; -switch (vport-ovsType) { +switch (portType) { case OVS_VPORT_TYPE_VXLAN: transportPortDest = VXLAN_UDP_PORT; break; -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=pfesL1KVpNw4qmTq5MZIQqau5e5kp7SsBE2NKZPDZ-cs=yyR0IBVadQHVJleSVrBVbjjppum2LP-iZVNNO2aYa_Ue= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Duplicate tag for STT pools
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 1:13 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Duplicate tag for STT pools All pool allocations should have unique tags. OVS_STT_POOL_TAG matches the OVS_MEMORY_TAG. Changed the OVS_STT_POOL_TAG to make it unique. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com --- datapath-windows/ovsext/Util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index ee676fa..e3f9ede 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -33,7 +33,7 @@ #define OVS_SWITCH_POOL_TAG 'SSVO' #define OVS_USER_POOL_TAG 'USVO' #define OVS_VPORT_POOL_TAG 'PSVO' -#define OVS_STT_POOL_TAG'TSVO' +#define OVS_STT_POOL_TAG'RSVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=5eunmaQkFeujFUE0-chSa0AEbfthYm7XlQqDiPWgNFEs=OJZprgyI70qvYIG-r2y36Z1d_cz_uXa_K5Sjehmpa6we= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 1/2] OVS_UNUSED is defined indirectly
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, June 30, 2015 9:27 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 1/2] OVS_UNUSED is defined indirectly Currently OVS_UNUSED is defined in compiler.h since syslog.h is a standalone wrapper remove it from the parameters. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- include/windows/syslog.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/windows/syslog.h b/include/windows/syslog.h index 242bfc4..d59cd3d 100644 --- a/include/windows/syslog.h +++ b/include/windows/syslog.h @@ -1,5 +1,5 @@ /* - * Copyright 2013 Cloudbase Solutions Srl + * Copyright 2013, 2015 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 @@ -50,13 +50,12 @@ #define LOG_LOCAL7 (233) /* reserved for local use */ static inline void -openlog(const char *ident OVS_UNUSED, int option OVS_UNUSED, -int facility OVS_UNUSED) +openlog(const char *ident, int option, int facility) { } static inline void -syslog(int priority OVS_UNUSED, const char *format OVS_UNUSED, ...) +syslog(int priority, const char *format, ...) { } -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=UiNKiAj_AxA1655axYT2tbB9LVY1qVFbj0fQGC-kbC0s=mkpAIljmIxKyESdXcIQxCwMOaRwtZ2qEBaRW2QX2FJEe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Avoid double incrementation of tx VXLAN packet statistics
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 1:04 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Avoid double incrementation of tx VXLAN packet statistics VXLAN tunnel tx packet stats are incorrectly incremented. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_89d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=wJFMOfNAUyMKMAuFe66_D9sWneOoHJXXkynabNoC8aks=3LRuqX08bbZZE9doRqrXDD7cLKgbcUlrJfIo0sn8c9Ie= --- datapath-windows/ovsext/Actions.c | 1 - 1 file changed, 1 deletion(-) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index e5c122f..c8de7c5 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -313,7 +313,6 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx, ovsActionStats.txStt++; break; } -ovsActionStats.txVxlan++; ovsFwdCtx-tunnelTxNic = dstVport; } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=wJFMOfNAUyMKMAuFe66_D9sWneOoHJXXkynabNoC8aks=4kmTXoMnlAIIege3jgxvVtD3AZ-KeZYoKWrnRxrHQA0e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Failed initialization for datapath tunnel ports
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, July 01, 2015 8:27 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [PATCH] datapath-windows: Failed initialization for datapath tunnel ports Eitan, This code was changed by the STT patch. If the created tunnel has specified the tunnel destination port, then the issue does not occur. But if the created tunnel does not have a specified tunnel port, then the default port is not set and the tunnel destination port will be zero, thus the problem. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Wednesday, 1 July, 2015 18:21 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [PATCH] datapath-windows: Failed initialization for datapath tunnel ports Hi Sorin, Can you explain which change broke this code. I recall validating connectivity on STT and I believe Nithin validated on STT and on VXLAN channel as well. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 12:52 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Failed initialization for datapath tunnel ports Tunnel ports are not initialized with the corresponding default port. The newly allocated vport is not yet initialized and the ovsType member does not reflect the correct tunnel port type, thus the transport port destination won't be correctly initialized. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_88d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=pfesL1KVpNw4qmTq5MZIQqau5e5kp7SsBE2NKZPDZ-cs=SNm8Qtz_cxNIYVDKYh4l_LI6uE5u2TiHBhM3JAF_WA4e= --- datapath-windows/ovsext/Vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index 9139545..bff3ff6 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -2160,7 +2160,7 @@ OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, if (OvsIsTunnelVportType(portType)) { UINT16 transportPortDest = 0; -switch (vport-ovsType) { +switch (portType) { case OVS_VPORT_TYPE_VXLAN: transportPortDest = VXLAN_UDP_PORT; break; -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=pfesL1KVpNw4qmTq5MZIQqau5e5kp7SsBE2NKZPDZ-cs=yyR0IBVadQHVJleSVrBVbjjppum2LP-iZVNNO2aYa_Ue= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 2/2] Undefined symbol make_unix_socket
Hi Alin, Should we implement OVS system logging for Windows through the use of Application Event Logging? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, June 30, 2015 9:28 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 2/2] Undefined symbol make_unix_socket syslog_direct_create defined in (lib/syslog-direct.c) uses make_unix_socket which is currently undefined on the windows build. We either can remove the new file from the chain but this patch proposes to define a wrapper to make_unix_socket in which we return EINVAL. This will avoid this kind of problems in the future. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- lib/socket-util.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/socket-util.h b/lib/socket-util.h index 1178fb8..a0a5c36 100644 --- a/lib/socket-util.h +++ b/lib/socket-util.h @@ -95,6 +95,13 @@ int af_inet_ifreq_ioctl(const char *name, struct ifreq *, #endif #ifdef _WIN32 +static inline int make_unix_socket(int style, bool nonblock, + const char *bind_path, + const char *connect_path) { +return EINVAL; +} + /* Windows defines the 'optval' argument as char * instead of void *. */ #define setsockopt(sock, level, optname, optval, optlen) \ rpl_setsockopt(sock, level, optname, optval, optlen) -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=y_igwxCxxtgun7X4BmzxDG2ek0C_h9frh1L9ukvLkucs=zcKFCr4PuGr2y2JPn60J1jdtIFKCtjqoPxtLm4kw0gYe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports
Hi Sorin, Thank you for debugging this issue. I think that the NBL context signature is used for code validation only (think about a signature we put in an object for the purpose of validating this object when executing in a different context). Can you think about another way to fix this issue (e.g. a status/flag)? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 7:02 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports This BSOD occurred in the context of a packet (NBL) with multiple NET_BUFFER(s) (NBs). The reason for the BSOD is due to the marking of NBLs created by OVS as being external and wrongly completing them. This patch should be applied both on master and branch 2.4. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_82d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQs=3pshLMQB4SoTOb8sZncux7Bi6G5ADQwH7I0TlH9Is2Ue= --- datapath-windows/ovsext/BufferMgmt.c | 8 1 file changed, 8 insertions(+) diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index 83d6cde..d36dfa2 100644 --- a/datapath-windows/ovsext/BufferMgmt.c +++ b/datapath-windows/ovsext/BufferMgmt.c @@ -558,6 +558,12 @@ OvsInitExternalNBLContext(PVOID ovsContext, NDIS_STATUS status; UINT16 flags; +ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); +if (ctx ctx-magic == OVS_CTX_MAGIC) { +OVS_LOG_INFO(nbl context already initialized/allocated by OVS.); +return ctx; +} + poolHandle = NdisGetPoolFromNetBufferList(nbl); if (poolHandle == context-ovsPool.ndisHandle) { @@ -801,6 +807,7 @@ OvsPartialCopyNBL(PVOID ovsContext, OVS_DEFAULT_PORT_NO); InterlockedIncrement((LONG volatile *)srcCtx-refCount); + #ifdef DBG OvsDumpNetBufferList(nbl); OvsDumpForwardingDetails(nbl); @@ -808,6 +815,7 @@ OvsPartialCopyNBL(PVOID ovsContext, OvsDumpNetBufferList(newNbl); OvsDumpForwardingDetails(newNbl); #endif + OVS_LOG_LOUD(Partial Copy new NBL: %p, newNbl); return newNbl; -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQs=M6NSK31Vva4-yAxaCNBMGVI5d9vESZHrNxsIVtrjJEEe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, June 30, 2015 9:39 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE Since commit: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs_commit_2e460098bff351b9fddcb917447caa3b97a35d86d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=uAgTXNKjBK-e8P2evuJh9E4v1c6DHvqSWZL7ljeVFm8s=mvXIWGGUYLF3C5iDvNdcIGD-IZlT2ZufDJGcdvQx1sce= a new packet attribute was introduced. This patch adds OVS_PACKET_ATTR_PROBE to nlPktExecPolicy in datapath-windows and ignores it for the moment to maintain binary compatibility. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/ovsext/User.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index 9f462cf..56f2f7c 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -332,7 +332,8 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, [OVS_PACKET_ATTR_ACTIONS] = {.type = NL_A_UNSPEC, .optional = FALSE}, [OVS_PACKET_ATTR_USERDATA] = {.type = NL_A_UNSPEC, .optional = TRUE}, [OVS_PACKET_ATTR_EGRESS_TUN_KEY] = {.type = NL_A_UNSPEC, -.optional = TRUE} +.optional = TRUE}, +[OVS_PACKET_ATTR_PROBE] = { .type = NL_A_FLAG, .optional = TRUE + } }; RtlZeroMemory(execute, sizeof(OvsPacketExecute)); -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=uAgTXNKjBK-e8P2evuJh9E4v1c6DHvqSWZL7ljeVFm8s=Ck0jQ06QL47kPSKcCUPm1YJccmz6EL65hwB80BQIMWke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports
Sorin, I do understand the issue but the use of the signature to solve it is not clean. The signature field in the context structure is used for validation during debug. It could be removed and the code should still work. We should not use the signature to identify self-allocated NBLs. Please consider to use the pool handle (ovsPool.ndisHandle) instaed. Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, July 01, 2015 8:50 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports Eitan, Consider the scenario below. We receive a packet (NBL), that has multiple NBs, in OvsStartNBLIngress(). The NBL is not allocated by OVS and the NBL context is allocated and initialized in OvsInitExternalNBLContext(). After this the OvsCreateNewNBLsFromMultipleNBs() function is called and the NBL with multiple NBs is splitted into multiple NBLs with single NB, the latter NBLs being allocated by OVS. The execution continues with the first newly allocated NBL with single NB and all goes well until the loop goes to the next NBL with single NB. For this second newly created NBL with single NB the OvsInitExternalNBLContext() is called. Now we need to identify the NBL as being allocated by OVS, so we look at the NBL context signature. I think this is a clean way to identify OVS NBLs, when calling OvsInitExternalNBLContext(). Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Wednesday, 1 July, 2015 18:12 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports Hi Sorin, Thank you for debugging this issue. I think that the NBL context signature is used for code validation only (think about a signature we put in an object for the purpose of validating this object when executing in a different context). Can you think about another way to fix this issue (e.g. a status/flag)? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, July 01, 2015 7:02 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when adding OVS ports This BSOD occurred in the context of a packet (NBL) with multiple NET_BUFFER(s) (NBs). The reason for the BSOD is due to the marking of NBLs created by OVS as being external and wrongly completing them. This patch should be applied both on master and branch 2.4. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_82d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQs=3pshLMQB4SoTOb8sZncux7Bi6G5ADQwH7I0TlH9Is2Ue= --- datapath-windows/ovsext/BufferMgmt.c | 8 1 file changed, 8 insertions(+) diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index 83d6cde..d36dfa2 100644 --- a/datapath-windows/ovsext/BufferMgmt.c +++ b/datapath-windows/ovsext/BufferMgmt.c @@ -558,6 +558,12 @@ OvsInitExternalNBLContext(PVOID ovsContext, NDIS_STATUS status; UINT16 flags; +ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl); +if (ctx ctx-magic == OVS_CTX_MAGIC) { +OVS_LOG_INFO(nbl context already initialized/allocated by OVS.); +return ctx; +} + poolHandle = NdisGetPoolFromNetBufferList(nbl); if (poolHandle == context-ovsPool.ndisHandle) { @@ -801,6 +807,7 @@ OvsPartialCopyNBL(PVOID ovsContext, OVS_DEFAULT_PORT_NO); InterlockedIncrement((LONG volatile *)srcCtx-refCount); + #ifdef DBG OvsDumpNetBufferList(nbl); OvsDumpForwardingDetails(nbl); @@ -808,6 +815,7 @@ OvsPartialCopyNBL(PVOID ovsContext, OvsDumpNetBufferList(newNbl); OvsDumpForwardingDetails(newNbl); #endif + OVS_LOG_LOUD(Partial Copy new NBL: %p, newNbl); return newNbl; -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=yx7HeX13135X7eeWKg3s73H3l711NpzfUes52_NsBqQs=M6NSK31Vva4-yAxaCNBMGVI5d9vESZHrNxsIVtrjJEEe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 2/2] Undefined symbol make_unix_socket
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: Alin Serdean [mailto:aserd...@cloudbasesolutions.com] Sent: Wednesday, July 01, 2015 11:49 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [PATCH 2/2] Undefined symbol make_unix_socket Hi Eitan, It would be a nice idea for a future feature. I think this issue is related to that: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_74d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=mnhiuiHZ3Anzhv-e-D4lRdTb1bqvx_i7JKZ6mjDQ7Hgs=U_DHjCEmSBPo2PVDGEy_8cew0YmY3QVld4tLY1Hrqg4e= . Alin. -Mesaj original- De la: Eitan Eliahu [mailto:elia...@vmware.com] Trimis: Wednesday, July 1, 2015 6:03 PM Către: Alin Serdean; dev@openvswitch.org Subiect: RE: [PATCH 2/2] Undefined symbol make_unix_socket Hi Alin, Should we implement OVS system logging for Windows through the use of Application Event Logging? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, June 30, 2015 9:28 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 2/2] Undefined symbol make_unix_socket syslog_direct_create defined in (lib/syslog-direct.c) uses make_unix_socket which is currently undefined on the windows build. We either can remove the new file from the chain but this patch proposes to define a wrapper to make_unix_socket in which we return EINVAL. This will avoid this kind of problems in the future. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- lib/socket-util.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/socket-util.h b/lib/socket-util.h index 1178fb8..a0a5c36 100644 --- a/lib/socket-util.h +++ b/lib/socket-util.h @@ -95,6 +95,13 @@ int af_inet_ifreq_ioctl(const char *name, struct ifreq *, #endif #ifdef _WIN32 +static inline int make_unix_socket(int style, bool nonblock, + const char *bind_path, + const char *connect_path) { +return EINVAL; +} + /* Windows defines the 'optval' argument as char * instead of void *. */ #define setsockopt(sock, level, optname, optval, optlen) \ rpl_setsockopt(sock, level, optname, optval, optlen) -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=y_igwxCxxtgun7X4BmzxDG2ek0C_h9frh1L9ukvLkucs=zcKFCr4PuGr2y2JPn60J1jdtIFKCtjqoPxtLm4kw0gYe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE
Hi Ben, In general it doesn't seem that if the datapath does not support an attribute it would fail. (In other words the parsing validation code will not fail if an attribute is not included in the policy array). I am not sure if the addition of this specific attribute to the policy masks an issue or not. Perhaps Alin can tell. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Wednesday, July 01, 2015 2:53 PM To: Alin Serdean Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE On Wed, Jul 01, 2015 at 06:57:50PM +, Alin Serdean wrote: Since commit: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvs witch_ovs_commit_2e460098bff351b9fddcb917447caa3b97a35d86d=BQIGaQc=S qcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e 3geGYp56lkcH-5cLCYm=wSN1s5IDTOoE-dDGQWtmN87LEkQnYq71hKWcn7d3SJks=8_A Va78P_KXRWsNoVVtFSjNbBrJjyie8OjjjH4U953Ue= a new packet attribute was introduced. This patch adds OVS_PACKET_ATTR_PROBE to nlPktExecPolicy in datapath-windows and ignores it for the moment to maintain binary compatibility. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Acked-by: Eitan Eliahu elia...@vmware.com --- This patch should be applied on master and branch-2.4 v2: add acked-by This patch makes me worry a bit. The Linux kernel and OVS userspace implementations of Netlink ignore attributes that they do not recognize, which allows for some kinds of compatibility. To me, this patch implies that the Windows datapath reports an error when it sees an unrecognized attribute. Is that correct? If so, then that should be changed, because otherwise it will cause compatibility problems in the future. ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=wSN1s5IDTOoE-dDGQWtmN87LEkQnYq71hKWcn7d3SJks=TZgQzcgvt8NDu-lf_W0nI9BkcWxoExr-9T2PSSonAbke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE
Yes, this would make the parse function to fail and in fact it will access the policy array beyond its boundary. Thanks Alin and Ben, Eitan -Original Message- From: Alin Serdean [mailto:aserd...@cloudbasesolutions.com] Sent: Wednesday, July 01, 2015 5:13 PM To: Ben Pfaff; Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE Sorry was relocating home. Thanks for raising the question, it made me realize another problem :) To answer your question directly: no this patch just ignores the attribute completely it does not do any additional operations. I introduced the attribute because it was failing at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs_blob_master_datapath-2Dwindows_ovsext_User.c-23L341d=BQIFBAc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=j9PYXgmBEpEQ5TpurOxWZwzwvN4XAFYcfCY5m02h7dks=7JHTeOT7zkl1tqjWKBXmNXZrAB6YtqNxiYOyTN6vedoe= , and to be more direct because the optional parameter was zero but apparently this is just the symptom. Due to your question I relooked over the code and found the actual problem: when we are calling NlAttrParse we are calling it with array size of the __OVS_PACKET_ATTR_MAX(the one defined in openvswitch.h) when we should call it with the array size of the policy itself. I will look over the windows datapath code to see if we slipped in that mistake in other parts as well and will try to send the patches asap. Regarding the patch it is semi dead weight because it just introduces the attribute but no real logic is behind (it will work with and without it). Alin. -Mesaj original- De la: Ben Pfaff [mailto:b...@nicira.com] Trimis: Thursday, July 2, 2015 2:36 AM Către: Eitan Eliahu Cc: Alin Serdean; dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE Alin? On Wed, Jul 01, 2015 at 11:04:57PM +, Eitan Eliahu wrote: Hi Ben, In general it doesn't seem that if the datapath does not support an attribute it would fail. (In other words the parsing validation code will not fail if an attribute is not included in the policy array). I am not sure if the addition of this specific attribute to the policy masks an issue or not. Perhaps Alin can tell. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Wednesday, July 01, 2015 2:53 PM To: Alin Serdean Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: OVS_PACKET_ATTR_PROBE On Wed, Jul 01, 2015 at 06:57:50PM +, Alin Serdean wrote: Since commit: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_open vs witch_ovs_commit_2e460098bff351b9fddcb917447caa3b97a35d86d=BQIGaQc =S qcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ 4e 3geGYp56lkcH-5cLCYm=wSN1s5IDTOoE-dDGQWtmN87LEkQnYq71hKWcn7d3SJks=8 _A Va78P_KXRWsNoVVtFSjNbBrJjyie8OjjjH4U953Ue= a new packet attribute was introduced. This patch adds OVS_PACKET_ATTR_PROBE to nlPktExecPolicy in datapath-windows and ignores it for the moment to maintain binary compatibility. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Acked-by: Eitan Eliahu elia...@vmware.com --- This patch should be applied on master and branch-2.4 v2: add acked-by This patch makes me worry a bit. The Linux kernel and OVS userspace implementations of Netlink ignore attributes that they do not recognize, which allows for some kinds of compatibility. To me, this patch implies that the Windows datapath reports an error when it sees an unrecognized attribute. Is that correct? If so, then that should be changed, because otherwise it will cause compatibility problems in the future. ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ma ilman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt- uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=wSN1s5IDTOoE-dDGQW tmN87LEkQnYq71hKWcn7d3SJks=TZgQzcgvt8NDu-lf_W0nI9BkcWxoExr-9T2PSSonAb ke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath
Alin, We just need to add: [OVS_FLOW_ATTR_PROBE] = { .type = NLA_FLAG }, to the flow policy. This is not a hack. If it is time consuming please go ahead with the uder mode change. Thanks, Eitan -Original Message- From: Alin Serdean [mailto:aserd...@cloudbasesolutions.com] Sent: Thursday, June 25, 2015 7:30 AM To: Nithin Raju; Eitan Eliahu Cc: Ben Pfaff; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath Both are hacks IMO. We could respond to DPIF_FP_PROBE but I prefer to do it in userspace until we address the bigger problem in the datapath. Alin. -Mesaj original- De la: Nithin Raju [mailto:nit...@vmware.com] Trimis: Thursday, June 25, 2015 4:51 PM Către: Eitan Eliahu Cc: Ben Pfaff; Alin Serdean; dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath On Jun 24, 2015, at 12:57 PM, Eitan Eliahu elia...@vmware.com wrote: I'm wondering if we could fail this call in the datapath level by examining the DPIF_FP_PROBE bit in the flags. If it is too hard we can still live with user mode code change. Thanks, Eitan That’s a good suggestion. We can go with Alin’s solution for 2.4 since we exactly know what code we will be disabling, and work on the flow validation logic for master. thanks, -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] [PATCH v3][branch-2.4] dpif_probe_feature not suported in windows datapath
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Thursday, June 25, 2015 10:19 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] [PATCH v3][branch-2.4] dpif_probe_feature not suported in windows datapath This patch disables features which are not currently supported in the windows datapath. Unfortunately we have to do it in userspace because dpif_probe_feature is not treated accordingly in the windows the datapath. I opened the issue to track the feature for later implementations: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_85d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=HJQhy35_OR1JNLBJwkqAnyF4JP3rIFj7afqs8puK-5Qs=DQfR4oXdznIeaYj4XE1I8Np2yJchVsAJQbB2paQyOf8e= Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- v3: Add Sign-off-by v2: Rebase --- --- ofproto/ofproto-dpif.c | 17 + 1 file changed, 17 insertions(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 369e0b9..6cdaa32 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1010,8 +1010,14 @@ check_recirc(struct dpif_backer *backer) ofpbuf_use_stack(key, keybuf, sizeof keybuf); odp_flow_key_from_flow(key, flow, NULL, 0, true); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +enable_recirc = false; +#else enable_recirc = dpif_probe_feature(backer-dpif, recirculation, key, NULL); +#endif if (enable_recirc) { VLOG_INFO(%s: Datapath supports recirculation, @@ -1045,7 +1051,13 @@ check_ufid(struct dpif_backer *backer) odp_flow_key_from_flow(key, flow, NULL, 0, true); dpif_flow_hash(backer-dpif, key.data, key.size, ufid); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +enable_ufid = false; +#else enable_ufid = dpif_probe_feature(backer-dpif, UFID, key, ufid); +#endif if (enable_ufid) { VLOG_INFO(%s: Datapath supports unique flow ids, @@ -1151,6 +1163,11 @@ check_max_mpls_depth(struct dpif_backer *backer) ofpbuf_use_stack(key, keybuf, sizeof keybuf); odp_flow_key_from_flow(key, flow, NULL, 0, false); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +break; +#endif if (!dpif_probe_feature(backer-dpif, MPLS, key, NULL)) { break; } -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=HJQhy35_OR1JNLBJwkqAnyF4JP3rIFj7afqs8puK-5Qs=qV4ezZ0iFbhztu1BiqvQsHBK0NjZa-WCQ0gQpUm4TvIe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath
If it gets too involved have your user mode hack instead. Thanks Alin. Eitan -Original Message- From: Alin Serdean [mailto:aserd...@cloudbasesolutions.com] Sent: Thursday, June 25, 2015 8:38 AM To: Eitan Eliahu; Nithin Raju Cc: Ben Pfaff; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath Eitan, Ok I will add it in the datapath. Why I am considering it as a hack, because if we see it in the datapath we just reply with an error, there will be no logic behind it at the moment. But maybe it makes some sense to have it for further user. Alin. -Mesaj original- De la: Eitan Eliahu [mailto:elia...@vmware.com] Trimis: Thursday, June 25, 2015 6:01 PM Către: Alin Serdean; Nithin Raju Cc: Ben Pfaff; dev@openvswitch.org Subiect: RE: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath Alin, We just need to add: [OVS_FLOW_ATTR_PROBE] = { .type = NLA_FLAG }, to the flow policy. This is not a hack. If it is time consuming please go ahead with the uder mode change. Thanks, Eitan -Original Message- From: Alin Serdean [mailto:aserd...@cloudbasesolutions.com] Sent: Thursday, June 25, 2015 7:30 AM To: Nithin Raju; Eitan Eliahu Cc: Ben Pfaff; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath Both are hacks IMO. We could respond to DPIF_FP_PROBE but I prefer to do it in userspace until we address the bigger problem in the datapath. Alin. -Mesaj original- De la: Nithin Raju [mailto:nit...@vmware.com] Trimis: Thursday, June 25, 2015 4:51 PM Către: Eitan Eliahu Cc: Ben Pfaff; Alin Serdean; dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath On Jun 24, 2015, at 12:57 PM, Eitan Eliahu elia...@vmware.com wrote: I'm wondering if we could fail this call in the datapath level by examining the DPIF_FP_PROBE bit in the flags. If it is too hard we can still live with user mode code change. Thanks, Eitan That’s a good suggestion. We can go with Alin’s solution for 2.4 since we exactly know what code we will be disabling, and work on the flow validation logic for master. thanks, -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath
I'm wondering if we could fail this call in the datapath level by examining the DPIF_FP_PROBE bit in the flags. If it is too hard we can still live with user mode code change. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Wednesday, June 24, 2015 11:05 AM To: Alin Serdean Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath I guess this solution is OK with me for 2.4. Nithin (or anyone), do you agree that it's the best solution for now? On Fri, Jun 19, 2015 at 04:41:47PM +, Alin Serdean wrote: To do it the proper way yes. I really hate to do it this way but given the timeframe for 2.4 we could nuke it later on. Alin. -Mesaj original- De la: Nithin Raju [mailto:nit...@vmware.com] Trimis: Friday, June 19, 2015 7:36 PM Către: Alin Serdean Cc: dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH v2] dpif_probe_feature not suported in windows datapath hi Alin, Do you know what is required to complete the implementation of dpif_probe_feature() in the Windows datapath? Is it the flow validation logic? thanks, -- Nithin On Jun 18, 2015, at 6:47 PM, Alin Serdean aserd...@cloudbasesolutions.com wrote: This patch disables features which are not currently supported in the windows datapath. Unfortunately we have to do it in userspace because dpif_probe_feature is not treated accordingly in the windows the datapath. I opened the issue to track the feature for later implementations: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_open vs witch_ovs-2Dissues_issues_85d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeA w- YihVMNtXt-uEsr=pNHQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80m=H9ymRG wE SDpjH0qHp5EifPK6QimZgzvHEIyjM3QzRwgs=-rOo7BG2BoxcGi2BlSQASDz8v5Hkhp 4y MoGbPZ-zQuse= --- v2: Rebase --- ofproto/ofproto-dpif.c | 17 + 1 file changed, 17 insertions(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 0de8686..55d004e 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1014,8 +1014,14 @@ check_recirc(struct dpif_backer *backer) ofpbuf_use_stack(key, keybuf, sizeof keybuf); odp_flow_key_from_flow(odp_parms, key); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +enable_recirc = false; +#else enable_recirc = dpif_probe_feature(backer-dpif, recirculation, key, NULL); +#endif if (enable_recirc) { VLOG_INFO(%s: Datapath supports recirculation, @@ -1052,7 +1058,13 @@ check_ufid(struct dpif_backer *backer) odp_flow_key_from_flow(odp_parms, key); dpif_flow_hash(backer-dpif, key.data, key.size, ufid); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +enable_ufid = false; +#else enable_ufid = dpif_probe_feature(backer-dpif, UFID, key, ufid); +#endif if (enable_ufid) { VLOG_INFO(%s: Datapath supports unique flow ids, @@ -1161,6 +1173,11 @@ check_max_mpls_depth(struct dpif_backer *backer) ofpbuf_use_stack(key, keybuf, sizeof keybuf); odp_flow_key_from_flow(odp_parms, key); +#ifdef _WIN32 +/* XXX Force disable of datapath recirculation from userspace until the + * dpif_probe_feature is properly implemented in the windows datapath */ +break; +#endif if (!dpif_probe_feature(backer-dpif, MPLS, key, NULL)) { break; } -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ ma ilman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtX t- uEsr=pNHQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80m=H9ymRGwESDpjH0qH p5 EifPK6QimZgzvHEIyjM3QzRwgs=voVGofZZJTP055uwJnpQBjFDxPbFyaiHEtEtt140 MO Ee= ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ma ilman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt- uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=VgcETFFbbuqnE2agha rVPMWHqSyP7L2kf73r940PsMgs=HMaPgTvdxvCtlAQc-yi3VXOLpNatDI43OgRlwifibU Me= ___ dev mailing list dev@openvswitch.org
Re: [ovs-dev] [PATCH v2] datapath-windows: Return success for already existing WFP objects
Hi Sorin, Although the patch by itself can't hurt but I would suggest that we would root cause the issue of not freeing WFP object on error conditions. Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, June 22, 2015 10:26 AM To: Eitan Eliahu Cc: Nithin Raju; dev@openvswitch.org Subject: RE: [PATCH v2] datapath-windows: Return success for already existing WFP objects Hi Eitan/Nithin, In normal execution flow all WFP objects are released after the extension is disabled. The patch was meant to address the cases when the extension was not properly disabled due to some unforeseen error, which does not deletes all WFP objects like the OVS sublayer or callout. Many times I have seen an improper activation of the OVS extension because the sublayer or callout already existed. However I have not been able to reproduce the problem with the latest code from the master branch. The extension is much more stable with the latest patches and I cannot provide reproduction steps for this issue. -Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Saturday, 20 June, 2015 15:35 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [PATCH v2] datapath-windows: Return success for already existing WFP objects Hi Sorin, Could you please let us know what are the cases where these object are already existed? I just want to be sure that we free all these objects when stopping the extension. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, June 18, 2015 11:37 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Return success for already existing WFP objects There are cases when the WFP callout or sublayer, being persistent objects, already exists when we try to register the OVS callout. In this cases, when trying to add again these WFP objects the return code is STATUS_FWP_ALREADY_EXISTS, which we are interpreting as an error. This is incorrect and this patch changes that. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_84d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=2m9yV1dqLYwW4Lrbg7_G7J56pKu7tJ_TE125ybtwKTAs=bUUf7r2FXP4oMOFNjo2zKOSwbuJHfFjLSq2Pe8yz0sMe= --- datapath-windows/ovsext/TunnelFilter.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index 08cc13f..231750e 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -414,7 +414,12 @@ OvsTunnelRegisterDatagramDataCallouts(const GUID *layerKey, status = FwpmCalloutAdd(gEngineHandle, mCallout, NULL, NULL); if (!NT_SUCCESS(status)) { -goto Exit; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP callout, status: %x., + status); +goto Exit; +} +status = STATUS_SUCCESS; } Exit: @@ -459,7 +464,11 @@ OvsTunnelRegisterCallouts(VOID *deviceObject) status = FwpmSubLayerAdd(gEngineHandle, OvsTunnelSubLayer, NULL); if (!NT_SUCCESS(status)) { -goto Exit; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP sublayer, status: %x., + status); +goto Exit; +} } /* In order to use this callout a socket must be opened. */ -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=2m9yV1dqLYwW4Lrbg7_G7J56pKu7tJ_TE125ybtwKTAs=1h_FXA4x7kLJqZuawSWu_SwiMnBCMlk29lqJ5ldr1Tke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] datapath-windows: Return success for already existing WFP objects
Hi Sorin, Could you please let us know what are the cases where these object are already existed? I just want to be sure that we free all these objects when stopping the extension. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, June 18, 2015 11:37 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Return success for already existing WFP objects There are cases when the WFP callout or sublayer, being persistent objects, already exists when we try to register the OVS callout. In this cases, when trying to add again these WFP objects the return code is STATUS_FWP_ALREADY_EXISTS, which we are interpreting as an error. This is incorrect and this patch changes that. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_84d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=2m9yV1dqLYwW4Lrbg7_G7J56pKu7tJ_TE125ybtwKTAs=bUUf7r2FXP4oMOFNjo2zKOSwbuJHfFjLSq2Pe8yz0sMe= --- datapath-windows/ovsext/TunnelFilter.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index 08cc13f..231750e 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -414,7 +414,12 @@ OvsTunnelRegisterDatagramDataCallouts(const GUID *layerKey, status = FwpmCalloutAdd(gEngineHandle, mCallout, NULL, NULL); if (!NT_SUCCESS(status)) { -goto Exit; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP callout, status: %x., + status); +goto Exit; +} +status = STATUS_SUCCESS; } Exit: @@ -459,7 +464,11 @@ OvsTunnelRegisterCallouts(VOID *deviceObject) status = FwpmSubLayerAdd(gEngineHandle, OvsTunnelSubLayer, NULL); if (!NT_SUCCESS(status)) { -goto Exit; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP sublayer, status: %x., + status); +goto Exit; +} } /* In order to use this callout a socket must be opened. */ -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=2m9yV1dqLYwW4Lrbg7_G7J56pKu7tJ_TE125ybtwKTAs=1h_FXA4x7kLJqZuawSWu_SwiMnBCMlk29lqJ5ldr1Tke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] datapath-windows: BSOD when disabling the extension
Acked-by: Eitan Eliahu elia...@vmware.com Thanks Sorin. Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Tuesday, June 16, 2015 2:36 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] datapath-windows: BSOD when disabling the extension Hi Eitan, Please see below the stacktrace of the BSOD. The FilterDetach routine was called while the requests were being processed and the gOvsSwitchContext global pointer was set to NULL. In this case the gOvsSwitchContext was not released, but only the gOvsSwitchContextRefCount reference count was decreased. -Sorin *** * * *Bugcheck Analysis* * * *** SYSTEM_SERVICE_EXCEPTION (3b) An exception happened while executing a system service routine. Arguments: Arg1: c005, Exception code that caused the bugcheck Arg2: f800023e685b, Address of the instruction which caused the bugcheck Arg3: d000236adad0, Address of the context record for the exception that caused the bugcheck Arg4: , zero. Debugging Details: -- KERNEL32.DLL was not found in the image list. Debugger will attempt to load KERNEL32.DLL at given base `. Please provide the full image name, including the extension (i.e. kernel32.dll) for more reliable results.Base address and size overrides can be given as .reload image.ext=base,size. Unable to add module at ` EXCEPTION_CODE: (NTSTATUS) 0xc005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s. FAULTING_IP: OVSExt!OvsNewVportCmdHandler+27b [c:\1.data\cloudbase\work\git\ovs\datapath-windows\ovsext\vport.c @ 2136] f800`023e685b 488b4870mov rcx,qword ptr [rax+70h] CONTEXT: d000236adad0 -- (.cxr 0xd000236adad0;r) rax= rbx=e33517a0 rcx=e39688e4 rdx=d000236ae584 rsi=e2d93c90 rdi=e33517a0 rip=f800023e685b rsp=d000236ae500 rbp=d000236aeb80 r8= r9=f800023f0a50 r10=d00020b02f80 r11=d00020afec30 r12= r13=0001 r14=e33518b8 r15=e2e53920 iopl=0 nv up ei pl zr na po nc cs=0010 ss=0018 ds=002b es=002b fs=0053 gs=002b efl=00010246 OVSExt!OvsNewVportCmdHandler+0x27b: f800`023e685b 488b4870mov rcx,qword ptr [rax+70h] ds:002b:`0070= Last set context: rax= rbx=e33517a0 rcx=e39688e4 rdx=d000236ae584 rsi=e2d93c90 rdi=e33517a0 rip=f800023e685b rsp=d000236ae500 rbp=d000236aeb80 r8= r9=f800023f0a50 r10=d00020b02f80 r11=d00020afec30 r12= r13=0001 r14=e33518b8 r15=e2e53920 iopl=0 nv up ei pl zr na po nc cs=0010 ss=0018 ds=002b es=002b fs=0053 gs=002b efl=00010246 OVSExt!OvsNewVportCmdHandler+0x27b: f800`023e685b 488b4870mov rcx,qword ptr [rax+70h] ds:002b:`0070= Resetting default scope DEFAULT_BUCKET_ID: WIN8_DRIVER_FAULT BUGCHECK_STR: 0x3B PROCESS_NAME: ovs-vswitchd.e CURRENT_IRQL: 0 ANALYSIS_VERSION: 6.3.9600.17237 (debuggers(dbg).140716-0327) amd64fre LAST_CONTROL_TRANSFER: from f800023d67f6 to f800023e685b STACK_TEXT: d000`236ae500 f800`023d67f6 : d000`236ae7c0 d000`236ae728 e000` `0010 : OVSExt!OvsNewVportCmdHandler+0x27b [c:\1.data\cloudbase\work\git\ovs\datapath-windows\ovsext\vport.c @ 2136] d000`236ae630 f800`023f6aff : d000`236ae7c0 f800`023f2220 d000`236ae728 e000`039688c0 : OVSExt!InvokeNetlinkCmdHandler+0x106 [c:\1.data\cloudbase\work\git\ovs\datapath-windows\ovsext\datapath.c @ 1003] d000`236ae6b0 f800`0073bc18 : e000`02d93c90 e000`033517a0 e000`02e53920 e000`033517a0 : OVSExt!OvsDeviceControl+0x98f [c:\1.data\cloudbase\work\git\ovs\datapath-windows\ovsext\datapath.c @ 912] d000`236ae840 f803`8ce4f395 : e000`033517a0 `0001 e000`02e53920 `000e : NDIS!ndisDummyIrpHandler+0x88 d000`236ae870 f803`8ce4fd2a : e32b`7f20ffbd 000c`001f0003 `0001 ` : nt!IopXxxControlFile+0x845 d000`236aea20 f803`8cbe08b3 : ` ` `0001 f803` : nt!NtDeviceIoControlFile+0x56 d000`236aea90 `77a22772 : `77a22371 0023`77a6b63c `0023 `00ff : nt!KiSystemServiceCopyEnd+0x13 `00f1e8b8
Re: [ovs-dev] [PATCH v2] datapath-windows: BSOD when disabling the extension
Hi Sorin, Can you please forward stack trace? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, June 15, 2015 7:49 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: BSOD when disabling the extension When the filter detach routine is called while there are packets still in processing, the OvsUninitSwitchContext function call will decrement the switch context reference count without releasing the switch context structure. This behaviour is correct and expected, but the BSOD is caused in this case because the gOvsSwitchContext variable is set to NULL, which is wrong. The gOvsSwitchContext global variable must be set to NULL only when the switch context structure is actually released. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_80d=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=fxSjeLfMN40XNZsRUW1pOUC4BaXKLNmvM0IzVTxe32os=PNqZC6M2Nbl0WZJOWoEUmJTabsU0eJulnLzdB9mcYkke= Acked-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/ovsext/Switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index f877854..99a306d 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -201,6 +201,7 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, status = OvsInitSwitchContext(switchContext); if (status != NDIS_STATUS_SUCCESS) { OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); +switchContext = NULL; goto create_switch_done; } @@ -240,7 +241,6 @@ OvsExtDetach(NDIS_HANDLE filterModuleContext) } OvsDeleteSwitch(switchContext); OvsCleanupIpHelper(); -gOvsSwitchContext = NULL; /* This completes the cleanup, and a new attach can be handled now. */ OVS_LOG_TRACE(Exit: OvsDetach Successfully); @@ -495,6 +495,7 @@ OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext) if (ref == 1) { OvsDeleteSwitchContext(switchContext); +gOvsSwitchContext = NULL; } } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=fxSjeLfMN40XNZsRUW1pOUC4BaXKLNmvM0IzVTxe32os=OgmOQuSMC-PwPV_FBD6LjMrxl7Ze1VPrMIRnwXiXNVIe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH ovn] ofctrl: Don't use designated initializers.
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Monday, June 15, 2015 12:52 PM To: dev@openvswitch.org Cc: Gurucharan Shetty Subject: [ovs-dev] [PATCH ovn] ofctrl: Don't use designated initializers. MSVC 2013 does not like designated initializers when structs are initialized inside structs. Apparently it has been fixed in MSCV 2015. Signed-off-by: Gurucharan Shetty gshe...@nicira.com --- ovn/controller/ofctrl.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c index bc4e8d4..ec0d868 100644 --- a/ovn/controller/ofctrl.c +++ b/ovn/controller/ofctrl.c @@ -401,12 +401,11 @@ ofctrl_update_flows(void) if (!d) { /* Installed flow is no longer desirable. Delete it from the * switch and from installed_flows. */ -struct ofputil_flow_mod fm = { -.match = i-match, -.priority = i-priority, -.table_id = i-table_id, -.command = OFPFC_DELETE_STRICT, -}; +struct ofputil_flow_mod fm; +fm.match = i-match; +fm.priority = i-priority; +fm.table_id = i-table_id; +fm.command = OFPFC_DELETE_STRICT; queue_flow_mod(fm); ovn_flow_log(i, removing); @@ -416,14 +415,13 @@ ofctrl_update_flows(void) if (!ofpacts_equal(i-ofpacts, i-ofpacts_len, d-ofpacts, d-ofpacts_len)) { /* Update actions in installed flow. */ -struct ofputil_flow_mod fm = { -.match = i-match, -.priority = i-priority, -.table_id = i-table_id, -.ofpacts = d-ofpacts, -.ofpacts_len = d-ofpacts_len, -.command = OFPFC_MODIFY_STRICT, -}; +struct ofputil_flow_mod fm; +fm.match = i-match; +fm.priority = i-priority; +fm.table_id = i-table_id; +fm.ofpacts = d-ofpacts; +fm.ofpacts_len = d-ofpacts_len; +fm.command = OFPFC_MODIFY_STRICT; queue_flow_mod(fm); ovn_flow_log(i, updating); @@ -446,14 +444,13 @@ ofctrl_update_flows(void) struct ovn_flow *d; HMAP_FOR_EACH_SAFE (d, next, hmap_node, desired_flows) { /* Send flow_mod to add flow. */ -struct ofputil_flow_mod fm = { -.match = d-match, -.priority = d-priority, -.table_id = d-table_id, -.ofpacts = d-ofpacts, -.ofpacts_len = d-ofpacts_len, -.command = OFPFC_ADD, -}; +struct ofputil_flow_mod fm; +fm.match = d-match; +fm.priority = d-priority; +fm.table_id = d-table_id; +fm.ofpacts = d-ofpacts; +fm.ofpacts_len = d-ofpacts_len; +fm.command = OFPFC_ADD; queue_flow_mod(fm); ovn_flow_log(d, adding); -- 1.7.9.5 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=EOQPdoae3PS5ck_aP1mpldzMKugHnzj-denjPqV1-gws=roWEsifMlJdcrB8QZHp1XshtiLitj46fru_pRIeVrrke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Correctly complete the original NBL with multiple NBs
No need to apologize Sorin. We will get everything addressed. Sorry if you felt like we pushed you. Thanks for the patch, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, June 12, 2015 5:27 AM To: Nithin Raju Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Correctly complete the original NBL with multiple NBs Nithin, The previous patch you are referring was one of a series I had pushed when working at the Multiple NBLs issue. At that time I had some trouble when generating packets large enough for the a NBL with multiple NBs to be generated. Because Eitan and Ankur, that also worked on this issue, pushed me to commit my changes so they can see how things were handled, I committed the patch series without thoroughly testing it. The current patch solves a bug I have found when managing to generate large enough packets. I hope this satisfies your curiosity. -Sorin -Original Message- From: Nithin Raju [mailto:nit...@vmware.com] Sent: Thursday, 11 June, 2015 18:56 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Correctly complete the original NBL with multiple NBs On Jun 11, 2015, at 5:52 AM, Sorin Vinturis svintu...@cloudbasesolutions.com wrote: OvsCreateNewNBLsFromMultipleNBs function failed to correctly complete the original NBL with multiple NBs after creating multiple NBLs with single NB. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Sorin, Thanks for the fix. I am curious how this was not caught during testing for the previous patch. Acked-by: Nithin Raju nit...@vmware.com thanks, -- Nithin ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=g0bgvrDEAVQy7ywNIgRZcfydL28BvzrFcBWVmwhkslos=uX0jWkHs1N9iNx-Oz9CvmAGFqpxNeBqYzDR7ZG5RLEQe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
[ovs-dev] [PATCH v3] datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation
This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Added support for multiple (per TCP port) STT ports Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu elia...@vmware.com Co-authored-by: Saurabh Shah ssaur...@vmware.com Signed-off-by: Saurabh Shah ssaur...@vmware.com --- INSTALL.Windows.md | 40 ++-- datapath-windows/automake.mk | 2 + datapath-windows/ovsext/Actions.c | 64 -- datapath-windows/ovsext/Debug.h| 1 + datapath-windows/ovsext/Stt.c | 369 + datapath-windows/ovsext/Stt.h | 89 datapath-windows/ovsext/Switch.h | 2 - datapath-windows/ovsext/Tunnel.c | 3 +- datapath-windows/ovsext/Util.h | 1 + datapath-windows/ovsext/Vport.c| 52 - datapath-windows/ovsext/Vport.h| 47 - datapath-windows/ovsext/Vxlan.c| 16 +- datapath-windows/ovsext/Vxlan.h| 9 +- datapath-windows/ovsext/ovsext.vcxproj | 4 +- 14 files changed, 634 insertions(+), 65 deletions(-) create mode 100644 datapath-windows/ovsext/Stt.c create mode 100644 datapath-windows/ovsext/Stt.h diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 0ec0af0..6ec9f29 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -386,29 +386,31 @@ Hyper-Vs. The following examples demonstrate how it can be done: % ovs-vsctl add-port br-int ovs-port-a tag=900 % ovs-vsctl add-port br-int ovs-port-b tag=900 -Steps to add VXLAN tunnels +Steps to add tunnels -- -The Windows Open vSwitch implementation support VXLAN tunnels. To add VXLAN +The Windows Open vSwitch implementation support VXLAN and STT tunnels. To add tunnels, the following steps serve as examples. Note that, any patch ports created between br-int and br-pif MUST be beleted -prior to adding VXLAN tunnels. - -01 Add the vxlan port between 172.168.201.101 - 172.168.201.102 -% ovs-vsctl add-port br-int vxlan-1 -% ovs-vsctl set Interface vxlan-1 type=vxlan -% ovs-vsctl set Interface vxlan-1 options:local_ip=172.168.201.101 -% ovs-vsctl set Interface vxlan-1 options:remote_ip=172.168.201.102 -% ovs-vsctl set Interface vxlan-1 options:in_key=flow -% ovs-vsctl set Interface vxlan-1 options:out_key=flow - -02 Add the vxlan port between 172.168.201.101 - 172.168.201.105 -% ovs-vsctl add-port br-int vxlan-2 -% ovs-vsctl set Interface vxlan-2 type=vxlan -% ovs-vsctl set Interface vxlan-2 options:local_ip=172.168.201.102 -% ovs-vsctl set Interface vxlan-2 options:remote_ip=172.168.201.105 -% ovs-vsctl set Interface vxlan-2 options:in_key=flow -% ovs-vsctl set Interface vxlan-2 options:out_key=flow +prior to adding tunnels. + +01 Add the tunnel port between 172.168.201.101 - 172.168.201.102 +% ovs-vsctl add-port br-int tun-1 +% ovs-vsctl set Interface tun-1 type=port-type +% ovs-vsctl set Interface tun-1 options:local_ip=172.168.201.101 +% ovs-vsctl set Interface tun-1 options:remote_ip=172.168.201.102 +% ovs-vsctl set Interface tun-1 options:in_key=flow +% ovs-vsctl set Interface tun-1 options:out_key=flow + +02 Add the tunnel port between 172.168.201.101 - 172.168.201.105 +% ovs-vsctl add-port br-int tun-2 +% ovs-vsctl set Interface tun-2 type=port-type +% ovs-vsctl set Interface tun-2 options:local_ip=172.168.201.102 +% ovs-vsctl set Interface tun-2 options:remote_ip=172.168.201.105 +% ovs-vsctl set Interface tun-2 options:in_key=flow +% ovs-vsctl set Interface tun-2 options:out_key=flow + + Where port-type is the string stt or vxlan Requirements diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk index 9324b3c..a4f5a57 100644 --- a/datapath-windows/automake.mk +++ b/datapath-windows/automake.mk @@ -56,6 +56,8 @@ EXTRA_DIST += \ datapath-windows/ovsext/Vport.c \ datapath-windows/ovsext/Vport.h \ datapath-windows/ovsext/Vxlan.c \ + datapath-windows/ovsext/Stt.h \ + datapath-windows/ovsext/Stt.c \ datapath-windows/ovsext/Vxlan.h \ datapath-windows/ovsext/ovsext.inf \ datapath-windows/ovsext/ovsext.rc \ diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index 79e464c..bfcf02e 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -23,6 +23,7 @@ #include NetProto.h #include Flow.h #include Vxlan.h +#include Stt.h #include Checksum.h #include PacketIO.h @@ -35,6 +36,8 @@ typedef struct _OVS_ACTION_STATS { UINT64 rxVxlan; UINT64 txVxlan; +UINT64 rxStt; +UINT64 txStt; UINT64 flowMiss; UINT64 flowUserspace; UINT64 txTcp; @@ -184,9 +187,6 @@ OvsInitForwardingCtx(OvsForwardingContext *ovsFwdCtx, } /* - * XXX
Re: [ovs-dev] [PATCH] datapath-windows: Correctly complete the original NBL with multiple NBs
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, June 11, 2015 5:53 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Correctly complete the original NBL with multiple NBs OvsCreateNewNBLsFromMultipleNBs function failed to correctly complete the original NBL with multiple NBs after creating multiple NBLs with single NB. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com --- datapath-windows/ovsext/PacketIO.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/datapath-windows/ovsext/PacketIO.c b/datapath-windows/ovsext/PacketIO.c index 7b2c0c8..d41335b 100644 --- a/datapath-windows/ovsext/PacketIO.c +++ b/datapath-windows/ovsext/PacketIO.c @@ -524,11 +524,12 @@ OvsCreateNewNBLsFromMultipleNBs(POVS_SWITCH_CONTEXT switchContext, } lastNbl-Next = *nextNbl; *nextNbl = newNbls-Next; -*curNbl = newNbls; -(*curNbl)-Next = NULL; OvsCompleteNBL(switchContext, *curNbl, TRUE); +*curNbl = newNbls; +(*curNbl)-Next = NULL; + error = FALSE; } while (error); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=BQIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SJYuCd-gcL6KClc0-g9-5X1vUkr8h1it_Ebv1yzOeAEs=QvI9jn40yGR5GqNe3Wqmw8gEFFIFtmu9Jl1Dti3gjewe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation
Yes, will do. Eitan -Original Message- From: Ben Pfaff [mailto:b...@nicira.com] Sent: Saturday, June 06, 2015 1:52 PM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v2] datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation On Wed, May 27, 2015 at 09:11:42AM -0700, Eitan Eliahu wrote: This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu elia...@vmware.com Co-authored-by: Saurabh Shah ssaur...@vmware.com Signed-off-by: Saurabh Shah ssaur...@vmware.com It's been a few days and I guess we have all the reviews we're going to initially get. I get a few patch rejects trying to apply this, and at least some of them seemed to require a little thinking to resolve, so will you rebase and post v3? Thanks, Ben. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 3/4] netlink: support for asynchronous NL transactions
Nithin, The driver is never blocked and it always executes in asynchronous fashion. A driver can immediately complete an I/O request by returning a status success code or an error. If the I/O is not completed the driver returns a pending status and the I/O will be completed later from a different thread context (this enables asynchronous/overlapped I/O for user mode process). Regardless of the driver specific I/O implementation, User mode thread can opt to wait on a I/O device request or not. If an overlapped structure is sent in the DeviceIoControl, the DeviceIOControl returns immediately regardless if the I/O has been completed or not. If a NULL sent rather than an overlapped structure, the thread which calls DeviceIOControl is blocked until the I/O is completed by the driver. With respect to WFP related I/O I don't think we need to return pending status from the driver. It should be fine to block the user mode thread during the WFP transaction processing. Thanks, Eitan -Original Message- From: Nithin Raju Sent: Wednesday, May 20, 2015 11:04 AM To: Eitan Eliahu; Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v2 3/4] netlink: support for asynchronous NL transactions Sorin/Eitan, Do we need this patch or not? Eitan tells me that if return status is STATUS_PENDING, then the context is blocked in the kernel. If that is true, we probably don’t need this patch since control won’t return to userspace at all, till the IRP is complete. This is especially true since we are passing NULL for the ‘lpOverlapped’ parameter to DeviceIoControl(). Pls. see the following documentation on MSDN: == https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216%28v=vs.85%29.aspx lpOverlapped [in, out, optional]: For overlapped operations, DeviceIoControl returns immediately, and the event object is signaled when the operation has been completed. Otherwise, the function does not return until the operation has been completed or an error occurs. == Based on this, my belief is that the call to DeviceIoControl() would block indefinitely until the IRP is completed. In your testing, did you think this patch was necessary? thanks, -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] ARP lookup and next hop functionality on windows (updated version)
Acked-by: Eitan Eliahu elia...@vmware.com Thanks. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, May 19, 2015 10:02 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] ARP lookup and next hop functionality on windows This patch implements two functionalities needed for an active manager: 1. ARP lookup 2. Next hop The first functionality relies on the internal Windows API: https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_windows_desktop_aa365956-2528v-3Dvs.85-2529.aspxd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=tQfMAkM2SjeoDNgJA5lzr3VUDfYRDmjOR3QrymbowLcs=AjthuTJGRGkQqO4iaxxvp5uVrWnSngSiynyZFrmI4fMe= The second one: https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_windows_desktop_aa365915-2528v-3Dvs.85-2529.aspxd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=tQfMAkM2SjeoDNgJA5lzr3VUDfYRDmjOR3QrymbowLcs=cYblpE7EGRgk2wDKdIc9MFjjG9U-91iBWzp2rstlaH4e= Both API's are found in the Iphlpapi library. We need to add this library when compiling. Documentation and appveyor config has been updated to match the use of the new library. Tested using opendaylight. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_63d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=OzBp2rjLgq1hrRQaHib0MxIu5M4HlH1EvhmW2aCEJ0Qs=fZsrIJis7ZxmwWfZLrnf1UhsdtE02hnUYMyLpIHcNEMe= --- v2: call GetIpNetTable and GetAdaptersAddresses with a zero length buffer. add pretty printing --- --- INSTALL.Windows.md | 25 +-- lib/netdev-windows.c | 114 +++ 2 files changed, 127 insertions(+), 12 deletions(-) diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 78af0a1..0ec0af0 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -62,9 +62,10 @@ or from a distribution tar ball. the right compiler, linker, libraries, Open vSwitch component installation directories, etc. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ - --prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ - --sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread +% ./configure CC=./build-aux/cccl LD=`which link` \ + LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ + --localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ + --with-pthread=C:/pthread By default, the above enables compiler optimization for fast code. For default compiler optimization, pass the --with-debug configure @@ -114,10 +115,10 @@ Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32). * While configuring the package, specify the OpenSSL directory path. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ ---prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ ---sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread \ ---enable-ssl --with-openssl=C:/OpenSSL-Win32 +% ./configure CC=./build-aux/cccl LD=`which link` \ +LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ +--localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ +--with-pthread=C:/pthread --enable-ssl --with-openssl=C:/OpenSSL-Win32 * Run make for the ported executables. @@ -131,11 +132,11 @@ level 'make' will invoke building the kernel datapath, if the '--with-vstudioddk' argument is specified while configuring the package. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ ---prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ ---sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread \ ---enable-ssl --with-openssl=C:/OpenSSL-Win32 \ ---with-vstudioddk=WDK to use +% ./configure CC=./build-aux/cccl LD=`which link` \ +LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ +--localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ +--with-pthread=C:/pthread --enable-ssl \ +--with-openssl=C:/OpenSSL-Win32 --with-vstudioddk=WDK to use Possible values for WDK to use are: Win8.1 Debug, Win8.1 Release, Win8 Debug and Win8 Release. diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c index 1fc1da7..1eb8727 100644 --- a/lib/netdev-windows.c +++ b/lib/netdev-windows.c @@ -17,6 +17,7 @@ #include stdlib.h #include config.h #include errno.h +#include iphlpapi.h #include net/if.h @@ -373,6 +374,117 @@ netdev_windows_update_flags(struct netdev *netdev_, return 0; } +/* Looks up in the ARP table entry for a given 'ip'. If it is found
Re: [ovs-dev] [PATCH] ARP lookup and next hop functionality on windows
Hi Alin, It looks good besides some minor comments. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, May 04, 2015 8:35 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] ARP lookup and next hop functionality on windows This patch implements two functionalities needed for an active manager: 1. ARP lookup 2. Next hop The first functionality relies on the internal Windows API: https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_windows_desktop_aa365956-2528v-3Dvs.85-2529.aspxd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=tQfMAkM2SjeoDNgJA5lzr3VUDfYRDmjOR3QrymbowLcs=AjthuTJGRGkQqO4iaxxvp5uVrWnSngSiynyZFrmI4fMe= The second one: https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_windows_desktop_aa365915-2528v-3Dvs.85-2529.aspxd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=tQfMAkM2SjeoDNgJA5lzr3VUDfYRDmjOR3QrymbowLcs=cYblpE7EGRgk2wDKdIc9MFjjG9U-91iBWzp2rstlaH4e= Both API's are found in the Iphlpapi library. We need to add this library when compiling. Documentation and appveyor config has been updated to match the use of the new library. Tested using opendaylight. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_63d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=tQfMAkM2SjeoDNgJA5lzr3VUDfYRDmjOR3QrymbowLcs=L3JZ3eRbqh48NNmq_mcC2elPy7pBrI0pLWhhDEnepuke= --- INSTALL.Windows.md | 25 ++- appveyor.yml | 2 +- lib/netdev-windows.c | 125 +++ 3 files changed, 139 insertions(+), 13 deletions(-) diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 78af0a1..0ec0af0 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -62,9 +62,10 @@ or from a distribution tar ball. the right compiler, linker, libraries, Open vSwitch component installation directories, etc. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ - --prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ - --sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread +% ./configure CC=./build-aux/cccl LD=`which link` \ + LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ + --localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ + --with-pthread=C:/pthread By default, the above enables compiler optimization for fast code. For default compiler optimization, pass the --with-debug configure @@ -114,10 +115,10 @@ Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32). * While configuring the package, specify the OpenSSL directory path. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ ---prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ ---sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread \ ---enable-ssl --with-openssl=C:/OpenSSL-Win32 +% ./configure CC=./build-aux/cccl LD=`which link` \ +LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ +--localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ +--with-pthread=C:/pthread --enable-ssl --with-openssl=C:/OpenSSL-Win32 * Run make for the ported executables. @@ -131,11 +132,11 @@ level 'make' will invoke building the kernel datapath, if the '--with-vstudioddk' argument is specified while configuring the package. For example, -% ./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ ---prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ ---sysconfdir=C:/openvswitch/etc --with-pthread=C:/pthread \ ---enable-ssl --with-openssl=C:/OpenSSL-Win32 \ ---with-vstudioddk=WDK to use +% ./configure CC=./build-aux/cccl LD=`which link` \ +LIBS=-lws2_32 -liphlpapi --prefix=C:/openvswitch/usr \ +--localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc \ +--with-pthread=C:/pthread --enable-ssl \ +--with-openssl=C:/OpenSSL-Win32 --with-vstudioddk=WDK to use Possible values for WDK to use are: Win8.1 Debug, Win8.1 Release, Win8 Debug and Win8 Release. diff --git a/appveyor.yml b/appveyor.yml index a14f0fc..863b561 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,5 +39,5 @@ build_script: - C:\MinGW\msys\1.0\bin\bash -lc cp /c/pthreads-win32/Pre-built.2/dll/x86/*.dll /c/openvswitch/. - C:\MinGW\msys\1.0\bin\bash -lc mv /bin/link.exe /bin/link_copy.exe - C:\MinGW\msys\1.0\bin\bash -lc cd /c/openvswitch ./boot.sh -- C:\MinGW\msys\1.0\bin\bash -lc cd /c/openvswitch ./configure CC=build-aux/cccl LD=\`which link`\ LIBS=-lws2_32
Re: [ovs-dev] [PATCH] datapath-windows: Fix warning from the powershell module
Acked-by: Eitan Eliahu elia...@vmware.com Thanks Alin. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Monday, May 04, 2015 9:45 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Fix warning from the powershell module This patch fixes the warning when datapath-windows/misc/OVS.psm1 is imported. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-by: Hemanth Kumar Mantri man...@nutanix.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_69d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=28OaspoKKvRf7sMd_OuP7WGNu0Y8Gm_uyKtsixeU1gAs=bOxLzQumIA-Cglwy6ZOdkBhODOusq4Q40MFG982V3Loe= --- datapath-windows/misc/OVS.psm1 | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datapath-windows/misc/OVS.psm1 b/datapath-windows/misc/OVS.psm1 index d6b6b00..a8ffcae 100644 --- a/datapath-windows/misc/OVS.psm1 +++ b/datapath-windows/misc/OVS.psm1 @@ -1,5 +1,5 @@ # -Copyright 2014 Cloudbase Solutions Srl +Copyright 2014, 2015 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. @@ -57,7 +57,7 @@ function Set-VMNetworkAdapterOVSPort $retVal = $vsms.ModifyResourceSettings(@($sd.GetText(1))) try { -Check-WMIReturnValue $retVal +CheckWMIReturnValue $retVal } catch { @@ -142,7 +142,7 @@ function Get-VMNetworkAdapterWithOVSPort } } -function Check-WMIReturnValue($retVal) +function CheckWMIReturnValue($retVal) { if ($retVal.ReturnValue -ne 0) { @@ -206,3 +206,5 @@ function Set-VMNetworkAdapterOVSPortDirect $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName $OVSPortName } } + +Export-ModuleMember -function Set-*, Get-* -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=28OaspoKKvRf7sMd_OuP7WGNu0Y8Gm_uyKtsixeU1gAs=TUgRV-w8Mpu1iAnHHa09XxMdrFF24pcdea9Mde0Gnw8e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v4 2/4] Sample to automate build installer
Hi Alin, I'm wondering if you addressed the issue of installation on Windows Server 2012. Unless we install the 8.0 driver, the driver load would fail. Thanks, Eitan Begin forwarded message: From: Alin Serdean aserd...@cloudbasesolutions.com To: dev@openvswitch.org dev@openvswitch.org Date: April 28, 2015 at 3:36:28 PM PDT Subject: [ovs-dev] [PATCH v4 2/4] Sample to automate build installer This commit is a POC on how to build the installer from the command line. One could issue the following commands to build the binaries, driver and installer. ./boot.sh;./configure CC=./build-aux/cccl LD=`which link` LIBS=-lws2_32 \ --prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ --sysconfdir=C:/openvswitch/etc \ --with-pthread=C:/pthread/ --with-vstudioddk=Win8.1Release; \ make clean make make installer Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Co-authored-by: Nithin Raju nit...@vmware.com --- v3: Fix pthread libraries v2: Respin Makefile.am | 20 ++ datapath-windows/ovsext.sln | 50 ++--- m4/openvswitch.m4 | 8 3 files changed, 49 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8bc431b..9a2ffd6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -354,6 +354,25 @@ if LINUX_ENABLED cd datapath/linux $(MAKE) modules_install endif +if WIN32 +PTHREAD_TEMP_DIR=`echo $(PTHREAD_LDFLAGS) | sed +'s|^.\(.*\).$:\1||'` +installer: $(BUILT_SOURCES) $(ovsext_make) + cp -f $(top_srcdir)/datapath-windows/misc/OVS.psm1 windows/ovs-windows-installer/Services/OVS.psm1 + cp -f $(top_srcdir)/vswitchd/vswitch.ovsschema windows/ovs-windows-installer/Services/vswitch.ovsschema + cp -f $(top_srcdir)/vswitchd/ovs-vswitchd.exe windows/ovs-windows-installer/Services/ovs-vswitchd.exe + cp -f $(top_srcdir)/ovsdb/ovsdb-server.exe windows/ovs-windows-installer/Services/ovsdb-server.exe + cp -f $(top_srcdir)/datapath-windows/x64/$(VSTUDIO_CONFIG)/package/ovsext.cat windows/ovs-windows-installer/Driver/ovsext.cat + cp -f $(top_srcdir)/datapath-windows/x64/$(VSTUDIO_CONFIG)/package/ovsext.inf windows/ovs-windows-installer/Driver/ovsext.inf + cp -f $(top_srcdir)/datapath-windows/x64/$(VSTUDIO_CONFIG)/package/OVSExt.sys windows/ovs-windows-installer/Driver/OVSExt.sys + cp -f $(top_srcdir)/utilities/*.exe windows/ovs-windows-installer/Binaries/ + cp -f $(top_srcdir)/utilities/*.pdb windows/ovs-windows-installer/Symbols/ + cp -f $(top_srcdir)/ovsdb/ovsdb-client.exe windows/ovs-windows-installer/Binaries/ovsdb-client.exe + cp -f $(top_srcdir)/ovsdb/ovsdb-tool.exe windows/ovs-windows-installer/Binaries/ovsdb-tool.exe + cp -f $(top_srcdir)/ovsdb/*.pdb windows/ovs-windows-installer/Symbols/ + cp -f $(PTHREAD_TEMP_DIR)/../../dll/x86/*.dll windows/ovs-windows-installer/Binaries/ + cp -f /c/Program Files (x86)/Common Files/Merge Modules/Microsoft_VC120_CRT_x86.msm windows/ovs-windows-installer/Redist/Microsoft_VC120_CRT_x86.msm + MSBuild.exe windows/ovs-windows-installer.sln /target:Build /property:Configuration=Release +endif dist-docs: VERSION=$(VERSION) $(srcdir)/build-aux/dist-docs $(srcdir) $(docs) .PHONY: dist-docs @@ -377,3 +396,4 @@ include tutorial/automake.mk include vtep/automake.mk include datapath-windows/automake.mk include datapath-windows/include/automake.mk +include windows/automake.mk diff --git a/datapath-windows/ovsext.sln b/datapath-windows/ovsext.sln index 9cb767d..60e9318 100644 --- a/datapath-windows/ovsext.sln +++ b/datapath-windows/ovsext.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project({2150E333-8FDC-42A3-9474-1A3956D46DE8}) = Package, Package, {6BA8554E-AE50-49B0-9C98-4592447FEF8D} EndProject @@ -12,32 +12,32 @@ Project({8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}) = ovsext, ovsext\ovsext.vcx EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Win8 Debug|x64 = Win8 Debug|x64 - Win8 Release|x64 = Win8 Release|x64 - Win8.1 Debug|x64 = Win8.1 Debug|x64 - Win8.1 Release|x64 = Win8.1 Release|x64 + Win8.1Debug|x64 = Win8.1Debug|x64 + Win8.1Release|x64 = Win8.1Release|x64 + Win8Debug|x64 = Win8Debug|x64 + Win8Release|x64 = Win8Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {911D7389-3E61-449F-B8F3-14AD7EE9A0F2}.Win8
[ovs-dev] [PATCH] datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation
This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu elia...@vmware.com Co-authored-by: Saurabh Shah ssaur...@vmware.com --- datapath-windows/automake.mk | 2 + datapath-windows/ovsext/Actions.c | 13 ++ datapath-windows/ovsext/Debug.h| 1 + datapath-windows/ovsext/Stt.c | 363 + datapath-windows/ovsext/Stt.h | 87 datapath-windows/ovsext/Switch.h | 3 +- datapath-windows/ovsext/Tunnel.c | 3 +- datapath-windows/ovsext/Util.h | 1 + datapath-windows/ovsext/Vport.c| 18 ++ datapath-windows/ovsext/Vport.h| 22 ++ datapath-windows/ovsext/Vxlan.c| 4 +- datapath-windows/ovsext/ovsext.vcxproj | 4 +- 12 files changed, 515 insertions(+), 6 deletions(-) create mode 100644 datapath-windows/ovsext/Stt.c create mode 100644 datapath-windows/ovsext/Stt.h diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk index 9324b3c..a4f5a57 100644 --- a/datapath-windows/automake.mk +++ b/datapath-windows/automake.mk @@ -56,6 +56,8 @@ EXTRA_DIST += \ datapath-windows/ovsext/Vport.c \ datapath-windows/ovsext/Vport.h \ datapath-windows/ovsext/Vxlan.c \ + datapath-windows/ovsext/Stt.h \ + datapath-windows/ovsext/Stt.c \ datapath-windows/ovsext/Vxlan.h \ datapath-windows/ovsext/ovsext.inf \ datapath-windows/ovsext/ovsext.rc \ diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index a93fe03..39f36b4 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -23,6 +23,7 @@ #include NetProto.h #include Flow.h #include Vxlan.h +#include Stt.h #include Checksum.h #include PacketIO.h @@ -207,6 +208,10 @@ OvsDetectTunnelRxPkt(OvsForwardingContext *ovsFwdCtx, flowKey-ipKey.l4.tpDst == VXLAN_UDP_PORT_NBO) { tunnelVport = ovsFwdCtx-switchContext-vxlanVport; ovsActionStats.rxVxlan++; +} else if (!flowKey-ipKey.nwFrag +flowKey-ipKey.nwProto == IPPROTO_TCP +flowKey-ipKey.l4.tpDst == STT_DST_PORT_NBO) { +tunnelVport =ovsFwdCtx-switchContext-sttVport; } // We might get tunnel packets even before the tunnel gets initialized. @@ -632,6 +637,10 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx) ovsFwdCtx-switchContext, (VOID *)ovsFwdCtx-completionList, ovsFwdCtx-layers, newNbl); +break; +case OVS_VPORT_TYPE_STT: +status = OvsEncapStt(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, + ovsFwdCtx-tunKey, ovsFwdCtx-layers, newNbl); break; default: ASSERT(! Tx: Unhandled tunnel type); @@ -697,6 +706,10 @@ OvsTunnelPortRx(OvsForwardingContext *ovsFwdCtx) status = OvsDoDecapVxlan(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, ovsFwdCtx-tunKey, newNbl); break; +case OVS_VPORT_TYPE_STT: +status = OvsDecapStt(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, + ovsFwdCtx-tunKey, newNbl); +break; default: OVS_LOG_ERROR(Rx: Unhandled tunnel type: %d\n, tunnelRxVport-ovsType); diff --git a/datapath-windows/ovsext/Debug.h b/datapath-windows/ovsext/Debug.h index a0da5eb..4b7b526 100644 --- a/datapath-windows/ovsext/Debug.h +++ b/datapath-windows/ovsext/Debug.h @@ -40,6 +40,7 @@ #define OVS_DBG_OTHERS BIT32(21) #define OVS_DBG_NETLINK BIT32(22) #define OVS_DBG_TUNFLT BIT32(23) +#define OVS_DBG_STT BIT32(24) #define OVS_DBG_RESERVED BIT32(31) //Please add above OVS_DBG_RESERVED. diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c new file mode 100644 index 000..a1dae21 --- /dev/null +++ b/datapath-windows/ovsext/Stt.c @@ -0,0 +1,363 @@ +/* + * Copyright (c) 2015 VMware, Inc. + * + * 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. + */ + +#include precomp.h +#include NetProto.h +#include Switch.h +#include Vport.h +#include Flow.h +#include stt.h +#include IpHelper.h +#include Checksum.h +#include User.h +#include PacketIO.h +#include
[ovs-dev] [PATCH] datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation
This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu elia...@vmware.com Co-authored-by: Saurabh Shah ssaur...@vmware.com Signed-off-by: Saurabh Shah ssaur...@vmware.com --- datapath-windows/automake.mk | 2 + datapath-windows/ovsext/Actions.c | 13 ++ datapath-windows/ovsext/Debug.h| 1 + datapath-windows/ovsext/Stt.c | 363 + datapath-windows/ovsext/Stt.h | 87 datapath-windows/ovsext/Switch.h | 3 +- datapath-windows/ovsext/Tunnel.c | 3 +- datapath-windows/ovsext/Util.h | 1 + datapath-windows/ovsext/Vport.c| 18 ++ datapath-windows/ovsext/Vport.h| 22 ++ datapath-windows/ovsext/Vxlan.c| 4 +- datapath-windows/ovsext/ovsext.vcxproj | 4 +- 12 files changed, 515 insertions(+), 6 deletions(-) create mode 100644 datapath-windows/ovsext/Stt.c create mode 100644 datapath-windows/ovsext/Stt.h diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk index 9324b3c..a4f5a57 100644 --- a/datapath-windows/automake.mk +++ b/datapath-windows/automake.mk @@ -56,6 +56,8 @@ EXTRA_DIST += \ datapath-windows/ovsext/Vport.c \ datapath-windows/ovsext/Vport.h \ datapath-windows/ovsext/Vxlan.c \ + datapath-windows/ovsext/Stt.h \ + datapath-windows/ovsext/Stt.c \ datapath-windows/ovsext/Vxlan.h \ datapath-windows/ovsext/ovsext.inf \ datapath-windows/ovsext/ovsext.rc \ diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index a93fe03..39f36b4 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -23,6 +23,7 @@ #include NetProto.h #include Flow.h #include Vxlan.h +#include Stt.h #include Checksum.h #include PacketIO.h @@ -207,6 +208,10 @@ OvsDetectTunnelRxPkt(OvsForwardingContext *ovsFwdCtx, flowKey-ipKey.l4.tpDst == VXLAN_UDP_PORT_NBO) { tunnelVport = ovsFwdCtx-switchContext-vxlanVport; ovsActionStats.rxVxlan++; +} else if (!flowKey-ipKey.nwFrag +flowKey-ipKey.nwProto == IPPROTO_TCP +flowKey-ipKey.l4.tpDst == STT_DST_PORT_NBO) { +tunnelVport =ovsFwdCtx-switchContext-sttVport; } // We might get tunnel packets even before the tunnel gets initialized. @@ -632,6 +637,10 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx) ovsFwdCtx-switchContext, (VOID *)ovsFwdCtx-completionList, ovsFwdCtx-layers, newNbl); +break; +case OVS_VPORT_TYPE_STT: +status = OvsEncapStt(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, + ovsFwdCtx-tunKey, ovsFwdCtx-layers, newNbl); break; default: ASSERT(! Tx: Unhandled tunnel type); @@ -697,6 +706,10 @@ OvsTunnelPortRx(OvsForwardingContext *ovsFwdCtx) status = OvsDoDecapVxlan(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, ovsFwdCtx-tunKey, newNbl); break; +case OVS_VPORT_TYPE_STT: +status = OvsDecapStt(ovsFwdCtx-switchContext, ovsFwdCtx-curNbl, + ovsFwdCtx-tunKey, newNbl); +break; default: OVS_LOG_ERROR(Rx: Unhandled tunnel type: %d\n, tunnelRxVport-ovsType); diff --git a/datapath-windows/ovsext/Debug.h b/datapath-windows/ovsext/Debug.h index a0da5eb..4b7b526 100644 --- a/datapath-windows/ovsext/Debug.h +++ b/datapath-windows/ovsext/Debug.h @@ -40,6 +40,7 @@ #define OVS_DBG_OTHERS BIT32(21) #define OVS_DBG_NETLINK BIT32(22) #define OVS_DBG_TUNFLT BIT32(23) +#define OVS_DBG_STT BIT32(24) #define OVS_DBG_RESERVED BIT32(31) //Please add above OVS_DBG_RESERVED. diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c new file mode 100644 index 000..a1dae21 --- /dev/null +++ b/datapath-windows/ovsext/Stt.c @@ -0,0 +1,363 @@ +/* + * Copyright (c) 2015 VMware, Inc. + * + * 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. + */ + +#include precomp.h +#include NetProto.h +#include Switch.h +#include Vport.h +#include Flow.h +#include stt.h +#include IpHelper.h +#include Checksum.h
Re: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like
Hi Nithin, Sorry, I come late on this one, change looks good. We need to check if the IRP output buffer is big enough to fit the transaction message before copying it. Otherwise, we need to return error and break the NetLink connection. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Tuesday, April 28, 2015 2:36 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like In this patch, we make changes to usersapce as well as kernel datapath on hyperv to make it more netlink socket like. Previously, the kernel datapath did not distinguish between transport errors and other errors. Netlink semantics dictate that netlink functions should only return an error only in the case of a transport error which is generally something fatal. Eg. failure to communicate with the OVS module, or an invalid command altogether. Other errors such as an unsupported action, or an invalid flow key is not considered a transport error, and in such cases, netlink functions are to return success with a 'struct nlmsgerr' populated in the output buffer. This patch implements these semantics. Signed-off-by: Nithin Raju nit...@vmware.com Acked-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_72d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=gnFVocxivsB-5iJX4WfGUf-eI54hnHjhLPFrIhaeSqUs=4gTRd-4F3b_yYXbvXPMWy1sqnpt68ZC-3iT_GkKoVqce= --- v2: addressed Sorin's comments v3: rebase to HEAD datapath-windows/ovsext/Datapath.c | 61 +++--- datapath-windows/ovsext/Datapath.h | 2 - lib/netlink-socket.c | 102 ++--- 3 files changed, 114 insertions(+), 51 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 1dead33..7646f0a 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -78,10 +78,11 @@ typedef struct _NETLINK_CMD { /* A netlink family is a group of commands. */ typedef struct _NETLINK_FAMILY { CHAR *name; -UINT32 id; +UINT16 id; UINT8 version; -UINT8 pad; +UINT8 pad1; UINT16 maxAttr; +UINT16 pad2; NETLINK_CMD *cmds; /* Array of netlink commands and handlers. */ UINT16 opsCount; } NETLINK_FAMILY, *PNETLINK_FAMILY; @@ -143,12 +144,12 @@ NETLINK_CMD nlControlFamilyCmdOps[] = { }, { .cmd = OVS_CTRL_CMD_EVENT_NOTIFY, .handler = OvsReadEventCmdHandler, - .supportedDevOp = OVS_READ_EVENT_DEV_OP, + .supportedDevOp = OVS_READ_DEV_OP, .validateDpIndex = FALSE, }, { .cmd = OVS_CTRL_CMD_READ_NOTIFY, .handler = OvsReadPacketCmdHandler, - .supportedDevOp = OVS_READ_PACKET_DEV_OP, + .supportedDevOp = OVS_READ_DEV_OP, .validateDpIndex = FALSE, } }; @@ -799,12 +800,17 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, inputBufferLen = 0; ovsMsg = ovsMsgReadOp; -ovsMsg-nlMsg.nlmsgType = OVS_WIN_NL_CTRL_FAMILY_ID; +RtlZeroMemory(ovsMsg, sizeof *ovsMsg); +ovsMsg-nlMsg.nlmsgLen = sizeof *ovsMsg; +ovsMsg-nlMsg.nlmsgType = nlControlFamilyOps.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 : OVS_CTRL_CMD_READ_NOTIFY; +ovsMsg-genlMsg.version = nlControlFamilyOps.version; + devOp = OVS_READ_DEV_OP; break; @@ -895,8 +901,8 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, } /* - * For read operation, the netlink command has already been validated - * previously. + * For read operation, avoid duplicate validation since 'ovsMsg' is either + * artificial or was copied from a previously validated 'ovsMsg'. */ if (devOp != OVS_READ_DEV_OP) { status = ValidateNetlinkCmd(devOp, instance, ovsMsg, nlFamilyOps); @@ -982,7 +988,9 @@ done: /* * -- - * Function to invoke the netlink command handler. + * Function to invoke the netlink command handler. The function also + stores + * the return value of the handler function to construct a 'NL_ERROR' + message, + * and in turn returns success to the caller. * -- */ static NTSTATUS @@ -1004,6 +1012,43 @@ InvokeNetlinkCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, } } +/* + * Netlink socket semantics dictate that the return value of the netlink + * function should be an error ONLY under fatal conditions. If the
Re: [ovs-dev] [PATCH v2 1/3] Windows installer
6.40 filter will fail to register itself on Windows Server 2012 and will get unloaded. Eitan -Original Message- From: Nithin Raju Sent: Wednesday, April 29, 2015 3:12 PM To: Eitan Eliahu Cc: Alin Serdean; Gurucharan Shetty; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v2 1/3] Windows installer On Apr 29, 2015, at 3:04 PM, Eitan Eliahu elia...@vmware.com wrote: Actually, both version should be available for the installer. It should query the OS type and install the appropriate driver. But, unless there is a good reason for registering as 6.40 we could register as 6.30 with the 8.1 driver. This way we can get reed of the 8.0 driver and the installer has a single driver to install for Server and Server R2. There are some calls to functions that are available only in 6.40. How does it work if such a driver gets installed on Windows 2012 (not r2)? -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like
Besides that LG. Thanks, Eitan -Original Message- From: Nithin Raju Sent: Wednesday, April 29, 2015 7:38 AM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like Thanks for the review. On Apr 29, 2015, at 6:06 AM, Eitan Eliahu elia...@vmware.com wrote: Hi Nithin, Sorry, I come late on this one, change looks good. We need to check if the IRP output buffer is big enough to fit the transaction message before copying it. Otherwise, we need to return error and break the NetLink connection. That’s a good point. There are some checks before hand when we validate the ioctl command, where we check for a “minimum size” for the output buffer. The parameter #3 to MapIrpOutputBuffer() is a “required length”. Pls. let me know if I need to add more checks. --- case OVS_IOCTL_READ_EVENT: case OVS_IOCTL_READ_PACKET: /* * Output buffer is mandatory. These IOCTLs are used to read events and * packets respectively. It is convenient to have separate ioctls. */ if (outputBufferLen != 0) { status = MapIrpOutputBuffer(irp, outputBufferLen, sizeof *ovsMsg, outputBuffer); --- thanks, -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like
We will fix the transaction error message copy in the kernel in a separate change. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Wednesday, April 29, 2015 7:45 AM To: Nithin Raju Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v3] ovs-hyperv: make kernel return values netlink socket like On Tue, Apr 28, 2015 at 02:35:37PM -0700, Nithin Raju wrote: In this patch, we make changes to usersapce as well as kernel datapath on hyperv to make it more netlink socket like. Previously, the kernel datapath did not distinguish between transport errors and other errors. Netlink semantics dictate that netlink functions should only return an error only in the case of a transport error which is generally something fatal. Eg. failure to communicate with the OVS module, or an invalid command altogether. Other errors such as an unsupported action, or an invalid flow key is not considered a transport error, and in such cases, netlink functions are to return success with a 'struct nlmsgerr' populated in the output buffer. This patch implements these semantics. Signed-off-by: Nithin Raju nit...@vmware.com Acked-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvs witch_ovs-2Dissues_issues_72d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw- YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Ea0P825C d9r9LO_WuiBF5qIYzvUpud9ODF9pApcXxhIs=VSYDudaje5XFAmpzjcYHIgg3wPtfoM3V b_Je1q23iske= --- v2: addressed Sorin's comments v3: rebase to HEAD I applied this, thanks! This assert in nl_sock_transact_multiple__() will fire (killing the process) whenever the if condition is entered. Is it really desirable? if (request_nlmsg-nlmsg_seq != reply_nlmsg-nlmsg_seq) { ovs_assert(request_nlmsg-nlmsg_seq == reply_nlmsg-nlmsg_seq); VLOG_DBG_RL(rl, mismatched seq request %#PRIx32 , reply %#PRIx32, request_nlmsg-nlmsg_seq, reply_nlmsg-nlmsg_seq); break; } ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Ea0P825Cd9r9LO_WuiBF5qIYzvUpud9ODF9pApcXxhIs=c85g8L1ozRygk-9THMEsnsmjkIdb8oeeVbqaPzgvLOge= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned
As I understand the semantics, we need to return an error and bail out only when there a system level error which equivalent to a transport error or disconnection in a standard IPC. All transaction based errors should return a success by the I/O control and an NL error message should be built in the reply buffer. Incrementing the *done variable would be closer to what we want to achieve but until we aligned the driver with this policy this change would not be complete. For now, we just want to prevent the state where we enter an infinite loop. Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, April 15, 2015 9:10 PM To: Nithin Raju; Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned Returning error on driver request failure would exit the while loop no matter if the done counter is incremented or not. So either we return error and exit immediately the while loop, or increment the done counter and continue to discuss to an unresponsive driver until the transactions are consumed. -Original Message- From: Nithin Raju [mailto:nit...@vmware.com] Sent: Thursday, 16 April, 2015 00:22 To: Eitan Eliahu Cc: Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned On Apr 15, 2015, at 1:49 PM, Eitan Eliahu elia...@vmware.com wrote: If we remove the increment of the transaction than the whole sequence of transaction will be lost. This is not true. We increment ‘*done’ after each successful transaction: 48 /* Count the number of successful transactions. */ 49 (*done)++; This should be done only after we change the driver to never fail in case the transaction fail. The current driver fails also when there are transaction level erros and when there are some other temporary errors. I would prefer to move to the next transaction in that case rather than dump the whole sequence. Yes, the driver needs to be updated to return STATUS_SUCCESS in most cases, unless there are issues with the genetlink header itself. If there’s such an error value returned by the kernel, instead of checking 'error = EINVAL’, we should check for GetLastError(). Otherwise, nl_sock_transact_multiple__() should behave as though no error occurred. -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned
Nithin, the only issue I have with that is that currently the driver returns an I/O error in some cases where the I/O succeeds but the transaction fails (e.g. when OVS sends down a port delete NL message and there is no such a port). In this case, the current user mode will dump all the other transactions in the same batch. Thanks you for working on the driver side. I thought I will start to work on it but please go ahead. Eitan -Original Message- From: Nithin Raju Sent: Thursday, April 16, 2015 9:06 AM To: Eitan Eliahu Cc: Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned Eitan/Sorin, This is the code on Linux: /* Receive a reply. */ error = nl_sock_recv__(sock, buf_txn-reply, false); if (error) { if (error == EAGAIN) { nl_sock_record_errors__(transactions, n, 0); *done += n; error = 0; } break; } I am reading this as “If there’s an error, break out of the loop since the current transaction failed, and it is highly unlikely that future transactions in this batch will succeed”. At this point, we are not counting the current transaction that failed (with error other than EAGAIN), and hence we are not incrementing ‘*done’. I am advocating for the same logic to be followed on Windows also, in addition to breaking out of the loop. There’s special handling for EAGIN which implies that there’s no reply queued up in the socket in the kernel. It is not an error as such. So, record EAGAIN in the transactions, and return as though the transaction completed and let the caller handle EAGAIN. If you are particular that we should increment ‘*done’ on error, I am fine with it. I am working on the patch to make the kernel changes to return success during regular errors too. We’ll revisit this at that point if need be, since we’ll have the concrete kernel patch and come up with whatever is good end-to-end. Sorin’s patch is good to go in, IMO. thanks, -- Nithin On Apr 16, 2015, at 7:06 AM, Eitan Eliahu elia...@vmware.com wrote: As I understand the semantics, we need to return an error and bail out only when there a system level error which equivalent to a transport error or disconnection in a standard IPC. All transaction based errors should return a success by the I/O control and an NL error message should be built in the reply buffer. Incrementing the *done variable would be closer to what we want to achieve but until we aligned the driver with this policy this change would not be complete. For now, we just want to prevent the state where we enter an infinite loop. Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, April 15, 2015 9:10 PM To: Nithin Raju; Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned Returning error on driver request failure would exit the while loop no matter if the done counter is incremented or not. So either we return error and exit immediately the while loop, or increment the done counter and continue to discuss to an unresponsive driver until the transactions are consumed. -Original Message- From: Nithin Raju [mailto:nit...@vmware.com] Sent: Thursday, 16 April, 2015 00:22 To: Eitan Eliahu Cc: Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned On Apr 15, 2015, at 1:49 PM, Eitan Eliahu elia...@vmware.com wrote: If we remove the increment of the transaction than the whole sequence of transaction will be lost. This is not true. We increment ‘*done’ after each successful transaction: 48 /* Count the number of successful transactions. */ 49 (*done)++; This should be done only after we change the driver to never fail in case the transaction fail. The current driver fails also when there are transaction level erros and when there are some other temporary errors. I would prefer to move to the next transaction in that case rather than dump the whole sequence. Yes, the driver needs to be updated to return STATUS_SUCCESS in most cases, unless there are issues with the genetlink header itself. If there’s such an error value returned by the kernel, instead of checking 'error = EINVAL’, we should check for GetLastError(). Otherwise, nl_sock_transact_multiple__() should behave as though
Re: [ovs-dev] [PATCH] INSTALL.Windows: external.1 should be part of 'br-pif'
Acked-by: Eitan Eliahu elia...@vmware.com Thanks Nithin for the prompt fix. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Thursday, April 16, 2015 9:23 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] INSTALL.Windows: external.1 should be part of 'br-pif' Fixing a minor typo introduced in a previous commit. Signed-off-by: Nithin Raju nit...@vmware.com --- INSTALL.Windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 0dd5cda..78af0a1 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -299,9 +299,9 @@ as a special name to refer to that adapter. Port br-pif Interface br-pif type: internal -Bridge br-int Port external.1 Interface external.1 +Bridge br-int Port br-int Interface br-int type: internal -- 1.9.4.msysgit.2 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=PiO3Ll20LEqf8kGr70PDSOcDz5aHQBaPhNgxOXZbj6Is=r4uLERoAQXfDhHJTTEoNXcLZ7qVyr8g551-391kHePQe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] netlink-socket: Exit NL transaction loop when EINVAL is returned
Acked-by: Eitan Eliahu elia...@vmware.com Thanks Sorin, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, April 15, 2015 2:31 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] netlink-socket: Exit NL transaction loop when EINVAL is returned The nl_sock_transact_multiple function enters in an infinite loop, when invalid error, EINVAL, is returned by nl_sock_transact_multiple__. EINVAL is the error returned by the latter function when a driver request fails. v2: Any error returned by nl_sock_transact_multiple__, except EAGAIN, causes the rest of NL transactions to be aborted. An error response from the driver is considered a successful transaction and the 'done' transactions counter is incremented. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_57d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=1N6hdMturzIaFRO2ATP9dnq9fQT12iWRqfJVO_bmUvws=VP1AHCbeR7vgEFNWbe3wBmThujk0NNfiKYbP2VZdkose= --- lib/netlink-socket.c | 9 + 1 file changed, 9 insertions(+) diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index fab2a66..b73d843 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -797,8 +797,12 @@ nl_sock_transact_multiple__(struct nl_sock *sock, txn-request-size, reply_buf, sizeof reply_buf, reply_len, NULL)) { +/* The transaction was successfully sent but failed. */ +(*done)++; /* XXX: Map to a more appropriate error. */ error = EINVAL; +VLOG_DBG_RL(rl, fatal driver failure: %s, +ovs_lasterror_to_string()); break; } @@ -909,6 +913,11 @@ nl_sock_transact_multiple(struct nl_sock *sock, } else if (error) { VLOG_ERR_RL(rl, transaction error (%s), ovs_strerror(error)); nl_sock_record_errors__(transactions, n, error); +if (error != EAGAIN) { +/* A fatal error have occured. Abort the rest of + * transactions. */ +break; +} } } } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=1N6hdMturzIaFRO2ATP9dnq9fQT12iWRqfJVO_bmUvws=7NAcY0ICyK5QVOqfrFbaGe177U7Qu-az4hmbcyeo3U4e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 1/2] datapath-windows: Enable extension after rrestart
Sorin, As we discussed before we need to communicate an error from the BFE state change callback to the driver. Until we have this code could you please add an assert here: +if (FWPM_SERVICE_RUNNING == bfeState) { +status = OvsTunnelFilterInitialize(driverObject); +if (!NT_SUCCESS(status)) { ASSERT(ndisStatus == NDIS_STATUS_SUCCESS); +OVS_LOG_ERROR( +Failed to initialize tunnel filter, status: %x., +status); +} Besides of that it looks good. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, April 15, 2015 3:49 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2 1/2] datapath-windows: Enable extension after rrestart The extension failed to be activated during booting due to the failure to initialize tunnel filter. This happened because the Base Filtering Engine (BFE) is not started and no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the tunnel filter is initialized. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_77d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=PAwE2zArQ3gt-yDkBA-CMNQoYXUy5GYf0rdyR8g_jFUs=963Q2_2uIQVM9YXNkCj4eUMrsA19hfjr-BdszYb2BR0e= --- datapath-windows/ovsext/Switch.c | 11 ++-- datapath-windows/ovsext/TunnelFilter.c | 117 - datapath-windows/ovsext/TunnelIntf.h | 4 +- 3 files changed, 105 insertions(+), 27 deletions(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index 61a4531..2b9a713 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -41,6 +41,7 @@ UINT64 ovsTimeIncrementPerTick; extern PNDIS_SPIN_LOCK gOvsCtrlLock; extern NDIS_HANDLE gOvsExtDriverHandle; extern NDIS_HANDLE gOvsExtDriverObject; +extern PDEVICE_OBJECT gOvsDeviceObject; static NDIS_STATUS OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, POVS_SWITCH_CONTEXT *switchContextOut); @@ -202,12 +203,8 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, goto create_switch_done; } -status = OvsTunnelFilterInitialize(gOvsExtDriverObject); -if (status != NDIS_STATUS_SUCCESS) { -OvsUninitSwitchContext(switchContext); -OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); -goto create_switch_done; -} +OvsInitTunnelFilter(gOvsExtDriverObject, gOvsDeviceObject); + *switchContextOut = switchContext; create_switch_done: @@ -261,7 +258,7 @@ OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) if (switchContext) { dpNo = switchContext-dpNo; -OvsTunnelFilterUninitialize(gOvsExtDriverObject); +OvsUninitTunnelFilter(gOvsExtDriverObject); OvsClearAllSwitchVports(switchContext); OvsUninitSwitchContext(switchContext); OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index 4b879c0..e54ecff 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -111,7 +111,8 @@ DEFINE_GUID( PDEVICE_OBJECT gDeviceObject; HANDLE gEngineHandle = NULL; -HANDLE gBfeSubscriptionHandle = NULL; +HANDLE gTunnelProviderBfeHandle = NULL; HANDLE gTunnelInitBfeHandle = +NULL; UINT32 gCalloutIdV4; @@ -547,8 +548,8 @@ Exit: } VOID NTAPI -OvsBfeStateChangeCallback(PVOID context, - FWPM_SERVICE_STATE bfeState) +OvsTunnelProviderBfeCallback(PVOID context, + FWPM_SERVICE_STATE bfeState) { HANDLE handle = NULL; @@ -564,19 +565,19 @@ OvsBfeStateChangeCallback(PVOID context, } NTSTATUS -OvsSubscribeBfeStateChanges(PVOID deviceObject) +OvsSubscribeTunnelProviderBfeStateChanges(PVOID deviceObject) { NTSTATUS status = STATUS_SUCCESS; -if (!gBfeSubscriptionHandle) { +if (!gTunnelProviderBfeHandle) { status = FwpmBfeStateSubscribeChanges(deviceObject, - OvsBfeStateChangeCallback, + + OvsTunnelProviderBfeCallback, NULL, - gBfeSubscriptionHandle); + + gTunnelProviderBfeHandle); if (!NT_SUCCESS(status)) { OVS_LOG_ERROR( -Failed to open subscribe BFE state change callback, status: %x., -status); +
Re: [ovs-dev] [PATCH v2 2/2] datapath-windows: Removed assert from FilterNetPnPEvent handler
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, April 15, 2015 3:42 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2 2/2] datapath-windows: Removed assert from FilterNetPnPEvent handler Removed an inappropriate assert from the FilterNetPnPEvent routine, OvsExtNetPnPEvent. When NDIS calls the FilterNetPnPEvent routine, the extension is in paused state and, obviously, the switch is not active. The switch becomes active after FilterRestart routine is called and the restart is successfully complete. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com --- datapath-windows/ovsext/Switch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index 2b9a713..cfbb5a0 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -523,7 +523,6 @@ OvsExtNetPnPEvent(NDIS_HANDLE filterModuleContext, switchContext-isActivateFailed = TRUE; } else { ASSERT(switchContext-isActivated == FALSE); -ASSERT(switchActive == TRUE); if (switchContext-isActivated == FALSE switchActive == TRUE) { status = OvsActivateSwitch(switchContext); OVS_LOG_TRACE(OvsExtNetPnPEvent: activated switch: %p -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=CSXu-iIaADJIxM63f-MXIdiak6jSiIUo2oyeS7uqPJss=kjRXgtYuj-q0wGQqabL0U0U-XMev-5H0lYo5y2rU2LYe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned
If we remove the increment of the transaction than the whole sequence of transaction will be lost. This should be done only after we change the driver to never fail in case the transaction fail. The current driver fails also when there are transaction level erros and when there are some other temporary errors. I would prefer to move to the next transaction in that case rather than dump the whole sequence. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, April 15, 2015 1:22 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v4] netlink-socket: Exit NL transaction loop when EINVAL is returned The nl_sock_transact_multiple function enters in an infinite loop, when invalid error, EINVAL, is returned by nl_sock_transact_multiple__. EINVAL is the error returned by the latter function when a driver request fails. v2: Any error returned by nl_sock_transact_multiple__, except EAGAIN, causes the rest of NL transactions to be aborted. An error response from the driver is considered a successful transaction and the 'done' transactions counter is incremented. v3: Removed the incrementation of the transactions counter in case of driver request failure. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_57d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SoJBySQ9Ab0iZ66kD5oQW1lNQi2mdEyB-hkYI_568PYs=qlfxf-x6rCbgRjcbZqeI1d7oSV9FpZDsQr1jdgHz_wIe= Acked-by: Eitan Eliahu elia...@vmware.com Acked-by: Nithin Raju nit...@vmware.com --- lib/netlink-socket.c | 9 + 1 file changed, 9 insertions(+) diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index fab2a66..b73d843 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -797,8 +797,12 @@ nl_sock_transact_multiple__(struct nl_sock *sock, txn-request-size, reply_buf, sizeof reply_buf, reply_len, NULL)) { /* XXX: Map to a more appropriate error. */ error = EINVAL; +VLOG_DBG_RL(rl, fatal driver failure: %s, +ovs_lasterror_to_string()); break; } @@ -909,6 +913,11 @@ nl_sock_transact_multiple(struct nl_sock *sock, } else if (error) { VLOG_ERR_RL(rl, transaction error (%s), ovs_strerror(error)); nl_sock_record_errors__(transactions, n, error); +if (error != EAGAIN) { +/* A fatal error has occured. Abort the rest of + * transactions. */ +break; +} } } } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=SoJBySQ9Ab0iZ66kD5oQW1lNQi2mdEyB-hkYI_568PYs=CJsqfRiyJVs7TlbH5t9Cuugwakz_9cloFcKkSdXxxKke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned
Yes, some cases where the transaction is completed with an error we need to increase the done counter, This case would be different than the case where the transaction didn't go through. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, April 14, 2015 2:19 PM To: Ben Pfaff; Sorin Vinturis Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned In nl_sock_transact_multiple__ we do the following: if (!DeviceIoControl(sock-handle, OVS_IOCTL_TRANSACT, txn-request-data, txn-request-size, reply_buf, sizeof reply_buf, reply_len, NULL)) { /* XXX: Map to a more appropriate error. */ error = EINVAL; break; } We map every failure to EINVAL that is why it did not pop out into Linux. We should definitely log the error using ovs_lasterror_to_string before setting it to EINVAL. Maybe we should just increase the number of transactions in some situations(i.e. STATUS_INVALID_PARAMETER) as an idea to allow the rest of the transactions to be processed. Alin. -Mesaj original- De la: dev [mailto:dev-boun...@openvswitch.org] În numele Ben Pfaff Trimis: Tuesday, April 14, 2015 11:42 PM Către: Sorin Vinturis Cc: dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned On Tue, Apr 14, 2015 at 08:25:59PM +, Sorin Vinturis wrote: The nl_sock_transact_multiple function enters in an infinite loop, when invalid error, EINVAL, is returned by nl_sock_transact_multiple__. EINVAL is the error returned by the latter function when a driver request fails. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_57d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=YVmZuxZuPYrnWO888OUuBR52fT8FJiccWxGc1MINlzos=TyVETpKzpDFZ0fNq_BkMdUZ2ZWIiKOCnNjGFbftWyp0e= I see that this fixes a bug, even on Linux. Thank you. It's actually a pretty serious bug (given the infinite loop), but I guess that it must not occur in any normal circumstances, otherwise we would have heard about it over the years. However, I want to make sure of something before I commit it. nl_sock_transact_multiple__() should only return an error in the case of a transport error, that is, of some problem communicating with the datapath (e.g. the kernel module has been removed or something similarly fatal). It should not return an error in cases where some message asks the datapath to do something erroneous (e.g. to add a flow that the datapath doesn't understand, to delete a vport that doesn't exist, ...). This is because only in the former case should all of the transactions be aborted; in the latter case, any remaining transactions should still be processed. ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=YVmZuxZuPYrnWO888OUuBR52fT8FJiccWxGc1MINlzos=UmlNVfETCHyYzoXJ3xE5k5-JXC_h_V1gLAT1hKo6bbke= ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=YVmZuxZuPYrnWO888OUuBR52fT8FJiccWxGc1MINlzos=UmlNVfETCHyYzoXJ3xE5k5-JXC_h_V1gLAT1hKo6bbke= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned
The DeviceIOControl() error should correspond to a transport error in Linux or to a system error. We need to transfer all transaction failures through the reply buffer (nlmsghdr+nlmsgerr) and return success for the DeviceIOControl(). I am aware that we didn't follow the exact semantics in the driver and we sometimes fail the I/O request in the case where the transaction fails. It should be fixed in the driver. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Tuesday, April 14, 2015 2:31 PM To: Alin Serdean Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned Does every error returned by DeviceIoControl() correspond to a transport error (with the meaning that I explained earlier)? nl_sock_transact_multiple__() should report that are not transport errors by constructing a nlmsghdr reply with an mlmsgerr as its payload. Here is the high level situation. With a Linux kernel, it is more efficient to send multiple Netlink requests to the kernel in a batch using a single system call. The results are equivalent to sending the requests one-by-one. As an optimization, if there is a severe error that means that no requests are going to succeed at all, then the code may skip sending the remaining requests. That is the only case that this is meant to handle: } else if (error) { VLOG_ERR_RL(rl, transaction error (%s), ovs_strerror(error)); nl_sock_record_errors__(transactions, n, error); } This code will *not* handle ordinary errors short of this kind of severe error properly, and should not be invoked in that case. (It is also buggy in that case, and I see that the patch fixes that bug, but that is not my point here.) If in fact on Windows it is getting invoked in cases other than a severe error, then nl_sock_record_errors__() should be modified to report ordinary errors differently (probably by constructing an nlmsghdr+nlmsgerr). Thanks, Ben. On Tue, Apr 14, 2015 at 09:19:10PM +, Alin Serdean wrote: In nl_sock_transact_multiple__ we do the following: if (!DeviceIoControl(sock-handle, OVS_IOCTL_TRANSACT, txn-request-data, txn-request-size, reply_buf, sizeof reply_buf, reply_len, NULL)) { /* XXX: Map to a more appropriate error. */ error = EINVAL; break; } We map every failure to EINVAL that is why it did not pop out into Linux. We should definitely log the error using ovs_lasterror_to_string before setting it to EINVAL. Maybe we should just increase the number of transactions in some situations(i.e. STATUS_INVALID_PARAMETER) as an idea to allow the rest of the transactions to be processed. Alin. -Mesaj original- De la: dev [mailto:dev-boun...@openvswitch.org] ??n numele Ben Pfaff Trimis: Tuesday, April 14, 2015 11:42 PM C??tre: Sorin Vinturis Cc: dev@openvswitch.org Subiect: Re: [ovs-dev] [PATCH] netlink-socket: Exit NL transaction loop when EINVAL is returned On Tue, Apr 14, 2015 at 08:25:59PM +, Sorin Vinturis wrote: The nl_sock_transact_multiple function enters in an infinite loop, when invalid error, EINVAL, is returned by nl_sock_transact_multiple__. EINVAL is the error returned by the latter function when a driver request fails. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_open vswitch_ovs-2Dissues_issues_57d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXV eAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=7b qSnC4PRttbbFBZrlSXsx-0THTQOfNE_D4bKpkkChws=2zCC8GZSSTlR-cjRseO-dFWa CIQRAb8jm-uXX-zOa5Ee= I see that this fixes a bug, even on Linux. Thank you. It's actually a pretty serious bug (given the infinite loop), but I guess that it must not occur in any normal circumstances, otherwise we would have heard about it over the years. However, I want to make sure of something before I commit it. nl_sock_transact_multiple__() should only return an error in the case of a transport error, that is, of some problem communicating with the datapath (e.g. the kernel module has been removed or something similarly fatal). It should not return an error in cases where some message asks the datapath to do something erroneous (e.g. to add a flow that the datapath doesn't understand, to delete a vport that doesn't exist, ...). This is because only in the former case should all of the transactions be aborted; in the latter case, any remaining transactions should still be processed. ___ dev mailing list dev@openvswitch.org
Re: [ovs-dev] [PATCH] datapath-windows: extension fails to be enabled
Hi Sorin, I am somewhat confused about this change. Have you concluded that the filter could not be initialized unless a provider is already registered? I am trying to understand the relationships between this change and the change you check in before (also, to address the issue that the BFE had not started yet). On another issue: I don't see how the filter failure to initialize is communicated to the driver. I think we need to log a message in the system log and also to put the driver in a failure state. I'm concerned that a callback will be registered twice (On Driverentry as weel on Attach). Please let us know which issue you are trying to address with this change. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, April 09, 2015 5:20 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: extension fails to be enabled The extension failed to be activated during booting due to the failure to initialize tunnel filter. This happened because the Base Filtering Engine (BFE) is not started and no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the tunnel filter is initialized. Also, I have removed an inappropriate assert from the FilterNetPnPEvent routine, OvsExtNetPnPEvent. When NDIS calls the FilterNetPnPEvent routine, the extension is in paused state and, obviously, the switch is not active. The switch becomes active after FilterRestart routine is called and the restart is successfully complete. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_77d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=dBFLkhnGUaFy8lz8z0hjyZlLKcbd5GfUsaJezXD6AYws=Z1vNsPvCGNTMUH4_qkVTuNa-Xt23vnYCHeLHJ--o44oe= --- datapath-windows/ovsext/Switch.c | 12 ++-- datapath-windows/ovsext/TunnelFilter.c | 117 - datapath-windows/ovsext/TunnelIntf.h | 4 +- 3 files changed, 105 insertions(+), 28 deletions(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index 61a4531..cfbb5a0 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -41,6 +41,7 @@ UINT64 ovsTimeIncrementPerTick; extern PNDIS_SPIN_LOCK gOvsCtrlLock; extern NDIS_HANDLE gOvsExtDriverHandle; extern NDIS_HANDLE gOvsExtDriverObject; +extern PDEVICE_OBJECT gOvsDeviceObject; static NDIS_STATUS OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, POVS_SWITCH_CONTEXT *switchContextOut); @@ -202,12 +203,8 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, goto create_switch_done; } -status = OvsTunnelFilterInitialize(gOvsExtDriverObject); -if (status != NDIS_STATUS_SUCCESS) { -OvsUninitSwitchContext(switchContext); -OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); -goto create_switch_done; -} +OvsInitTunnelFilter(gOvsExtDriverObject, gOvsDeviceObject); + *switchContextOut = switchContext; create_switch_done: @@ -261,7 +258,7 @@ OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) if (switchContext) { dpNo = switchContext-dpNo; -OvsTunnelFilterUninitialize(gOvsExtDriverObject); +OvsUninitTunnelFilter(gOvsExtDriverObject); OvsClearAllSwitchVports(switchContext); OvsUninitSwitchContext(switchContext); OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); @@ -526,7 +523,6 @@ OvsExtNetPnPEvent(NDIS_HANDLE filterModuleContext, switchContext-isActivateFailed = TRUE; } else { ASSERT(switchContext-isActivated == FALSE); -ASSERT(switchActive == TRUE); if (switchContext-isActivated == FALSE switchActive == TRUE) { status = OvsActivateSwitch(switchContext); OVS_LOG_TRACE(OvsExtNetPnPEvent: activated switch: %p diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index 4b879c0..e54ecff 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -111,7 +111,8 @@ DEFINE_GUID( PDEVICE_OBJECT gDeviceObject; HANDLE gEngineHandle = NULL; -HANDLE gBfeSubscriptionHandle = NULL; +HANDLE gTunnelProviderBfeHandle = NULL; HANDLE gTunnelInitBfeHandle = +NULL; UINT32 gCalloutIdV4; @@ -547,8 +548,8 @@ Exit: } VOID NTAPI -OvsBfeStateChangeCallback(PVOID context, - FWPM_SERVICE_STATE bfeState) +OvsTunnelProviderBfeCallback(PVOID context, + FWPM_SERVICE_STATE bfeState) { HANDLE handle = NULL; @@
Re: [ovs-dev] [PATCH v2] datapath-windows: Solved BSOD when uninstalling the driver (race condition)
Hi Sorin, This is much better (it is hard to protect on the object using the object itself). Thank you! Eitan Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, April 03, 2015 8:41 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Solved BSOD when uninstalling the driver (race condition) The BSOD occurred because the FilterAttach routine released the switch context, while there were IRPs in processing. The solution was to add a reference count to prevent premature deallocation of the global switch context structure, gOvsSwitchContext. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_58d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=JPNUC1kAlOusH_OvuwUMUDbLcGYZ-gCLHEDUfC60ht4s=0-K6UGrJBAH522ntyDezqkI54X6R93wF7wQAJCVzhxIe= --- datapath-windows/ovsext/Datapath.c | 12 ++-- datapath-windows/ovsext/Switch.c | 56 ++ datapath-windows/ovsext/Switch.h | 6 +++- 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f1..b692225 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -701,8 +701,13 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, /* Check if the extension is enabled. */ if (NULL == gOvsSwitchContext) { -status = STATUS_DEVICE_NOT_READY; -goto done; +status = STATUS_NOT_FOUND; +goto exit; +} + +if (!OvsAcquireSwitchContext()) { +status = STATUS_NOT_FOUND; +goto exit; } /* Concurrent netlink operations are not supported. */ @@ -874,6 +879,9 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, status = InvokeNetlinkCmdHandler(usrParamsCtx, nlFamilyOps, replyLen); done: +OvsReleaseSwitchContext(gOvsSwitchContext); + +exit: KeMemoryBarrier(); instance-inUse = 0; diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index a228d8e..94565a6 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -42,6 +42,12 @@ extern PNDIS_SPIN_LOCK gOvsCtrlLock; extern NDIS_HANDLE gOvsExtDriverHandle; extern NDIS_HANDLE gOvsExtDriverObject; +/* + * Reference count used to prevent premature deallocation of the global +switch + * context structure, gOvsSwitchContext. + */ +volatile LONG gOvsSwitchContextRefCount = 1; + static NDIS_STATUS OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, POVS_SWITCH_CONTEXT *switchContextOut); static NDIS_STATUS OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext); @@ -420,6 +426,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext-isActivateFailed = FALSE; switchContext-dpNo = OVS_DP_NUMBER; ovsTimeIncrementPerTick = KeQueryTimeIncrement() / 1; + OVS_LOG_TRACE(Exit: Succesfully initialized switchContext: %p, switchContext); return NDIS_STATUS_SUCCESS; @@ -428,6 +435,12 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) static VOID OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) { +OvsReleaseSwitchContext(switchContext); +} + +VOID +OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext) { OVS_LOG_TRACE(Enter: Delete switchContext:%p, switchContext); /* We need to do cleanup for tunnel port here. */ @@ -450,6 +463,49 @@ OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) OVS_LOG_TRACE(Exit: Delete switchContext: %p, switchContext); } +VOID +OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext) { +LONG ref = 0; +LONG newRef = 0; +LONG icxRef = 0; + +do { +ref = gOvsSwitchContextRefCount; +newRef = (0 == ref) ? 0 : ref - 1; +icxRef = InterlockedCompareExchange(gOvsSwitchContextRefCount, +newRef, +ref); +} while (icxRef != ref); + +if (ref == 1) { +OvsDeleteSwitchContext(switchContext); +} +} + +BOOLEAN +OvsAcquireSwitchContext(VOID) +{ +LONG ref = 0; +LONG newRef = 0; +LONG icxRef = 0; +BOOLEAN ret = FALSE; + +do { +ref = gOvsSwitchContextRefCount; +newRef = (0 == ref) ? 0 : ref + 1; +icxRef = InterlockedCompareExchange(gOvsSwitchContextRefCount, +newRef, +ref); +} while (icxRef != ref); + +if (ref != 0) { +ret = TRUE; +} + +return ret
Re: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition)
Hi Sorin, Can you please explain how the case where FilterDetach is called on a different core concurrently with the Release and between switchContext is checked for NULL and the swicthContext-refCount is referenced ? (where it is marked ) It seems that FilterDetach would set gOvsSwitchContext to NULL even if there are outstanding IRPs and the switch context has not been released as of yet. +do { +if (NULL == switchContext) { +break; +} +if (0 == InterlockedCompareExchange( +(LONG volatile *)switchContext-refCount, 0, 0)) { +break; +} Can you inline the acquisition and release functions? Thanks! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, March 20, 2015 10:28 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition) The BSOD occurred because the FilterAttach routine released the switch context, while there were IRPs in processing. The solution was to add a reference count in the switch context to prevent premature deallocation of the switch context structure. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_58d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=bKJV7k8Y9bG2Z1Hczw1uCkihZsQUivQ4nMAjrAWy20Is=JgFv3Pq9CjJRPHRfSRgXB4ibNGyMlSl8a6kKOfNQ2_ke= --- datapath-windows/ovsext/Datapath.c | 10 + datapath-windows/ovsext/Switch.c | 44 ++ datapath-windows/ovsext/Switch.h | 12 ++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f1..8b561a3 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -699,10 +699,9 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, outputBufferLen = irpSp-Parameters.DeviceIoControl.OutputBufferLength; inputBuffer = irp-AssociatedIrp.SystemBuffer; -/* Check if the extension is enabled. */ -if (NULL == gOvsSwitchContext) { -status = STATUS_DEVICE_NOT_READY; -goto done; +if (!OvsAcquireSwitchContext(gOvsSwitchContext)) { +status = STATUS_NOT_FOUND; +goto exit; } /* Concurrent netlink operations are not supported. */ @@ -874,6 +873,9 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, status = InvokeNetlinkCmdHandler(usrParamsCtx, nlFamilyOps, replyLen); done: +OvsReleaseSwitchContext(gOvsSwitchContext); + +exit: KeMemoryBarrier(); instance-inUse = 0; diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index a228d8e..8366944 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -420,6 +420,9 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext-isActivateFailed = FALSE; switchContext-dpNo = OVS_DP_NUMBER; ovsTimeIncrementPerTick = KeQueryTimeIncrement() / 1; + +switchContext-refCount = 1; + OVS_LOG_TRACE(Exit: Succesfully initialized switchContext: %p, switchContext); return NDIS_STATUS_SUCCESS; @@ -428,6 +431,12 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) static VOID OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) { +OvsReleaseSwitchContext(switchContext); +} + +VOID +OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext) { OVS_LOG_TRACE(Enter: Delete switchContext:%p, switchContext); /* We need to do cleanup for tunnel port here. */ @@ -447,9 +456,44 @@ OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext-pidHashArray = NULL; OvsDeleteFlowTable(switchContext-datapath); OvsCleanupBufferPool(switchContext); +switchContext-refCount = 0; OVS_LOG_TRACE(Exit: Delete switchContext: %p, switchContext); } +VOID +OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext) { +if (1 == InterlockedCompareExchange( +(LONG volatile *)switchContext-refCount, 0, 1)) { +OvsDeleteSwitchContext(switchContext); +} +else { +InterlockedDecrement((LONG volatile *)switchContext-refCount); +} +} + +BOOLEAN +OvsAcquireSwitchContext(POVS_SWITCH_CONTEXT switchContext) { +BOOLEAN ret = FALSE; + +do { +if (NULL == switchContext) { +break; +} + +if (0 == InterlockedCompareExchange( +(LONG volatile *)switchContext-refCount, 0, 0)) { +break; +} + +InterlockedIncrement((LONG volatile *)switchContext-refCount); +ret = TRUE; +} while (!ret); + +return ret; +} + /* *
Re: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition)
Hi Sorin, Per your example: suppose there is another IRP which is currently executing and almost completed. This thread will call release and free the memory pointed by switchContext. As you said the switchContext of the first thread maintains its value. Then, reference to - switchContext -refCount will generate a memory violation. Also, I think gOvsSwitchContext need to be memory synchronized with a memory barrier. Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Thursday, April 02, 2015 3:12 PM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition) Hi Eitan, I will try to explain with an example. Considering that switchContext != NULL and switchContext-refCount == 1, we have the following scenario: On thread 1, a new packet is received and OvsAcquireSwitchContext() is called. The first condition checks the switchContext against NULL and it is FALSE. The thread 1 execution is stalled and the context is switched to thread 2. On thread 2, filter detach is called which later calls OvsReleaseSwitchContext(). The first condition checks to see if switchContext-refCount == 1. The condition is TRUE and switchContext-refCount is set to 0 (zero). Then the gOvsSwitchContext is released and set to NULL. Thread 1 resumes execution. On thread 1, the execution is resumed and the second condition is checked. The second condition checks to see if switchContext-refCount == 0. The condition is TRUE and the function returns FALSE, whithout increasing the switchContext-refCount. Here, please observe that switchContext is the argument passed to the OvsAcquireSwitchContext() function and it points to the address of gOvsSwitchContext. If the latter is released and set to NULL, the former retains its value. Thus, the value at switchContext-refCount is valid and zero. Subsequent calls of OvsAcquireSwitchContext() will return FALSE, because the switchContext is NULL. I hope the above explanation answers your question. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Friday, 3 April, 2015 00:21 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition) Hi Sorin, Can you please explain how the case where FilterDetach is called on a different core concurrently with the Release and between switchContext is checked for NULL and the swicthContext-refCount is referenced ? (where it is marked ) It seems that FilterDetach would set gOvsSwitchContext to NULL even if there are outstanding IRPs and the switch context has not been released as of yet. +do { +if (NULL == switchContext) { +break; +} +if (0 == InterlockedCompareExchange( +(LONG volatile *)switchContext-refCount, 0, 0)) { +break; +} Can you inline the acquisition and release functions? Thanks! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, March 20, 2015 10:28 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Solved BSOD when uninstalling the driver (race condition) The BSOD occurred because the FilterAttach routine released the switch context, while there were IRPs in processing. The solution was to add a reference count in the switch context to prevent premature deallocation of the switch context structure. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_58d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=bKJV7k8Y9bG2Z1Hczw1uCkihZsQUivQ4nMAjrAWy20Is=JgFv3Pq9CjJRPHRfSRgXB4ibNGyMlSl8a6kKOfNQ2_ke= --- datapath-windows/ovsext/Datapath.c | 10 + datapath-windows/ovsext/Switch.c | 44 ++ datapath-windows/ovsext/Switch.h | 12 ++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f1..8b561a3 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -699,10 +699,9 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, outputBufferLen = irpSp-Parameters.DeviceIoControl.OutputBufferLength; inputBuffer = irp-AssociatedIrp.SystemBuffer; -/* Check if the extension is enabled. */ -if (NULL == gOvsSwitchContext) { -status = STATUS_DEVICE_NOT_READY; -goto done; +if (!OvsAcquireSwitchContext(gOvsSwitchContext)) { +status = STATUS_NOT_FOUND; +goto exit; } /* Concurrent netlink operations are not supported. */ @@ -874,6 +873,9
Re: [ovs-dev] [PATCH 06/11] datapath-windows: Added specific pool tag for vxlan code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 06/11] datapath-windows: Added specific pool tag for vxlan code All memory allocations within vxlan code have 'XSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=s8ZVryFVQEEQTOvSHLwkW76YNVil3iX9H-yeapC06-4s=ExQaobyK6h03xd4tE566aGpa_R7mN5F0Bkfdh2QcU28e= --- datapath-windows/ovsext/Util.h | 1 + datapath-windows/ovsext/Vxlan.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 907cd3c..c153acf 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -27,6 +27,7 @@ #define OVS_DATAPATH_POOL_TAG 'DSVO' #define OVS_EVENT_POOL_TAG 'ESVO' #define OVS_FLOW_POOL_TAG 'LSVO' +#define OVS_VXLAN_POOL_TAG 'XSVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); diff --git a/datapath-windows/ovsext/Vxlan.c b/datapath-windows/ovsext/Vxlan.c index 1ce5af2..8c57185 100644 --- a/datapath-windows/ovsext/Vxlan.c +++ b/datapath-windows/ovsext/Vxlan.c @@ -59,7 +59,8 @@ OvsInitVxlanTunnel(POVS_VPORT_ENTRY vport, { POVS_VXLAN_VPORT vxlanPort; -vxlanPort = OvsAllocateMemory(sizeof (*vxlanPort)); +vxlanPort = OvsAllocateMemoryWithTag(sizeof (*vxlanPort), + OVS_VXLAN_POOL_TAG); if (vxlanPort == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } @@ -86,7 +87,7 @@ OvsCleanupVxlanTunnel(POVS_VPORT_ENTRY vport) return; } -OvsFreeMemory(vport-priv); +OvsFreeMemoryWithTag(vport-priv, OVS_VXLAN_POOL_TAG); vport-priv = NULL; } -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=s8ZVryFVQEEQTOvSHLwkW76YNVil3iX9H-yeapC06-4s=dq-mcIzIbOb9sCusAMy3xoUKhKPed-M1X1ye0SLpLdEe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 02/11] datapath-windows: Added specific pool tag for datapath code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 02/11] datapath-windows: Added specific pool tag for datapath code All memory allocations within datapath code have 'DSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=DZ9NxwHwM2-ju5h2ApoXI4ixxtWhE5XOWxehunLNePAs=03pH_zMsgx4mHjve75q_KTCcDggcvsnovQkvAGLLWg0e= --- datapath-windows/ovsext/Datapath.c | 38 +++--- datapath-windows/ovsext/Datapath.h | 31 +++ datapath-windows/ovsext/Util.h | 1 + 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index c6fe89e..888c6ef 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -349,6 +349,37 @@ extern POVS_SWITCH_CONTEXT gOvsSwitchContext; NDIS_SPIN_LOCK ovsCtrlLockObj; PNDIS_SPIN_LOCK gOvsCtrlLock; +NTSTATUS +InitUserDumpState(POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg) +{ +/* Clear the dumpState from a previous dump sequence. */ +ASSERT(instance-dumpState.ovsMsg == NULL); +ASSERT(ovsMsg); + +instance-dumpState.ovsMsg = +(POVS_MESSAGE)OvsAllocateMemoryWithTag(sizeof(OVS_MESSAGE), + OVS_DATAPATH_POOL_TAG); +if (instance-dumpState.ovsMsg == NULL) { +return STATUS_NO_MEMORY; +} +RtlCopyMemory(instance-dumpState.ovsMsg, ovsMsg, + sizeof *instance-dumpState.ovsMsg); +RtlZeroMemory(instance-dumpState.index, + sizeof instance-dumpState.index); + +return STATUS_SUCCESS; +} + +VOID +FreeUserDumpState(POVS_OPEN_INSTANCE instance) { +if (instance-dumpState.ovsMsg != NULL) { +OvsFreeMemoryWithTag(instance-dumpState.ovsMsg, + OVS_DATAPATH_POOL_TAG); +RtlZeroMemory(instance-dumpState, sizeof instance-dumpState); +} +} VOID OvsInit() @@ -497,7 +528,8 @@ OvsAddOpenInstance(POVS_DEVICE_EXTENSION ovsExt, PFILE_OBJECT fileObject) { POVS_OPEN_INSTANCE instance = -(POVS_OPEN_INSTANCE) OvsAllocateMemory(sizeof (OVS_OPEN_INSTANCE)); +(POVS_OPEN_INSTANCE)OvsAllocateMemoryWithTag(sizeof(OVS_OPEN_INSTANCE), + + OVS_DATAPATH_POOL_TAG); UINT32 i; if (instance == NULL) { @@ -508,7 +540,7 @@ OvsAddOpenInstance(POVS_DEVICE_EXTENSION ovsExt, if (ovsNumberOfOpenInstances = OVS_MAX_OPEN_INSTANCES) { OvsReleaseCtrlLock(); -OvsFreeMemory(instance); +OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory(instance, sizeof (OVS_OPEN_INSTANCE)); @@ -559,7 +591,7 @@ OvsRemoveOpenInstance(PFILE_OBJECT fileObject) OvsReleaseCtrlLock(); ASSERT(instance-eventQueue == NULL); ASSERT (instance-packetQueue == NULL); -OvsFreeMemory(instance); +OvsFreeMemoryWithTag(instance, OVS_DATAPATH_POOL_TAG); } NTSTATUS diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h index ba31ece..863afc4 100644 --- a/datapath-windows/ovsext/Datapath.h +++ b/datapath-windows/ovsext/Datapath.h @@ -129,35 +129,10 @@ InitUserParamsCtx(PIRP irp, usrParamsCtx-outputLength = outputLength; } -static __inline NTSTATUS -InitUserDumpState(POVS_OPEN_INSTANCE instance, - POVS_MESSAGE ovsMsg) -{ -/* Clear the dumpState from a previous dump sequence. */ -ASSERT(instance-dumpState.ovsMsg == NULL); -ASSERT(ovsMsg); - -instance-dumpState.ovsMsg = -(POVS_MESSAGE) OvsAllocateMemory(sizeof (OVS_MESSAGE)); -if (instance-dumpState.ovsMsg == NULL) { -return STATUS_NO_MEMORY; -} -RtlCopyMemory(instance-dumpState.ovsMsg, ovsMsg, - sizeof *instance-dumpState.ovsMsg); -RtlZeroMemory(instance-dumpState.index, - sizeof instance-dumpState.index); - -return STATUS_SUCCESS; -} +NTSTATUS InitUserDumpState(POVS_OPEN_INSTANCE instance, + POVS_MESSAGE ovsMsg); -static __inline VOID -FreeUserDumpState(POVS_OPEN_INSTANCE instance) -{ -if (instance-dumpState.ovsMsg != NULL) { -OvsFreeMemory(instance-dumpState.ovsMsg); -RtlZeroMemory(instance-dumpState, sizeof instance-dumpState); -} -} +VOID FreeUserDumpState(POVS_OPEN_INSTANCE instance); NTSTATUS OvsSetupDumpStart(POVS_USER_PARAMS_CONTEXT usrParamsCtx
Re: [ovs-dev] [PATCH 03/11] datapath-windows: Added specific pool tag for buffermgmt code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 03/11] datapath-windows: Added specific pool tag for buffermgmt code All MDL memory allocations within buffermgmt code have 'BSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=FMyEju7S1mdlucSXaZFurH5KBLKl_lSvnoefnsnhLWEs=ZmuOe6qU6VuCnDa4PWKxosVp3gACVWtZaQlPzzRgW2ce= --- datapath-windows/ovsext/BufferMgmt.c | 6 +++--- datapath-windows/ovsext/Util.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index e0377c1..572b298 100644 --- a/datapath-windows/ovsext/BufferMgmt.c +++ b/datapath-windows/ovsext/BufferMgmt.c @@ -433,14 +433,14 @@ OvsAllocateMDLAndData(NDIS_HANDLE ndisHandle, PMDL mdl; PVOID data; -data = OvsAllocateMemory(dataSize); +data = OvsAllocateMemoryWithTag(dataSize, OVS_MDL_POOL_TAG); if (data == NULL) { return NULL; } mdl = NdisAllocateMdl(ndisHandle, data, dataSize); if (mdl == NULL) { -OvsFreeMemory(data); +OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG); } return mdl; @@ -454,7 +454,7 @@ OvsFreeMDLAndData(PMDL mdl) data = MmGetMdlVirtualAddress(mdl); NdisFreeMdl(mdl); -OvsFreeMemory(data); +OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG); } diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 0f32654..6a9c169 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -23,6 +23,7 @@ #define OVS_NBL_ONLY_POOL_TAG 'OSVO' #define OVS_NET_BUFFER_POOL_TAG 'NSVO' #define OVS_OTHER_POOL_TAG 'MSVO' +#define OVS_MDL_POOL_TAG'BSVO' #define OVS_DATAPATH_POOL_TAG 'DSVO' VOID *OvsAllocateMemory(size_t size); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=FMyEju7S1mdlucSXaZFurH5KBLKl_lSvnoefnsnhLWEs=DhACiQI8gD1DUydSnQANO5k_RZW7x-xVAHFY47P-4Zwe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 10/11] datapath-windows: Added specific pool tag for user code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 10/11] datapath-windows: Added specific pool tag for user code All memory allocations within user code have 'USVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Bnsc6KJDUzV5MvIKhovWz3pmaTxrHmiYkHtZGS-RS9os=JKwXbeFASLrQohiIc2ziFw8gbBtT-LzRNIZ0o5xhJYAe= --- datapath-windows/ovsext/User.c | 18 ++ datapath-windows/ovsext/Util.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index d8a657e..03f0377 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -85,7 +85,7 @@ OvsPurgePacketQueue(POVS_USER_PACKET_QUEUE queue, LIST_FORALL_SAFE(tmp, link, next) { RemoveEntryList(link); elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); } } @@ -132,13 +132,13 @@ OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance) LIST_FORALL_SAFE(tmp, link, next) { RemoveEntryList(link); elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); } if (irp) { OvsCompleteIrpRequest(irp, 0, STATUS_SUCCESS); } if (queue) { -OvsFreeMemory(queue); +OvsFreeMemoryWithTag(queue, OVS_USER_POOL_TAG); } /* Verify if gOvsSwitchContext exists. */ @@ -170,7 +170,8 @@ OvsSubscribeDpIoctl(PVOID instanceP, OvsReleasePidHashLock(); } else if (instance-packetQueue == NULL join) { -queue = (POVS_USER_PACKET_QUEUE) OvsAllocateMemory(sizeof *queue); +queue = (POVS_USER_PACKET_QUEUE) OvsAllocateMemoryWithTag( +sizeof *queue, OVS_USER_POOL_TAG); if (queue == NULL) { return STATUS_NO_MEMORY; } @@ -248,7 +249,7 @@ OvsReadDpIoctl(PFILE_OBJECT fileObject, } *replyLen = len; -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); } return STATUS_SUCCESS; } @@ -762,7 +763,7 @@ OvsQueuePackets(PLIST_ENTRY packetList, while (!IsListEmpty(dropPackets)) { link = RemoveHeadList(dropPackets); elem = CONTAINING_RECORD(link, OVS_PACKET_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); num++; } @@ -1060,7 +1061,8 @@ OvsCreateQueueNlPacket(PVOID userData, dataLen + extraLen); allocLen = sizeof (OVS_PACKET_QUEUE_ELEM) + nlMsgSize; -elem = (POVS_PACKET_QUEUE_ELEM)OvsAllocateMemory(allocLen); +elem = (POVS_PACKET_QUEUE_ELEM)OvsAllocateMemoryWithTag(allocLen, + + OVS_USER_POOL_TAG); if (elem == NULL) { ovsUserStats.dropDuetoResource++; return NULL; @@ -1163,6 +1165,6 @@ OvsCreateQueueNlPacket(PVOID userData, return elem; fail: -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_USER_POOL_TAG); return NULL; } diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 2cebe6f..a8eed91 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -31,6 +31,7 @@ #define OVS_IPHELPER_POOL_TAG 'HSVO' #define OVS_OID_POOL_TAG'ASVO' #define OVS_SWITCH_POOL_TAG 'SSVO' +#define OVS_USER_POOL_TAG 'USVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Bnsc6KJDUzV5MvIKhovWz3pmaTxrHmiYkHtZGS-RS9os=WWItM_TDlmXjtpG-LzyxSUcpA2l9t7q__gRTEiHLi6Ye= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 08/11] datapath-windows: Added specific pool tag for oid code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 08/11] datapath-windows: Added specific pool tag for oid code All memory allocations within oid code have 'ASVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Zgt7ajB9JBKvuIzeflV2OMfV7prmxLskkHDn7l32FC4s=lMXyQUZgk7Kfxo_HiYMgnid6d11UVX1RmJf2IO23uzwe= --- datapath-windows/ovsext/Oid.c | 41 + datapath-windows/ovsext/Oid.h | 3 +++ datapath-windows/ovsext/Util.h | 1 + 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/datapath-windows/ovsext/Oid.c b/datapath-windows/ovsext/Oid.c index 83fa1e3..c94d17e 100644 --- a/datapath-windows/ovsext/Oid.c +++ b/datapath-windows/ovsext/Oid.c @@ -605,7 +605,7 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, NDIS_STATUS status; PNDIS_OID_REQUEST oidRequest; POVS_OID_CONTEXT oidContext; -ULONG OvsExtOidRequestId = 'ISVO'; +ULONG OvsExtOidRequestId = 'ISVO'; DBG_UNREFERENCED_PARAMETER(inputSize); DBG_UNREFERENCED_PARAMETER(oidInputBuffer); @@ -617,15 +617,17 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, ASSERT(oidOutputBuffer == NULL || outputSize != 0); ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); -oidRequest = OvsAllocateMemory(sizeof *oidRequest); +oidRequest = OvsAllocateMemoryWithTag(sizeof *oidRequest, + OVS_OID_POOL_TAG); if (!oidRequest) { status = NDIS_STATUS_RESOURCES; goto done; } -oidContext = OvsAllocateMemory(sizeof *oidContext); +oidContext = OvsAllocateMemoryWithTag(sizeof *oidContext, + OVS_OID_POOL_TAG); if (!oidContext) { -OvsFreeMemory(oidRequest); +OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); status = NDIS_STATUS_RESOURCES; goto done; } @@ -684,8 +686,8 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, status = oidContext-status; ASSERT(status != NDIS_STATUS_PENDING); -OvsFreeMemory(oidRequest); -OvsFreeMemory(oidContext); +OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); +OvsFreeMemoryWithTag(oidContext, OVS_OID_POOL_TAG); done: OVS_LOG_TRACE(Exit: status %8x., status); @@ -710,7 +712,8 @@ OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, OVS_LOG_TRACE(Enter: switchContext: %p, switchActive: %p, switchContext, switchActive); -switchParams = OvsAllocateMemory(sizeof *switchParams); +switchParams = OvsAllocateMemoryWithTag(sizeof *switchParams, +OVS_OID_POOL_TAG); if (!switchParams) { status = NDIS_STATUS_RESOURCES; goto done; @@ -741,7 +744,7 @@ OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, *switchActive = switchParams-IsActive; } -OvsFreeMemory(switchParams); +OvsFreeMemoryWithTag(switchParams, OVS_OID_POOL_TAG); done: OVS_LOG_TRACE(Exit: status %8x, switchActive: %d., @@ -769,7 +772,7 @@ OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, do { UINT32 reqdArraySize; -portArray = OvsAllocateMemory(arraySize); +portArray = OvsAllocateMemoryWithTag(arraySize, + OVS_OID_POOL_TAG); if (!portArray) { status = NDIS_STATUS_RESOURCES; goto done; @@ -794,7 +797,7 @@ OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, break; } -OvsFreeMemory(portArray); +OvsFreeMemoryWithTag(portArray, OVS_OID_POOL_TAG); arraySize = reqdArraySize; if (status != NDIS_STATUS_INVALID_LENGTH) { break; @@ -827,7 +830,7 @@ OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, do { UINT32 reqdArraySize; -nicArray = OvsAllocateMemory(arraySize); +nicArray = OvsAllocateMemoryWithTag(arraySize, + OVS_OID_POOL_TAG); if (!nicArray) { status = NDIS_STATUS_RESOURCES; goto done; @@ -852,7 +855,7 @@ OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, break; } -OvsFreeMemory(nicArray); +OvsFreeMemoryWithTag(nicArray, OVS_OID_POOL_TAG); arraySize = reqdArraySize; if (status != NDIS_STATUS_INVALID_LENGTH) { break; @@ -863,3 +866,17 @@ done: OVS_LOG_TRACE(Exit: status %8x., status); return status; } + +VOID OvsFreeSwitchPortsArray
Re: [ovs-dev] [PATCH 01/11] datapath-windows: Support for allocating/releasing memory with tag
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 01/11] datapath-windows: Support for allocating/releasing memory with tag Added functions for allocating and releasing memory with specified tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=iiMwE46zODzOOZShsrIWxf9yaByBOWDSCc0ipPeRGNEs=y-EsykCkI02UvBkUz93hyEZlqpJKnek7iW26IstuqK0e= --- datapath-windows/ovsext/Util.c | 15 +++ datapath-windows/ovsext/Util.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/datapath-windows/ovsext/Util.c b/datapath-windows/ovsext/Util.c index 2dfba8e..65dd132 100644 --- a/datapath-windows/ovsext/Util.c +++ b/datapath-windows/ovsext/Util.c @@ -24,6 +24,21 @@ extern NDIS_HANDLE gOvsExtDriverHandle; +VOID* +OvsAllocateMemoryWithTag(size_t size, ULONG tag) { +OVS_VERIFY_IRQL_LE(DISPATCH_LEVEL); +return NdisAllocateMemoryWithTagPriority(gOvsExtDriverHandle, +(UINT32)size, tag, NormalPoolPriority); } + +VOID +OvsFreeMemoryWithTag(VOID *ptr, ULONG tag) { +ASSERT(ptr); +NdisFreeMemoryWithTagPriority(gOvsExtDriverHandle, ptr, tag); } + VOID * OvsAllocateMemory(size_t size) { diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index e752209..0303f46 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -25,8 +25,10 @@ #define OVS_OTHER_POOL_TAG 'MSVO' VOID *OvsAllocateMemory(size_t size); +VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); VOID *OvsAllocateAlignedMemory(size_t size, UINT16 align); VOID OvsFreeMemory(VOID *ptr); +VOID OvsFreeMemoryWithTag(VOID *ptr, ULONG tag); VOID OvsFreeAlignedMemory(VOID *ptr); #define LIST_FORALL(_headPtr, _itemPtr) \ -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=iiMwE46zODzOOZShsrIWxf9yaByBOWDSCc0ipPeRGNEs=VSyJYABI0h0fPUGH2BAojznY4kw8yJgEmhTxtzHeLJMe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 04/11] datapath-windows: Added specific pool tag for event code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 04/11] datapath-windows: Added specific pool tag for event code All memory allocations within event code have 'ESVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=6Gb5VwwMRFwFfedKK4urpaqWEAnbw1nMYSGGBHiupaYs=xAwytzEw4DMilFMr41BPZ_MP9GiVW0BtFBNK-Lev0b4e= --- datapath-windows/ovsext/Event.c | 18 ++ datapath-windows/ovsext/Util.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/datapath-windows/ovsext/Event.c b/datapath-windows/ovsext/Event.c index 00f4616..cca9575 100644 --- a/datapath-windows/ovsext/Event.c +++ b/datapath-windows/ovsext/Event.c @@ -96,9 +96,9 @@ OvsCleanupEvent(POVS_OPEN_INSTANCE instance) LIST_FORALL_SAFE(queue-elemList, link, next) { elem = CONTAINING_RECORD(link, OVS_EVENT_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); } -OvsFreeMemory(queue); +OvsFreeMemoryWithTag(queue, OVS_EVENT_POOL_TAG); } } @@ -139,7 +139,8 @@ OvsPostEvent(UINT32 portNo, portNo == OVS_DEFAULT_PORT_NO) { queue-pollAll = TRUE; } else { -elem = (POVS_EVENT_QUEUE_ELEM)OvsAllocateMemory(sizeof(*elem)); +elem = (POVS_EVENT_QUEUE_ELEM)OvsAllocateMemoryWithTag( +sizeof(*elem), OVS_EVENT_POOL_TAG); if (elem == NULL) { queue-pollAll = TRUE; } else { @@ -158,7 +159,7 @@ OvsPostEvent(UINT32 portNo, LIST_FORALL_SAFE(queue-elemList, curr, next) { RemoveEntryList(curr); elem = CONTAINING_RECORD(curr, OVS_EVENT_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); } queue-numElems = 0; } @@ -243,7 +244,8 @@ OvsSubscribeEventIoctl(PFILE_OBJECT fileObject, } if (request-subscribe) { -queue = (POVS_EVENT_QUEUE)OvsAllocateMemory(sizeof (OVS_EVENT_QUEUE)); +queue = (POVS_EVENT_QUEUE)OvsAllocateMemoryWithTag( +sizeof(OVS_EVENT_QUEUE), OVS_EVENT_POOL_TAG); if (queue == NULL) { status = STATUS_NO_MEMORY; OVS_LOG_WARN(Fail to allocate event queue); @@ -284,9 +286,9 @@ done_event_subscribe: } LIST_FORALL_SAFE(queue-elemList, link, next) { elem = CONTAINING_RECORD(link, OVS_EVENT_QUEUE_ELEM, link); -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); } -OvsFreeMemory(queue); +OvsFreeMemoryWithTag(queue, OVS_EVENT_POOL_TAG); } else { OvsReleaseEventQueueLock(); } @@ -446,7 +448,7 @@ OvsRemoveEventEntry(POVS_OPEN_INSTANCE instance, elem = (POVS_EVENT_QUEUE_ELEM)RemoveHeadList(queue-elemList); entry-portNo = elem-portNo; entry-status = elem-status; -OvsFreeMemory(elem); +OvsFreeMemoryWithTag(elem, OVS_EVENT_POOL_TAG); queue-numElems--; status = STATUS_SUCCESS; } diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 6a9c169..7811288 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -25,6 +25,7 @@ #define OVS_OTHER_POOL_TAG 'MSVO' #define OVS_MDL_POOL_TAG'BSVO' #define OVS_DATAPATH_POOL_TAG 'DSVO' +#define OVS_EVENT_POOL_TAG 'ESVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=6Gb5VwwMRFwFfedKK4urpaqWEAnbw1nMYSGGBHiupaYs=Y7bHH0cVHbhX-ZoGJwNH3z83HqkXVJhUJUQ9ZoOo4Cge= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 09/11] datapath-windows: Added specific pool tag for switch code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 09/11] datapath-windows: Added specific pool tag for switch code All memory allocations within switch code have 'SSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=W0_d9rMWpp0MtU-vOBgF_wnxPFPQj235wBoskWDsrWws=tITgO0DRBiI7OFICgSVEdreSYadm0PhtWdDcpEhDopce= --- datapath-windows/ovsext/Switch.c | 53 +++- datapath-windows/ovsext/Util.h | 1 + 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index a228d8e..61a4531 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -168,8 +168,8 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, OVS_LOG_TRACE(Enter: Create switch object); -switchContext = -(POVS_SWITCH_CONTEXT) OvsAllocateMemory(sizeof(OVS_SWITCH_CONTEXT)); +switchContext = (POVS_SWITCH_CONTEXT) OvsAllocateMemoryWithTag( +sizeof(OVS_SWITCH_CONTEXT), OVS_SWITCH_POOL_TAG); if (switchContext == NULL) { status = NDIS_STATUS_RESOURCES; goto create_switch_done; @@ -187,7 +187,7 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, if (status != NDIS_STATUS_SUCCESS) { OVS_LOG_ERROR(OvsExtAttach: Extension is running in non-switch environment.); -OvsFreeMemory(switchContext); +OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); goto create_switch_done; } @@ -198,14 +198,14 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, status = OvsInitSwitchContext(switchContext); if (status != NDIS_STATUS_SUCCESS) { -OvsFreeMemory(switchContext); +OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); goto create_switch_done; } status = OvsTunnelFilterInitialize(gOvsExtDriverObject); if (status != NDIS_STATUS_SUCCESS) { OvsUninitSwitchContext(switchContext); -OvsFreeMemory(switchContext); +OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); goto create_switch_done; } *switchContextOut = switchContext; @@ -264,7 +264,7 @@ OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) OvsTunnelFilterUninitialize(gOvsExtDriverObject); OvsClearAllSwitchVports(switchContext); OvsUninitSwitchContext(switchContext); -OvsFreeMemory(switchContext); +OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); } OVS_LOG_TRACE(Exit: deleted switch %p dpNo: %d, switchContext, dpNo); } @@ -358,14 +358,14 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext-dispatchLock = NdisAllocateRWLock(switchContext-NdisFilterHandle); -switchContext-portNoHashArray = (PLIST_ENTRY) -OvsAllocateMemory(sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE); -switchContext-ovsPortNameHashArray = (PLIST_ENTRY) -OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE); -switchContext-portIdHashArray= (PLIST_ENTRY) -OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE); -switchContext-pidHashArray = (PLIST_ENTRY) -OvsAllocateMemory(sizeof(LIST_ENTRY) * OVS_MAX_PID_ARRAY_SIZE); +switchContext-portNoHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( +sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); +switchContext-ovsPortNameHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( +sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); +switchContext-portIdHashArray= (PLIST_ENTRY)OvsAllocateMemoryWithTag( +sizeof(LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE, OVS_SWITCH_POOL_TAG); +switchContext-pidHashArray = (PLIST_ENTRY)OvsAllocateMemoryWithTag( +sizeof(LIST_ENTRY) * OVS_MAX_PID_ARRAY_SIZE, + OVS_SWITCH_POOL_TAG); status = OvsAllocateFlowTable(switchContext-datapath, switchContext); if (status == NDIS_STATUS_SUCCESS) { @@ -381,17 +381,20 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) NdisFreeRWLock(switchContext-dispatchLock); } if (switchContext-portNoHashArray) { -OvsFreeMemory(switchContext-portNoHashArray); +OvsFreeMemoryWithTag(switchContext-portNoHashArray, + OVS_SWITCH_POOL_TAG); } if (switchContext-ovsPortNameHashArray) { -OvsFreeMemory(switchContext-ovsPortNameHashArray
Re: [ovs-dev] [PATCH 11/11] datapath-windows: Added specific pool tag for vport code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 11/11] datapath-windows: Added specific pool tag for vport code All memory allocations within vport code have 'PSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=b1xAj6ZEHsXvzzx0ZlDUIGvDt0cjUMsSy8CKK0QRbTos=ZdMEPrK8nOi1frMSHgKkOSuttJG6-NsOHjVLV0XMA4we= --- datapath-windows/ovsext/Util.h | 1 + datapath-windows/ovsext/Vport.c | 31 --- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index a8eed91..9a01242 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -32,6 +32,7 @@ #define OVS_OID_POOL_TAG'ASVO' #define OVS_SWITCH_POOL_TAG 'SSVO' #define OVS_USER_POOL_TAG 'USVO' +#define OVS_VPORT_POOL_TAG 'PSVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index c9dfaea..12751be 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -306,7 +306,7 @@ HvCreateNic(POVS_SWITCH_CONTEXT switchContext, OvsInitPhysNicVport(vport, virtExtVport, nicParam-NicIndex); status = InitHvVportCommon(switchContext, vport, TRUE); if (status != NDIS_STATUS_SUCCESS) { -OvsFreeMemory(vport); +OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); goto add_nic_done; } } @@ -658,7 +658,7 @@ OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, SIZE_T wstrSize = length * sizeof(WCHAR); UINT i; -PWSTR wsName = OvsAllocateMemory(wstrSize); +PWSTR wsName = OvsAllocateMemoryWithTag(wstrSize, + OVS_VPORT_POOL_TAG); if (!wsName) { return NULL; } @@ -666,7 +666,7 @@ OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, wsName[i] = name[i]; } vport = OvsFindVportByHvNameW(switchContext, wsName, wstrSize); -OvsFreeMemory(wsName); +OvsFreeMemoryWithTag(wsName, OVS_VPORT_POOL_TAG); return vport; } @@ -703,7 +703,8 @@ POVS_VPORT_ENTRY OvsAllocateVport(VOID) { POVS_VPORT_ENTRY vport; -vport = (POVS_VPORT_ENTRY)OvsAllocateMemory(sizeof (OVS_VPORT_ENTRY)); +vport = (POVS_VPORT_ENTRY)OvsAllocateMemoryWithTag( +sizeof(OVS_VPORT_ENTRY), OVS_VPORT_POOL_TAG); if (vport == NULL) { return NULL; } @@ -1073,7 +1074,7 @@ OvsRemoveAndDeleteVport(POVS_SWITCH_CONTEXT switchContext, ASSERT(switchContext-numPhysicalNics == 0); switchContext-virtualExternalPortId = 0; switchContext-virtualExternalVport = NULL; -OvsFreeMemory(vport); +OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); if (vportDeallocated) { *vportDeallocated = TRUE; } @@ -1151,7 +1152,7 @@ OvsRemoveAndDeleteVport(POVS_SWITCH_CONTEXT switchContext, } else { switchContext-numNonHvVports--; } -OvsFreeMemory(vport); +OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); if (vportDeallocated) { *vportDeallocated = TRUE; } @@ -1189,19 +1190,20 @@ OvsAddConfiguredSwitchPorts(POVS_SWITCH_CONTEXT switchContext) OvsInitVportWithPortParam(vport, portParam); status = InitHvVportCommon(switchContext, vport, TRUE); if (status != NDIS_STATUS_SUCCESS) { - OvsFreeMemory(vport); + OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); goto cleanup; } } + cleanup: if (status != NDIS_STATUS_SUCCESS) { OvsClearAllSwitchVports(switchContext); } -if (portArray != NULL) { -OvsFreeMemory(portArray); -} +OvsFreeSwitchPortsArray(portArray); + OVS_LOG_TRACE(Exit: status: %x, status); + return status; } @@ -1248,7 +1250,7 @@ OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext) nicParam-NicIndex); status = InitHvVportCommon(switchContext, vport, TRUE); if (status != NDIS_STATUS_SUCCESS) { -OvsFreeMemory(vport); +OvsFreeMemoryWithTag(vport, OVS_VPORT_POOL_TAG); vport = NULL; } } @@ -1268,9 +1270,8 @@ OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext
Re: [ovs-dev] [PATCH 0/11] datapath-windows: Created multiple tags for memory pools
Just fyi, memory leaks can be detected when Verifier is installed. The system would Bugcheck and the stack could be examined. But, it is still useful to have different tags for different memory allocations. Thanks Sorin. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 0/11] datapath-windows: Created multiple tags for memory pools This patch series adds support for multiple memory pool tags for OVS extension. Sorin Vinturis (11): [PATCH 01/11] datapath-windows: Support for allocating/releasing [PATCH 02/11] datapath-windows: Added specific pool tag for datapath code [PATCH 03/11] datapath-windows: Added specific pool tag for buffermgmt code [PATCH 04/11] datapath-windows: Added specific pool tag for event code [PATCH 05/11] datapath-windows: Added specific pool tag for flow code [PATCH 06/11] datapath-windows: Added specific pool tag for vxlan code [PATCH 07/11] datapath-windows: Added specific pool tag for iphelper code [PATCH 08/11] datapath-windows: Added specific pool tag for oid code [PATCH 09/11] datapath-windows: Added specific pool tag for switch code [PATCH 10/11] datapath-windows: Added specific pool tag for user code [PATCH 11/11] datapath-windows: Added specific pool tag for vport code Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=fjpaEkAVy-i-Q4snTVJPySG-gFvJHelrwgIrxhC35xYs=w2tyno-srOue5Qhi6H2R9Sw1mQ-uXE3ffnqiW1C834oe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 07/11] datapath-windows: Added specific pool tag for iphelper code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 07/11] datapath-windows: Added specific pool tag for iphelper code All memory allocations within iphelper code have 'HSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=mynH1qoskm_UUJgHQKINg-7UcfKnF8Ufv72fECx0t_4s=WYhs4tALpBZ2RGUFOXJkZCaddy0XvDFzGYmRHrc1CsMe= --- datapath-windows/ovsext/IpHelper.c | 75 +- datapath-windows/ovsext/Util.h | 1 + 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/datapath-windows/ovsext/IpHelper.c b/datapath-windows/ovsext/IpHelper.c index 0c64be4..f3e9658 100644 --- a/datapath-windows/ovsext/IpHelper.c +++ b/datapath-windows/ovsext/IpHelper.c @@ -14,6 +14,11 @@ * limitations under the License. */ +#ifdef OVS_MEMORY_TAG +#undef OVS_MEMORY_TAG +#endif +#define OVS_IPHELPER_POOL_TAG 'HSVO' + #include precomp.h #include IpHelper.h #include Switch.h @@ -777,7 +782,8 @@ OvsCreateIPNeighEntry(PMIB_IPNET_ROW2 ipNeigh) UINT64 timeVal; ASSERT(ipNeigh != NULL); -entry = (POVS_IPNEIGH_ENTRY)OvsAllocateMemory(sizeof (OVS_IPNEIGH_ENTRY)); +entry = (POVS_IPNEIGH_ENTRY)OvsAllocateMemoryWithTag( +sizeof(OVS_IPNEIGH_ENTRY), OVS_IPHELPER_POOL_TAG); if (entry == NULL) { return NULL; } @@ -802,8 +808,8 @@ OvsCreateIPForwardEntry(PMIB_IPFORWARD_ROW2 ipRoute) ASSERT(ipRoute); -entry = - (POVS_IPFORWARD_ENTRY)OvsAllocateMemory(sizeof (OVS_IPFORWARD_ENTRY)); +entry = (POVS_IPFORWARD_ENTRY)OvsAllocateMemoryWithTag( +sizeof(OVS_IPFORWARD_ENTRY), OVS_IPHELPER_POOL_TAG); if (entry == NULL) { return NULL; } @@ -823,7 +829,8 @@ OvsCreateFwdEntry(POVS_FWD_INFO fwdInfo) { POVS_FWD_ENTRY entry; -entry = (POVS_FWD_ENTRY)OvsAllocateMemory(sizeof (OVS_FWD_ENTRY)); +entry = (POVS_FWD_ENTRY)OvsAllocateMemoryWithTag( +sizeof(OVS_FWD_ENTRY), OVS_IPHELPER_POOL_TAG); if (entry == NULL) { return NULL; } @@ -855,7 +862,7 @@ OvsRemoveFwdEntry(POVS_FWD_ENTRY fwdEntry) if (ipf-refCount == 0) { ASSERT(IsListEmpty(ipf-fwdList)); RemoveEntryList(ipf-link); -OvsFreeMemory(ipf); +OvsFreeMemoryWithTag(ipf, OVS_IPHELPER_POOL_TAG); } if (ipn-refCount == 0) { @@ -864,10 +871,10 @@ OvsRemoveFwdEntry(POVS_FWD_ENTRY fwdEntry) NdisAcquireSpinLock(ovsIpHelperLock); RemoveEntryList(ipn-slink); NdisReleaseSpinLock(ovsIpHelperLock); -OvsFreeMemory(ipn); +OvsFreeMemoryWithTag(ipn, OVS_IPHELPER_POOL_TAG); } -OvsFreeMemory(fwdEntry); +OvsFreeMemoryWithTag(fwdEntry, OVS_IPHELPER_POOL_TAG); } @@ -886,7 +893,7 @@ OvsRemoveIPForwardEntry(POVS_IPFORWARD_ENTRY ipf) ASSERT(ipf-refCount == 1); RemoveEntryList(ipf-link); -OvsFreeMemory(ipf); +OvsFreeMemoryWithTag(ipf, OVS_IPHELPER_POOL_TAG); } @@ -908,7 +915,7 @@ OvsRemoveIPNeighEntry(POVS_IPNEIGH_ENTRY ipn) NdisAcquireSpinLock(ovsIpHelperLock); RemoveEntryList(ipn-slink); NdisReleaseSpinLock(ovsIpHelperLock); -OvsFreeMemory(ipn); +OvsFreeMemoryWithTag(ipn, OVS_IPHELPER_POOL_TAG); } } @@ -1041,7 +1048,7 @@ OvsCleanupIpHelperRequestList(VOID) STATUS_DEVICE_NOT_READY, NULL); } -OvsFreeMemory(request); +OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); } } @@ -1076,8 +1083,8 @@ OvsInternalAdapterUp(UINT32 portNo, RtlCopyMemory(ovsInternalNetCfgId, netCfgInstanceId, sizeof (GUID)); RtlZeroMemory(ovsInternalRow, sizeof (MIB_IF_ROW2)); -request = - (POVS_IP_HELPER_REQUEST)OvsAllocateMemory(sizeof (OVS_IP_HELPER_REQUEST)); +request = (POVS_IP_HELPER_REQUEST)OvsAllocateMemoryWithTag( +sizeof(OVS_IP_HELPER_REQUEST), OVS_IPHELPER_POOL_TAG); if (request == NULL) { OVS_LOG_ERROR(Fail to initialize Internal Adapter); return; @@ -1103,7 +1110,7 @@ OvsHandleInternalAdapterUp(POVS_IP_HELPER_REQUEST request) MIB_UNICASTIPADDRESS_ROW ipEntry; GUID *netCfgInstanceId = ovsInternalNetCfgId; -OvsFreeMemory(request); +OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); status = OvsGetIfEntry(ovsInternalNetCfgId, ovsInternalRow); @@ -1161,7 +1168,7 @@ OvsEnqueueIpHelperRequest(POVS_IP_HELPER_REQUEST request) if (ovsInternalPortNo == OVS_DEFAULT_PORT_NO || ovsInternalIPConfigured == FALSE
Re: [ovs-dev] [PATCH 05/11] datapath-windows: Added specific pool tag for flow code
Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, March 25, 2015 1:14 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 05/11] datapath-windows: Added specific pool tag for flow code All memory allocations within flow code have 'LSVO' pool tag. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_56d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=iipaKZG9kjHd2qkNoo44q-ZVMb7RcJZlg8gJxrOVcPks=ycyG9BI8rKzkpCXyIThfDMW7j6Td_BoIEizTO49styQe= --- datapath-windows/ovsext/Flow.c | 11 ++- datapath-windows/ovsext/Util.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index d3de8cc..97220b4 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -1512,7 +1512,7 @@ OvsDeleteFlowTable(OVS_DATAPATH *datapath) } DeleteAllFlows(datapath); -OvsFreeMemory(datapath-flowTable); +OvsFreeMemoryWithTag(datapath-flowTable, OVS_FLOW_POOL_TAG); datapath-flowTable = NULL; NdisFreeRWLock(datapath-lock); @@ -1534,8 +1534,8 @@ OvsAllocateFlowTable(OVS_DATAPATH *datapath, PLIST_ENTRY bucket; int i; -datapath-flowTable = OvsAllocateMemory(OVS_FLOW_TABLE_SIZE * -sizeof (LIST_ENTRY)); +datapath-flowTable = OvsAllocateMemoryWithTag( +OVS_FLOW_TABLE_SIZE * sizeof(LIST_ENTRY), OVS_FLOW_POOL_TAG); if (!datapath-flowTable) { return NDIS_STATUS_RESOURCES; } @@ -1976,7 +1976,7 @@ VOID FreeFlow(OvsFlow *flow) { ASSERT(flow); -OvsFreeMemory(flow); +OvsFreeMemoryWithTag(flow, OVS_FLOW_POOL_TAG); } NTSTATUS @@ -2259,7 +2259,8 @@ OvsPrepareFlow(OvsFlow **flow, do { *flow = localFlow = -OvsAllocateMemory(sizeof(OvsFlow) + put-actionsLen); +OvsAllocateMemoryWithTag(sizeof(OvsFlow) + put-actionsLen, + OVS_FLOW_POOL_TAG); if (localFlow == NULL) { status = STATUS_NO_MEMORY; break; diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 7811288..907cd3c 100644 --- a/datapath-windows/ovsext/Util.h +++ b/datapath-windows/ovsext/Util.h @@ -26,6 +26,7 @@ #define OVS_MDL_POOL_TAG'BSVO' #define OVS_DATAPATH_POOL_TAG 'DSVO' #define OVS_EVENT_POOL_TAG 'ESVO' +#define OVS_FLOW_POOL_TAG 'LSVO' VOID *OvsAllocateMemory(size_t size); VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag); -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=iipaKZG9kjHd2qkNoo44q-ZVMb7RcJZlg8gJxrOVcPks=DLuBxSaXBI450vCDtn3ZzfmOso1IDrrcGBsEazM3l2Ue= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling
Acked-by: Eitan Eliahu elia...@vmware.com Thanks Sorin. Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Tuesday, March 24, 2015 12:29 AM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Eitan, The BFE is not started when the machine is booted and OVS driver is initialized. This happens all the time. Due to this, the WFP system provider is not added. When the OS is started and the userspace tools are executed the BFE is running and all WFP objects are correctly added. At this point, if the commands 'net stop ovsext' + 'net start ovsext' are executed all OVS initializations are successfully performed, including the addition of the WFP system provider. So this patch is trying to address the scenario when the WFP system provider addition is performed at boot time. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Tuesday, 24 March, 2015 06:37 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Thanks Sorin, What would be the case where BFE is not started before the driver initializes? When BFE is not started does the driver continue with WFP rule setiings? Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, March 23, 2015 4:40 PM To: Sorin Vinturis; Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling As I explained in the patch description, I have added this change because, at driver initialization phase, the system provider failed to be added due to the fact that the Base Filtering Engine (BFE) is not started and no session to the engine could be acquired, i.e. OvsTunnelEngineOpen() fails. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Tuesday, 24 March, 2015 01:01 To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Eitan, In this case the second call will enter this code path: status = FwpmProviderAdd(handle, provider, NULL); if (!NT_SUCCESS(status)) { -OVS_LOG_ERROR(Fail to add WFP provider, status: %x., status); -break; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP provider, status: %x., + status); +break; +} } Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Monday, 23 March, 2015 18:13 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Sorin, Ok on [1]. Thanks. On [2], I can see a scenario when the provider can added twice from OvsRegisterSystemProvider() as well as from the callback if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) { Callback is called from a different thread context ! OvsTunnelEngineOpen(handle); How do you prevent it? Also, can you please explain which issue you ran into which triggered this change? Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, March 23, 2015 1:37 AM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Eitan, Thanks for reviewing my patch. [1] The OvsTunnelEngineClose(HANDLE *handle) is verifying the handle it receives before closing it. [2] In order to retrieve the current state of the filter engine I am using the FwpmBfeStateGet function. But before calling FwpmBfeStateGet, the callout driver MUST call the FwpmBfeStateSubscribeChanges function. That is the reason I am registering the callback no mater of the state of the filter engine. Only if the engine is running the provider is added by opening the engine handle first and closing it after the provider is added, then unsubscribes the callback. If the engine is not running the callback is called and the provider is added only for the service running notification. Hope this answers your comments. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Monday, 23 March, 2015 02:32 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Sorin, Thank you for posting this change. Here are few comments: [1] Please call OvsTunnelEngineClose(handle) only if the handle is not zero. (you might want to add an assertion if it zero
Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling
Sorin, Ok on [1]. Thanks. On [2], I can see a scenario when the provider can added twice from OvsRegisterSystemProvider() as well as from the callback if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) { Callback is called from a different thread context ! OvsTunnelEngineOpen(handle); How do you prevent it? Also, can you please explain which issue you ran into which triggered this change? Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, March 23, 2015 1:37 AM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Eitan, Thanks for reviewing my patch. [1] The OvsTunnelEngineClose(HANDLE *handle) is verifying the handle it receives before closing it. [2] In order to retrieve the current state of the filter engine I am using the FwpmBfeStateGet function. But before calling FwpmBfeStateGet, the callout driver MUST call the FwpmBfeStateSubscribeChanges function. That is the reason I am registering the callback no mater of the state of the filter engine. Only if the engine is running the provider is added by opening the engine handle first and closing it after the provider is added, then unsubscribes the callback. If the engine is not running the callback is called and the provider is added only for the service running notification. Hope this answers your comments. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Monday, 23 March, 2015 02:32 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Sorin, Thank you for posting this change. Here are few comments: [1] Please call OvsTunnelEngineClose(handle) only if the handle is not zero. (you might want to add an assertion if it zero). [2] I'm somewhat confused about the registration for engine state change. As I understand you check the state of the engine and if it is running you open the engine handle (in the context of the foreground thread). However, you subscribe to state change anyway and you open the handle to the engine from the callback function too. Did I miss anything? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, 16 March, 2015 20:08 To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling If the Base Filtering Engine (BFE) is not started, the WFP system provider failed to be added because no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the WFP system provider is added. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_65d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=MVriWGIsZGTQ5f_haLS0X5H8R3YdfikbqnWKRpKksKUs=1iWqFul95i3o_mD41jKjZNdLnK-df_QWRzSY1614RTwe= --- datapath-windows/ovsext/Datapath.c | 20 ++- datapath-windows/ovsext/TunnelFilter.c | 99 -- datapath-windows/ovsext/TunnelIntf.h | 8 +-- 3 files changed, 100 insertions(+), 27 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f1..c6fe89e 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -353,35 +353,19 @@ PNDIS_SPIN_LOCK gOvsCtrlLock; VOID OvsInit() { -HANDLE handle = NULL; - gOvsCtrlLock = ovsCtrlLockObj; NdisAllocateSpinLock(gOvsCtrlLock); OvsInitEventQueue(); - -OvsTunnelEngineOpen(handle); -if (handle) { -OvsTunnelAddSystemProvider(handle); -} -OvsTunnelEngineClose(handle); } VOID OvsCleanup() { -HANDLE handle = NULL; - OvsCleanupEventQueue(); if (gOvsCtrlLock) { NdisFreeSpinLock(gOvsCtrlLock); gOvsCtrlLock = NULL; } - -OvsTunnelEngineOpen(handle); -if (handle) { -OvsTunnelRemoveSystemProvider(handle); -} -OvsTunnelEngineClose(handle); } VOID @@ -448,6 +432,8 @@ OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle) if (ovsExt) { ovsExt-numberOpenInstance = 0; } +} else { +OvsRegisterSystemProvider((PVOID)gOvsDeviceObject); } OVS_LOG_TRACE(DeviceObject: %p, gOvsDeviceObject); @@ -471,6 +457,8 @@ OvsDeleteDeviceObject() NdisDeregisterDeviceEx(gOvsDeviceHandle); gOvsDeviceHandle = NULL; gOvsDeviceObject = NULL
Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling
Thanks Sorin, What would be the case where BFE is not started before the driver initializes? When BFE is not started does the driver continue with WFP rule setiings? Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, March 23, 2015 4:40 PM To: Sorin Vinturis; Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling As I explained in the patch description, I have added this change because, at driver initialization phase, the system provider failed to be added due to the fact that the Base Filtering Engine (BFE) is not started and no session to the engine could be acquired, i.e. OvsTunnelEngineOpen() fails. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Tuesday, 24 March, 2015 01:01 To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Eitan, In this case the second call will enter this code path: status = FwpmProviderAdd(handle, provider, NULL); if (!NT_SUCCESS(status)) { -OVS_LOG_ERROR(Fail to add WFP provider, status: %x., status); -break; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP provider, status: %x., + status); +break; +} } Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Monday, 23 March, 2015 18:13 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Sorin, Ok on [1]. Thanks. On [2], I can see a scenario when the provider can added twice from OvsRegisterSystemProvider() as well as from the callback if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) { Callback is called from a different thread context ! OvsTunnelEngineOpen(handle); How do you prevent it? Also, can you please explain which issue you ran into which triggered this change? Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, March 23, 2015 1:37 AM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Eitan, Thanks for reviewing my patch. [1] The OvsTunnelEngineClose(HANDLE *handle) is verifying the handle it receives before closing it. [2] In order to retrieve the current state of the filter engine I am using the FwpmBfeStateGet function. But before calling FwpmBfeStateGet, the callout driver MUST call the FwpmBfeStateSubscribeChanges function. That is the reason I am registering the callback no mater of the state of the filter engine. Only if the engine is running the provider is added by opening the engine handle first and closing it after the provider is added, then unsubscribes the callback. If the engine is not running the callback is called and the provider is added only for the service running notification. Hope this answers your comments. Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Monday, 23 March, 2015 02:32 To: Sorin Vinturis Cc: dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling Hi Sorin, Thank you for posting this change. Here are few comments: [1] Please call OvsTunnelEngineClose(handle) only if the handle is not zero. (you might want to add an assertion if it zero). [2] I'm somewhat confused about the registration for engine state change. As I understand you check the state of the engine and if it is running you open the engine handle (in the context of the foreground thread). However, you subscribe to state change anyway and you open the handle to the engine from the callback function too. Did I miss anything? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, 16 March, 2015 20:08 To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling If the Base Filtering Engine (BFE) is not started, the WFP system provider failed to be added because no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the WFP system provider is added. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url
Re: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling
Hi Sorin, Thank you for posting this change. Here are few comments: [1] Please call OvsTunnelEngineClose(handle) only if the handle is not zero. (you might want to add an assertion if it zero). [2] I'm somewhat confused about the registration for engine state change. As I understand you check the state of the engine and if it is running you open the engine handle (in the context of the foreground thread). However, you subscribe to state change anyway and you open the handle to the engine from the callback function too. Did I miss anything? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, 16 March, 2015 20:08 To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Updated WFP system provider handling If the Base Filtering Engine (BFE) is not started, the WFP system provider failed to be added because no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the WFP system provider is added. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_65d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=MVriWGIsZGTQ5f_haLS0X5H8R3YdfikbqnWKRpKksKUs=1iWqFul95i3o_mD41jKjZNdLnK-df_QWRzSY1614RTwe= --- datapath-windows/ovsext/Datapath.c | 20 ++- datapath-windows/ovsext/TunnelFilter.c | 99 -- datapath-windows/ovsext/TunnelIntf.h | 8 +-- 3 files changed, 100 insertions(+), 27 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f1..c6fe89e 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -353,35 +353,19 @@ PNDIS_SPIN_LOCK gOvsCtrlLock; VOID OvsInit() { -HANDLE handle = NULL; - gOvsCtrlLock = ovsCtrlLockObj; NdisAllocateSpinLock(gOvsCtrlLock); OvsInitEventQueue(); - -OvsTunnelEngineOpen(handle); -if (handle) { -OvsTunnelAddSystemProvider(handle); -} -OvsTunnelEngineClose(handle); } VOID OvsCleanup() { -HANDLE handle = NULL; - OvsCleanupEventQueue(); if (gOvsCtrlLock) { NdisFreeSpinLock(gOvsCtrlLock); gOvsCtrlLock = NULL; } - -OvsTunnelEngineOpen(handle); -if (handle) { -OvsTunnelRemoveSystemProvider(handle); -} -OvsTunnelEngineClose(handle); } VOID @@ -448,6 +432,8 @@ OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle) if (ovsExt) { ovsExt-numberOpenInstance = 0; } +} else { +OvsRegisterSystemProvider((PVOID)gOvsDeviceObject); } OVS_LOG_TRACE(DeviceObject: %p, gOvsDeviceObject); @@ -471,6 +457,8 @@ OvsDeleteDeviceObject() NdisDeregisterDeviceEx(gOvsDeviceHandle); gOvsDeviceHandle = NULL; gOvsDeviceObject = NULL; + +OvsUnregisterSystemProvider(); } } diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index e0adc37..4b879c0 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -111,6 +111,7 @@ DEFINE_GUID( PDEVICE_OBJECT gDeviceObject; HANDLE gEngineHandle = NULL; +HANDLE gBfeSubscriptionHandle = NULL; UINT32 gCalloutIdV4; @@ -173,17 +174,20 @@ OvsTunnelAddSystemProvider(HANDLE handle) provider.displayData.name = OVS_TUNNEL_PROVIDER_NAME; provider.displayData.description = OVS_TUNNEL_PROVIDER_DESC; /* -* Since we always want the provider to be present, it's easiest to add -* it as persistent object during driver load. -*/ + * Since we always want the provider to be present, it's easiest to add + * it as persistent object during driver load. + */ provider.flags = FWPM_PROVIDER_FLAG_PERSISTENT; status = FwpmProviderAdd(handle, provider, NULL); if (!NT_SUCCESS(status)) { -OVS_LOG_ERROR(Fail to add WFP provider, status: %x., status); -break; +if (STATUS_FWP_ALREADY_EXISTS != status) { +OVS_LOG_ERROR(Failed to add WFP provider, status: %x., + status); +break; +} } status = FwpmTransactionCommit(handle); @@ -541,3 +545,88 @@ Exit: return status; } + +VOID NTAPI +OvsBfeStateChangeCallback(PVOID context, + FWPM_SERVICE_STATE bfeState) { +HANDLE handle = NULL;
Re: [ovs-dev] OVS Windows MSI installer
I think we can drop 32bit support once the 64bit is there. Thanks! Eitan -Original Message- From: Nithin Raju Sent: Monday, March 16, 2015 11:10 PM To: Alessandro Pilotti Cc: Eitan Eliahu; dev@openvswitch.org Subject: Re: [ovs-dev] OVS Windows MSI installer On Mar 15, 2015, at 7:54 PM, Alessandro Pilotti apilo...@cloudbasesolutions.com wrote: On 16 mar. 2015, at 03:30, Eitan Eliahu elia...@vmware.com wrote: Alessandro, Yes, no problem of having the installer separate. But, I am confused as I see the two services are there but the driver and the INF file are not. I believe that the MSI file includes everything. Do you think you can add the OS installer script? Will we have already built MSI file (x86 and x86-64)? We'll commit the x64 MSI build code as soon as we have the x64 OVS build merged upstream. One thing that we should decide is if it makes sense to keep a separate x86 build at all at that point. Since Hyper-V is limited to x64, the only use case for a x86 build is for a 32bit client OS build where a user wants to install the CLI tools only. Given how limited this use case is, I'd go with a single x64 build. This is fine. If the x64 binaries can be built reliably and pass the tests, I think we can flip the switch on the default “mode” and just go with x64 binaries. I maybe wrong, but there’s no real usecase for 32 bit binaries on Hyper-V. -- Nithin ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] INSTALL.Windows.md: Mention the easy way to get into bash.
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Tuesday, March 17, 2015 3:31 PM To: dev@openvswitch.org Cc: Gurucharan Shetty; Hemanth Kumar Mantri Subject: [ovs-dev] [PATCH] INSTALL.Windows.md: Mention the easy way to get into bash. Just typing 'bash' from MSVC developers command prompt _can_ cause MSYS to use the Windows version of 'sort' instead of the GNU sort. Reported-by: Hemanth Kumar Mantri man...@nutanix.com Signed-off-by: Gurucharan Shetty gshe...@nicira.com --- AUTHORS|1 + INSTALL.Windows.md |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index d7925db..008f6f1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -246,6 +246,7 @@ Gur Stavi gst...@mrv.com Hari Sasank Bhamidipalli hbham...@cisco.com Hassan Khan hassan.k...@seecs.edu.pk Hector Oron hector.o...@gmail.com +Hemanth Kumar Mantriman...@nutanix.com Henrik Amrenhen...@nicira.com Hiroshi Tanaka htan...@nicira.com Hiroshi Miyata miyahiro.d...@gmail.com diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md index 258e2fb..e84013a 100644 --- a/INSTALL.Windows.md +++ b/INSTALL.Windows.md @@ -35,11 +35,13 @@ install Windows Driver Kit (WDK) 8.1 Update. It is important to get the Visual Studio related environment variables and to have the $PATH inside the bash to point to the proper compiler and linker. One easy way to achieve this is to get into the Developer Command prompt for visual -studio and through it enter into the bash shell available from msys. +studio and through it enter into the bash shell available from msys by +typing 'bash --login'. If after the above step, a 'which link' inside MSYS's bash says, /bin/link.exe, rename /bin/link.exe to something else so that the -Visual studio's linker is used. +Visual studio's linker is used. You should also see a 'which sort' +report /bin/sort.exe. * For pthread support, install the library, dll and includes of pthreads-win32 project from -- 1.7.9.5 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=FvYUU6lQk0zG7NvgUA9l1JyOC00f4vxHTB9Q7eugHYAs=EqNY4ilrR619-1aWCH2-U0UXQx_lO3UlKNOr_nFxqRAe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] OVS Windows MSI installer
I don't have a strong opinion but once the installer is included in the OVS tree all directory structure is fixed so there is no ambiguity on how or where the installer collects the files. It will also avoid having more than one copy of the same file. It would be nice also if the installer and the MSI file generated by the installer could be built as part of OVS user mode. That said, the MSI file itself should be available to users w/o the need to build anything and would be related to an OVS release. We need get the driver signed and officially pass WHQL (We can discuss it later). Thanks, Eitan. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Ben Pfaff Sent: Tuesday, March 17, 2015 8:26 AM To: Nithin Raju Cc: dev@openvswitch.org Subject: Re: [ovs-dev] OVS Windows MSI installer On Tue, Mar 17, 2015 at 06:06:47AM +, Nithin Raju wrote: Regarding where the installer code should be located, my vote would be to keep this within the OVS repo. A good reason to keep it outside is if this code gets reused for installing or packaging non-OVS executables. At the Openstack summit we had discussed that the Cloudbase Neutron plugin installer can also install OVS in the future. If we are talking of such an installer, then it makes sense to put it in a different repo. Since this installer is specific to OVS, I think we should keep it within the OVS repo. (I am probably restating what Ben already said). I'd like to merge it into the OVS tree, too, after looking at it. That way we don't start to splinter packaging off into other trees and make it more difficult for users to find a set of code that works well together. ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=aCQkLNl5h_C4Zsh3AoB2MbzKkws4kvcT99BiiUgzYHYs=qhwi87O8u3mnEl1sFfbCr2Gtbw4uYPN3tArQdqXiov0e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 3/3] netlink: support for asynchronous NL transactions
Hi Sorin, It would be probably better to make this call synchronous as the thread has nothing else to do. The WFP transaction in the driver is guaranteed to being completed so we should be ok here. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, March 12, 2015 5:43 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 3/3] netlink: support for asynchronous NL transactions Modified 'nl_sock_transact_multiple__' function to send asynchronous I/O requests to the kernel driver. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_64d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=mnPxbs5kxqNdJzi-qc-vofl6JQrEuyx3Tb5Uxj5l7YAs=vGvK7gc_nZkPLpeiZVXNdRHky8DjHd9aT46oNKn8lmIe= --- lib/netlink-socket.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index e4f153f..64f93ff 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -832,10 +832,28 @@ nl_sock_transact_multiple__(struct nl_sock *sock, ofpbuf_data(txn-request), ofpbuf_size(txn-request), reply_buf, sizeof reply_buf, - reply_len, NULL)) { -/* XXX: Map to a more appropriate error. */ -error = EINVAL; -break; + reply_len, sock-overlapped)) { +if (GetLastError() != ERROR_IO_PENDING) { +/* XXX: Map to a more appropriate error. */ +VLOG_DBG_RL(rl, nl_transact operation failed - %s, +ovs_strerror(error)); +error = EINVAL; +break; +} else { +/* Operation has been queued and will complete in the future. */ +/* Wait for the operation to complete before continuing. */ +if (!GetOverlappedResult(sock-handle, +sock-overlapped, +reply_len, +TRUE)) { +/* Operation has completed, but it failed. */ +/* XXX: Map to a more appropriate error. */ +VLOG_DBG_RL(rl, nl_transact asynchronous operation failed - %s, +ovs_strerror(error)); +error = EINVAL; +break; +} +} } if (reply_len sizeof *reply_nlmsg) { -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=mnPxbs5kxqNdJzi-qc-vofl6JQrEuyx3Tb5Uxj5l7YAs=Ea6-zNGdcWXl55yngXjvxDyuRn1v9WCsX8B3jJj5mtAe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2 2/3] datapath-windows: Support for multiple VXLAN tunnels
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, March 12, 2015 5:43 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2 2/3] datapath-windows: Support for multiple VXLAN tunnels At the moment the OVS extension supports only one VXLAN tunnel that is cached in the extension switch context. Replaced the latter cached pointer with an array list that contains all VXLAN tunnel vports. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_64d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=GmpbZWnQYzaDAxKvmJ05dBJ8JYOtGdxMBDiXWBzMytEs=IwHmCeVaHOwt0p6FccEexn_7ay5hwkPhDo4yRbp-cEke= --- datapath-windows/ovsext/Actions.c | 13 datapath-windows/ovsext/Switch.c | 16 ++- datapath-windows/ovsext/Switch.h | 6 -- datapath-windows/ovsext/Tunnel.c | 3 ++- datapath-windows/ovsext/Vport.c | 43 +++ datapath-windows/ovsext/Vport.h | 21 +-- datapath-windows/ovsext/Vxlan.c | 2 +- datapath-windows/ovsext/Vxlan.h | 4 +--- 8 files changed, 67 insertions(+), 41 deletions(-) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index a93fe03..79e464c 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -184,6 +184,9 @@ OvsInitForwardingCtx(OvsForwardingContext *ovsFwdCtx, } /* + * XXX: When we search for the tunnelVport we also need to specify the + * tunnelling protocol or the L4 protocol as key as well, because there + are + * different protocols that can use the same destination port. * -- * OvsDetectTunnelRxPkt -- * Utility function for an RX packet to detect its tunnel type. @@ -203,16 +206,17 @@ OvsDetectTunnelRxPkt(OvsForwardingContext *ovsFwdCtx, * packets only if they are at least VXLAN header size. */ if (!flowKey-ipKey.nwFrag -flowKey-ipKey.nwProto == IPPROTO_UDP -flowKey-ipKey.l4.tpDst == VXLAN_UDP_PORT_NBO) { -tunnelVport = ovsFwdCtx-switchContext-vxlanVport; -ovsActionStats.rxVxlan++; +flowKey-ipKey.nwProto == IPPROTO_UDP) { +UINT16 dstPort = htons(flowKey-ipKey.l4.tpDst); +tunnelVport = OvsFindTunnelVportByDstPort(ovsFwdCtx-switchContext, + dstPort); } // We might get tunnel packets even before the tunnel gets initialized. if (tunnelVport) { ASSERT(ovsFwdCtx-tunnelRxNic == NULL); ovsFwdCtx-tunnelRxNic = tunnelVport; +ovsActionStats.rxVxlan++; return TRUE; } @@ -1318,6 +1322,7 @@ OvsExecuteSetAction(OvsForwardingContext *ovsFwdCtx, status = OvsTunnelAttrToIPv4TunnelKey((PNL_ATTR)a, tunKey); ASSERT(status == NDIS_STATUS_SUCCESS); tunKey.flow_hash = (uint16)(hash ? *hash : OvsHashFlow(key)); +tunKey.dst_port = key-ipKey.l4.tpDst; RtlCopyMemory(ovsFwdCtx-tunKey, tunKey, sizeof ovsFwdCtx-tunKey); break; diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index cf5e3c4..665aff4 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -366,6 +366,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE); switchContext-pidHashArray = (PLIST_ENTRY) OvsAllocateMemory(sizeof(LIST_ENTRY) * OVS_MAX_PID_ARRAY_SIZE); +switchContext-tunnelVportsArray = (PLIST_ENTRY) +OvsAllocateMemory(sizeof(LIST_ENTRY) * + OVS_MAX_VPORT_ARRAY_SIZE); status = OvsAllocateFlowTable(switchContext-datapath, switchContext); if (status == NDIS_STATUS_SUCCESS) { @@ -376,7 +378,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext-portNoHashArray == NULL || switchContext-ovsPortNameHashArray == NULL || switchContext-portIdHashArray== NULL || -switchContext-pidHashArray == NULL) { +switchContext-pidHashArray == NULL || +switchContext-tunnelVportsArray == NULL) { if (switchContext-dispatchLock) { NdisFreeRWLock(switchContext-dispatchLock); } @@ -394,6 +397,10 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext) OvsFreeMemory(switchContext-pidHashArray); } +if (switchContext-tunnelVportsArray) { +OvsFreeMemory(switchContext-tunnelVportsArray); +} + OvsDeleteFlowTable(switchContext-datapath); OvsCleanupBufferPool(switchContext); @@ -403,12 +410,9
Re: [ovs-dev] OVS Windows MSI installer
Hi Alessandro, I couldn't find the driver binary as part of the installer. Also, can you explain how uninstlaation is done and the case where a driver is already loaded. Thank you! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alessandro Pilotti Sent: Sunday, March 15, 2015 5:33 PM To: dev@openvswitch.org Subject: [ovs-dev] OVS Windows MSI installer Hi guys, As discussed on IRC, here's the Windows MSI installer project that we’d like to submit for upstream inclusion: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cloudbase_ovs-2Dwindows-2Dinstallerd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=ssYlF73rox7Qc5jV0EuVGd31T3gjOjJrGilWxhpfCQUe= The included README.rst provides information on how to generate the MSI and I’ll also be happy to answer any question and review. In terms of location of the code, we could IMO either include the installer as a separate project on https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitchd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=j7vZQ7TETCqJcuj8GlWvxlDQj3eaZDowoeugOoF62m4e= or as a subfolder under the https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovsd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=64IUwcJqsI-IqUHcDpffloCd02L8ksBeDjCy2OB09Soe= project itself. My vote is for the first option, but if you guys prefer the second I’ll be happy to send the full patchset on the ML for review. Thanks, Alessandro ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=Q9DuaqvXtQI-5E0ozVMau9cLqIUtEVFPGxNzhW5FhtUe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] OVS Windows MSI installer
Alessandro, Yes, no problem of having the installer separate. But, I am confused as I see the two services are there but the driver and the INF file are not. I believe that the MSI file includes everything. Do you think you can add the OS installer script? Will we have already built MSI file (x86 and x86-64)? Thanks, Eitan -Original Message- From: Alessandro Pilotti [mailto:apilo...@cloudbasesolutions.com] Sent: Sunday, March 15, 2015 6:11 PM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: OVS Windows MSI installer Hi Eitan, On 16 Mar 2015, at 02:57, Eitan Eliahu elia...@vmware.com wrote: Hi Alessandro, I couldn't find the driver binary as part of the installer. Also, can you explain how uninstlaation is done and the case where a driver is already loaded. As explained in the README, the actual binaries are produced by the OVS build, so it does not make sense to include them in this project, otherwise we’d need to commit the binaries at every OVS build. During uninstall the driver is removed. The general rule for Windows installers is that whatever gets installed, must be removed on uninstall (except user generated content, e.g. configuration files). I didn’t include the WMI / PowerShell call for deregistering the extension from Hyper-V switches yet, since infamously that operation generated a significant amount of crashes until very recently (we still have a pending patch on this topic AFAIK). Here is where the driver is uninstalled: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cloudbase_ovs-2Dwindows-2Dinstaller_blob_master_ovs-2Dwindows-2Dinstaller_Product.wxs-23L48-2DL49d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=WmmTcAbYsoZf0kKnbhjcKx6VU2dw-WDIcSF-V8Gtd94s=ksjvS04wlV-fvUUTh7wLch51SUmIkKEpjAxRNZtebAwe= Alessandro Thank you! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alessandro Pilotti Sent: Sunday, March 15, 2015 5:33 PM To: dev@openvswitch.org Subject: [ovs-dev] OVS Windows MSI installer Hi guys, As discussed on IRC, here's the Windows MSI installer project that we’d like to submit for upstream inclusion: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cloudbase_ovs-2Dwindows-2Dinstallerd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=ssYlF73rox7Qc5jV0EuVGd31T3gjOjJrGilWxhpfCQUe= The included README.rst provides information on how to generate the MSI and I’ll also be happy to answer any question and review. In terms of location of the code, we could IMO either include the installer as a separate project on https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitchd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=j7vZQ7TETCqJcuj8GlWvxlDQj3eaZDowoeugOoF62m4e= or as a subfolder under the https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovsd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=64IUwcJqsI-IqUHcDpffloCd02L8ksBeDjCy2OB09Soe= project itself. My vote is for the first option, but if you guys prefer the second I’ll be happy to send the full patchset on the ML for review. Thanks, Alessandro ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=Q9DuaqvXtQI-5E0ozVMau9cLqIUtEVFPGxNzhW5FhtUe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] OVS Windows MSI installer
Alessandro, How the MSI solution find files from the OVS build that need to be included? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Eitan Eliahu Sent: Sunday, March 15, 2015 6:30 PM To: Alessandro Pilotti Cc: dev@openvswitch.org Subject: Re: [ovs-dev] OVS Windows MSI installer Alessandro, Yes, no problem of having the installer separate. But, I am confused as I see the two services are there but the driver and the INF file are not. I believe that the MSI file includes everything. Do you think you can add the OS installer script? Will we have already built MSI file (x86 and x86-64)? Thanks, Eitan -Original Message- From: Alessandro Pilotti [mailto:apilo...@cloudbasesolutions.com] Sent: Sunday, March 15, 2015 6:11 PM To: Eitan Eliahu Cc: dev@openvswitch.org Subject: Re: OVS Windows MSI installer Hi Eitan, On 16 Mar 2015, at 02:57, Eitan Eliahu elia...@vmware.com wrote: Hi Alessandro, I couldn't find the driver binary as part of the installer. Also, can you explain how uninstlaation is done and the case where a driver is already loaded. As explained in the README, the actual binaries are produced by the OVS build, so it does not make sense to include them in this project, otherwise we’d need to commit the binaries at every OVS build. During uninstall the driver is removed. The general rule for Windows installers is that whatever gets installed, must be removed on uninstall (except user generated content, e.g. configuration files). I didn’t include the WMI / PowerShell call for deregistering the extension from Hyper-V switches yet, since infamously that operation generated a significant amount of crashes until very recently (we still have a pending patch on this topic AFAIK). Here is where the driver is uninstalled: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cloudbase_ovs-2Dwindows-2Dinstaller_blob_master_ovs-2Dwindows-2Dinstaller_Product.wxs-23L48-2DL49d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=WmmTcAbYsoZf0kKnbhjcKx6VU2dw-WDIcSF-V8Gtd94s=ksjvS04wlV-fvUUTh7wLch51SUmIkKEpjAxRNZtebAwe= Alessandro Thank you! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alessandro Pilotti Sent: Sunday, March 15, 2015 5:33 PM To: dev@openvswitch.org Subject: [ovs-dev] OVS Windows MSI installer Hi guys, As discussed on IRC, here's the Windows MSI installer project that we’d like to submit for upstream inclusion: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cloudbase_ovs-2Dwindows-2Dinstallerd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=ssYlF73rox7Qc5jV0EuVGd31T3gjOjJrGilWxhpfCQUe= The included README.rst provides information on how to generate the MSI and I’ll also be happy to answer any question and review. In terms of location of the code, we could IMO either include the installer as a separate project on https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitchd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=j7vZQ7TETCqJcuj8GlWvxlDQj3eaZDowoeugOoF62m4e= or as a subfolder under the https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovsd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=64IUwcJqsI-IqUHcDpffloCd02L8ksBeDjCy2OB09Soe= project itself. My vote is for the first option, but if you guys prefer the second I’ll be happy to send the full patchset on the ML for review. Thanks, Alessandro ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=utkZq_G_Z0gpFYbAClV8e6AD4sXWL1oC5IbDSJwm-Dks=Q9DuaqvXtQI-5E0ozVMau9cLqIUtEVFPGxNzhW5FhtUe= ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=E8G40dNCxrZ38oxXQmMUMaHyuhmF76rDGyoDLu_wGKEs=ia3tRWFMlcRaiMrcYWBFlaohQfmUS0l1hHhy7z_lNSoe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman
Re: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port
Hi Ben, Sorin plans to address some issues once he is back. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Eitan Eliahu Sent: Wednesday, January 07, 2015 1:16 PM To: Sorin Vinturis; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port Hi Sorin, On the default port, it is also created through the user mode using the NL interface so if we create all other ports dynamically I would prefer to create the default port using the same method. (unless you see an issue here). On the concurrency issue: The spec reads as follows: Each client session can have only one transaction in progress at a time If we don't serialize transactions we cannot guaranty that transactions are not overlapped . You are right the second transaction will return with IN_PROGRESS but is should have really completeed successfully if we were serializing the transactions. I realize that it involves a significant work to serialize the transactions and to initiate them from another thread which runs in a lower IRQL. Let me get back to you on that ( iad this code before but removed it). Perhaps we could retry if it fails on with FWP_E_TXN_IN_PROGRESS. Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, January 07, 2015 11:59 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port Hi Eitan, I think we should keep the default port filter creation at the initialization phase because most users are using the default port. Regarding the new filter creation for other tunnel port, the OvsTunnelAddFilterEx function does not open the session to the filtering engine. The session is already opened when the OvsTunnelAddFilterEx function is called. It is opened during tunnel initialization phase at filter attach and is closed at filter detach. The FwpmTransactionBegin0 function begins an explicit transaction within the current session. The function cannot be called from within an already started transaction. It will fail with FWP_E_TXN_IN_PROGRESS error. So, a subsequent call to OvsTunnelAddFilterEx would be unsuccessful if a transaction is in progress. I don't think that this scenario is common. I can add an error log in case the function fails. What do you think? Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Wednesday, 7 January, 2015 17:04 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port Hi Sorin, thank you for working on this. Do you thing the default port filter had to be created during initialization ? On another thing, since OvsTunnelAddFilterEx is called with IRQL = PASSIVE and no lock is handled it may be called from multiple thread contexts. I am not sure if opening. Closing and aborting the transaction engine would be thread safe. We might need to serialize the calls and to invoke the engine from a different thread context running on PASSIVE_IRQL. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, January 07, 2015 6:24 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port The kernel datapath supports only port 4789 for VXLAN tunnel creation. Added support in order to allow for the VXLAN tunnel port to be configurable to any port number set by the userspace. The patch also checks to see if an existing WFP filter, for the necessary UDP tunnel port, is already created before adding a new one. This is a double check, because currently the userspace also verifies this, but in my opinion is necessary to avoid future inconsistencies. Custom VXLAN tunnel port requires the addition of a new WFP filter with the new UDP tunnel port. The cleanest way for the creation or removal of the new WFP filters is to add them in OvsInitVxlanTunnel or OvsCleanupVxlanTunnel functions. But the latter functions are running at IRQL = DISPATCH_LEVEL, due to the NDIS RW lock acquisition, and all WFP calls must be running at IRQL = PASSIVE_LEVEL. This is why the WFP filter creation/removal is made when the spinlock is released and the IRQL level is lowered at PASSIVE_LEVEL. The default VXLAN tunnel port 4789 behaviour is unchanged. The WFP filter for UDP port 4789 is added when the extension is enabled and is removed when the extension is disabled. No other NL command is able to remove it. Now it is necessary that OvsTunnelFilterUninitialize function is called after OvsClearAllSwitchVports in order to allow for the added WFP filters to be removed. OvsTunnelFilterUninitialize function closes the global engine handle used by most of the WFP calls, including
Re: [ovs-dev] [PATCH v2] tests: Enable running parallel unit tests for Windows.
Thanks! Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Wednesday, February 11, 2015 6:00 PM To: dev@openvswitch.org Cc: Gurucharan Shetty Subject: [ovs-dev] [PATCH v2] tests: Enable running parallel unit tests for Windows. testsuite uses mkfifo in its job dispatcher that manages parallel unit tests. MinGW does not have a mkfifo. This results in unit tests running serially on Windows. Right now it takes up to approximately 40 minutes to run all the unit tests on Windows. This commit provides a job dispatcher for MinGW that uses temporary files instead of mkfifo to manage parallel jobs. With this commit, on a Windows machine with 4 cores and with 8 parallel unit test sessions, it takes approximately 8 minutes to finish a unit test run. Signed-off-by: Gurucharan Shetty gshe...@nicira.com --- INSTALL.md|2 ++ tests/automake.mk |7 +++-- tests/testsuite.patch | 76 + 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 tests/testsuite.patch diff --git a/INSTALL.md b/INSTALL.md index 94c25f7..273093b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -41,6 +41,8 @@ you will need the following software: - Python 2.x, for x = 4. + - patch (The utility that is used to patch files). + On Linux, you may choose to compile the kernel module that comes with the Open vSwitch distribution or to use the kernel module built into the Linux kernel (version 3.3 or later). See the [FAQ.md] question diff --git a/tests/automake.mk b/tests/automake.mk index 2e8d213..50d8ad2 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -6,7 +6,8 @@ EXTRA_DIST += \ $(KMOD_TESTSUITE) \ tests/atlocal.in \ $(srcdir)/package.m4 \ - $(srcdir)/tests/testsuite + $(srcdir)/tests/testsuite \ + $(srcdir)/tests/testsuite.patch COMMON_MACROS_AT = \ tests/ovsdb-macros.at \ @@ -87,6 +88,7 @@ KMOD_TESTSUITE_AT = \ tests/kmod-traffic.at TESTSUITE = $(srcdir)/tests/testsuite +TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch KMOD_TESTSUITE = $(srcdir)/tests/kmod-testsuite DISTCLEANFILES += tests/atconfig tests/atlocal @@ -196,8 +198,9 @@ clean-local: test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean AUTOTEST = $(AUTOM4TE) --language=autotest -$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) +$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) +$(TESTSUITE_PATCH) $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + patch -p0 $@.tmp $(TESTSUITE_PATCH) $(AM_V_at)mv $@.tmp $@ $(KMOD_TESTSUITE): package.m4 $(KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT) diff --git a/tests/testsuite.patch b/tests/testsuite.patch new file mode 100644 index 000..e0c6bb3 --- /dev/null +++ b/tests/testsuite.patch @@ -0,0 +1,76 @@ +--- testsuite 2015-02-11 17:19:21.654646439 -0800 testsuite 2015-02-11 17:15:03.810653032 -0800 +@@ -4669,6 +4669,73 @@ + fi + exec 6- + wait ++elif test $at_jobs -ne 1 ++ test $IS_WIN32 = yes; then ++ # FIFO job dispatcher. ++ trap 'at_pids= ++ for at_pid in `jobs -p`; do ++at_pids=$at_pids $at_job_group$at_pid ++ done ++ if test -n $at_pids; then ++at_sig=TSTP ++test ${TMOUT+set} = set at_sig=STOP ++kill -$at_sig $at_pids 2/dev/null ++ fi ++ kill -STOP $$ ++ test -z $at_pids || kill -CONT $at_pids 2/dev/null' TSTP ++ ++ echo ++ # Turn jobs into a list of numbers, starting from 1. ++ running_jobs=`pwd`/tests/jobdispatcher ++ mkdir -p $running_jobs ++ at_joblist=`$as_echo $at_groups | sed -n 1,${at_jobs}p` ++ ++ set X $at_joblist ++ shift ++ for at_group in $at_groups; do ++$at_job_control_on 2/dev/null ++( ++ # Start one test group. ++ $at_job_control_off ++ touch $running_jobs/$at_group ++ trap 'set +x; set +e ++ trap PIPE ++ echo stop $at_stop_file ++ rm -f $running_jobs/$at_group ++ as_fn_exit 141' PIPE ++ at_fn_group_prepare ++ if cd $at_group_dir ++ at_fn_test $at_group ++ . $at_test_source ++ then :; else ++ { $as_echo $as_me:${as_lineno-$LINENO}: WARNING: unable to parse ++test group: $at_group 5 $as_echo $as_me: WARNING: unable to parse test group: $at_group 2;} ++ at_failed=: ++ fi ++ rm -f $running_jobs/$at_group ++ at_fn_group_postprocess ++) ++$at_job_control_off ++shift # Consume one token. ++if test $# -gt 0; then :; else ++ while [ `ls -l $running_jobs 2/dev/null | wc -l` -gt $at_jobs ]; do ++sleep 0.1 ++ done ++ set x $* ++fi ++test -f $at_stop_file break ++ done ++ # Read back the remaining ($at_jobs - 1) tokens. ++ set X $at_joblist ++ shift ++ if test $# -gt 0; then ++shift ++while [ `ls -l
Re: [ovs-dev] [PATCH] appveyor: Build windows kernel datapath.
Guru, driver build is very short (less than a min), It uses precompiled headers. Let's have the debug build until we will have it as an option. For user mode to take advantage on precompiled header, there is work to be dome in arranging the header files. Thank you for taking the time! Eitan -Original Message- From: Gurucharan Shetty [mailto:shet...@nicira.com] Sent: Friday, February 06, 2015 7:39 AM To: Eitan Eliahu Cc: Nithin Raju; dev@openvswitch.org; Gurucharan Shetty Subject: Re: [ovs-dev] [PATCH] appveyor: Build windows kernel datapath. Would be nice to have an option for Release or debug build. User mode code too. Right now, we are not deploying the created executables anywhere. Appveyor does have that option. We can probably enhance it once we have a in-tree windows installer. On the release/debug question, the only option is to do both - which will increase the build time. Increase of build time means that pre-checkin check through appveyor will be slow and people may not actually use it. On the question of the pre-compiled headers, it is likely not going to help the userspace build because it is done one file at a time. I will nevertheless investigate. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Thursday, February 05, 2015 10:39 PM To: Gurucharan Shetty Cc: dev@openvswitch.org; Gurucharan Shetty Subject: Re: [ovs-dev] [PATCH] appveyor: Build windows kernel datapath. +- C:\MinGW\msys\1.0\bin\bash -lc cd /c/openvswitch ./configure CC=build-aux/cccl LD=\`which link`\ LIBS=-lws2_32 --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudioddk=\Win8.1 Release\” Thanks for the patch. Only comment I had was to was to prefer to use Win8.1 Debug” rather than “Win8.1 Release”. It doesn’t make any practical difference though, but it might be best to do “Debug” builds rather than “Release” in a build-test setup. Acked-by: Nithin Raju nit...@vmware.com ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=MQliY0lervWD1h0IE-vbsFegcFKLa9zmypMkSUENsKUs=xwhEJXSZhbRRLtHYTw6veobMVUDNCK01EUqRgvoeOlwe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] appveyor: Build windows kernel datapath.
Would be nice to have an option for Release or debug build. User mode code too. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Thursday, February 05, 2015 10:39 PM To: Gurucharan Shetty Cc: dev@openvswitch.org; Gurucharan Shetty Subject: Re: [ovs-dev] [PATCH] appveyor: Build windows kernel datapath. +- C:\MinGW\msys\1.0\bin\bash -lc cd /c/openvswitch ./configure CC=build-aux/cccl LD=\`which link`\ LIBS=-lws2_32 --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudioddk=\Win8.1 Release\” Thanks for the patch. Only comment I had was to was to prefer to use Win8.1 Debug” rather than “Win8.1 Release”. It doesn’t make any practical difference though, but it might be best to do “Debug” builds rather than “Release” in a build-test setup. Acked-by: Nithin Raju nit...@vmware.com ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=MQliY0lervWD1h0IE-vbsFegcFKLa9zmypMkSUENsKUs=xwhEJXSZhbRRLtHYTw6veobMVUDNCK01EUqRgvoeOlwe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 2/2] appveyor: Provide a autobuild service for Windows.
Testing on a single CPU machine is problematic (even if it would have run fast), but the build itself has its own advantage. The driver build should be much quicker. Do we use precompiled header option? https://msdn.microsoft.com/en-us/library/2yzw0wyd.aspx Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Thursday, February 05, 2015 1:27 PM To: Ben Pfaff Cc: dev; Gurucharan Shetty Subject: Re: [ovs-dev] [PATCH 2/2] appveyor: Provide a autobuild service for Windows. Oh! Do you have an idea of what takes up the bulk of the time for the OVS unit tests in Windows? I think the main reasons are: * Creation of new processes is slow on Windows. So some unit tests that run hundreds of processes causes the unit tests to go very slow (for e.g., bfd and cfm). * I think 'configure' is also slow on Windows for the same reason as above. * autoconf tests on mingw does not have the infrastructure to be executed in parallel. (I think it is because of no mknod. Probably it can be worked around, but the fix will likely be needed upstream in the code that generates testsuite) * Appveyor itself provides only one CPU. So I cannot run 'make -jx' ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=GX0hr7CUW9JW_B5yLYnNDaWDoO-5-MOBGFO8vOZDujUs=Cw_TEP7eHYIGXE0sNkC55mer7x-Wa10Uxrm9m0XrVC0e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH 2/2] appveyor: Provide a autobuild service for Windows.
Looks like user mode does not use pre-compiled headers, but the driver does. -Original Message- From: Eitan Eliahu Sent: Thursday, February 05, 2015 1:39 PM To: 'Gurucharan Shetty'; Ben Pfaff Cc: dev; Gurucharan Shetty Subject: RE: [ovs-dev] [PATCH 2/2] appveyor: Provide a autobuild service for Windows. Testing on a single CPU machine is problematic (even if it would have run fast), but the build itself has its own advantage. The driver build should be much quicker. Do we use precompiled header option? https://msdn.microsoft.com/en-us/library/2yzw0wyd.aspx Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Gurucharan Shetty Sent: Thursday, February 05, 2015 1:27 PM To: Ben Pfaff Cc: dev; Gurucharan Shetty Subject: Re: [ovs-dev] [PATCH 2/2] appveyor: Provide a autobuild service for Windows. Oh! Do you have an idea of what takes up the bulk of the time for the OVS unit tests in Windows? I think the main reasons are: * Creation of new processes is slow on Windows. So some unit tests that run hundreds of processes causes the unit tests to go very slow (for e.g., bfd and cfm). * I think 'configure' is also slow on Windows for the same reason as above. * autoconf tests on mingw does not have the infrastructure to be executed in parallel. (I think it is because of no mknod. Probably it can be worked around, but the fix will likely be needed upstream in the code that generates testsuite) * Appveyor itself provides only one CPU. So I cannot run 'make -jx' ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=GX0hr7CUW9JW_B5yLYnNDaWDoO-5-MOBGFO8vOZDujUs=Cw_TEP7eHYIGXE0sNkC55mer7x-Wa10Uxrm9m0XrVC0e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: accommodate to UFID changes
Alin, looks good only minor thing : +rc = STATUS_SUCCESS Is redundant Thanks, Eitan Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, February 03, 2015 11:25 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: accommodate to UFID changes Current flow commands: new, set, get, del need to respond with a NETLINK error in the case OVS_FLOW_ATTR_KEY is missing. OVS_FLOW_ATTR_KEY is now an optional attribute. Also add OVS_FLOW_ATTR_UFID attribute to the kernel for further use. Signed-off-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com --- datapath-windows/ovsext/Flow.c | 26 +++--- datapath-windows/ovsext/Flow.h | 6 ++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index d3de8cc..b849666 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -95,7 +95,7 @@ static NTSTATUS OvsDoDumpFlows(OvsFlowDumpInput *dumpInput, /* For Parsing attributes in FLOW_* commands */ const NL_POLICY nlFlowPolicy[] = { -[OVS_FLOW_ATTR_KEY] = {.type = NL_A_NESTED, .optional = FALSE}, +[OVS_FLOW_ATTR_KEY] = {.type = NL_A_NESTED, .optional = TRUE}, [OVS_FLOW_ATTR_MASK] = {.type = NL_A_NESTED, .optional = TRUE}, [OVS_FLOW_ATTR_ACTIONS] = {.type = NL_A_NESTED, .optional = TRUE}, [OVS_FLOW_ATTR_STATS] = {.type = NL_A_UNSPEC, @@ -103,7 +103,9 @@ const NL_POLICY nlFlowPolicy[] = { .maxLen = sizeof(struct ovs_flow_stats), .optional = TRUE}, [OVS_FLOW_ATTR_TCP_FLAGS] = {NL_A_U8, .optional = TRUE}, -[OVS_FLOW_ATTR_USED] = {NL_A_U64, .optional = TRUE} +[OVS_FLOW_ATTR_USED] = {NL_A_U64, .optional = TRUE}, +[OVS_FLOW_ATTR_UFID] = { .type = NL_A_UNSPEC, .optional = TRUE, + .minLen = sizeof(OvsU128) } }; /* For Parsing nested OVS_FLOW_ATTR_KEY attributes. @@ -308,6 +310,11 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, goto done; } +if (nlAttrs[OVS_FLOW_ATTR_KEY] == NULL) { +nlError = NL_ERROR_INVAL; +goto done; +} + if ((rc = _MapNlToFlowPut(msgIn, nlAttrs[OVS_FLOW_ATTR_KEY], nlAttrs[OVS_FLOW_ATTR_ACTIONS], nlAttrs[OVS_FLOW_ATTR_CLEAR], mappedFlow)) @@ -420,7 +427,7 @@ _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, PNL_MSG_HDR nlMsgOutHdr = NULL; UINT32 attrOffset = NLMSG_HDRLEN + GENL_HDRLEN + OVS_HDRLEN; PNL_ATTR nlAttrs[__OVS_FLOW_ATTR_MAX]; - +NL_ERROR nlError = NL_ERROR_SUCCESS; OvsFlowGetInput getInput; OvsFlowGetOutput getOutput; NL_BUFFER nlBuf; @@ -455,6 +462,11 @@ _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, goto done; } +if (nlAttrs[OVS_FLOW_ATTR_KEY] == NULL) { +nlError = NL_ERROR_INVAL; +goto done; +} + keyAttrOffset = (UINT32)((PCHAR) nlAttrs[OVS_FLOW_ATTR_KEY] - (PCHAR)nlMsgHdr); @@ -532,6 +544,14 @@ _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, *replyLen += NlMsgSize(nlMsgOutHdr); done: +if (nlError != NL_ERROR_SUCCESS) { +POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) +usrParamsCtx-outputBuffer; +NlBuildErrorMsg(msgIn, msgError, nlError); +*replyLen = msgError-nlMsg.nlmsgLen; +rc = STATUS_SUCCESS; +} + return rc; } diff --git a/datapath-windows/ovsext/Flow.h b/datapath-windows/ovsext/Flow.h index e817bcf..02a72de 100644 --- a/datapath-windows/ovsext/Flow.h +++ b/datapath-windows/ovsext/Flow.h @@ -37,6 +37,12 @@ typedef struct _OvsFlow { NL_ATTR actions[1]; } OvsFlow; +typedef union _OvsU128{ +uint32_t u32[4]; +struct { +uint64_t lo, hi; +} u64; +} OvsU128; typedef struct _OvsLayers { UINT32 l3Ofs; // IPv4, IPv6, ARP, or other L3 header. -- 1.9.5.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=h-xnHaFVXtokcPzoZ2splmejx62S-xmfF3kpRTH09E4s=jDEwGj_nNoRyr5TpRU2IUyAXEIYfICDpxyn7X_UJVJMe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port
Hi Sorin, Thank you for addressing these issues. Please find some minor comments below. The issue I see now is that the IOCTL completion is not synchronized with the engine execution and if the transaction fails it is not propagated to user mode . I realize that the thread exists when the transaction fails but we might just fail the transaction. I think once we have the IOCTL synced we can go ahead with this challenging change. Eitan -Original Message- From: Eitan Eliahu Sent: Tuesday, January 20, 2015 9:07 AM To: 'Sorin Vinturis' Subject: RE: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port Hi Sorin, once you comment out the call to OvsDetectTunnelRxPkt() the driver should ignore the received packet and to indicate it up to the host stack. This means that any packet (not just fragmented) will be indicated to the host. We can deal with adding the opening of the socket in vswitchd later. For purpose of testing this code you can run any other application which open a VXLAN UDP port (concurrently with vswitchd.exe) . Thanks, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Monday, January 19, 2015 7:04 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port Hi Eitan, I have not manage to successfully shortcut fast path. I have changed the netlink library to create the necessary socket in order for the packets to go through the filter, but the resulted vswitchd binary hangs when I execute it. Thus could not perform the test that shortcuts the fast path. For testing the patch I have created a script that adds vxlan tunnels with different destination ports. Each add vxlan tunnel command, that triggers a OVS_VPORT_CMD_NEW command, is followed by a set command, that triggers first a OVS_VPORT_CMD_NEW command for the new vport with the new destination port, and an OVS_VPORT_CMD_DELETE command for deleting the first vport. Below is an excerpt of the script I used: start .\rundb.bat Start-Sleep -s 2 start .\runvswitch.bat .\ovs-vsctl.exe --db=tcp:127.0.0.1:8777 add-br br0 .\ovs-vsctl.exe --db=tcp:127.0.0.1:8777 add-port br0 vxlan1 -- set interface vxxlan1 type=vxlan options:remote_ip=10.1.1.112 options:dst_port=5000 .\ovs-vsctl.exe --db=tcp:127.0.0.1:8777 -- set interface vxlan1 type=vxlan options:remote_ip=10.1.1.112 options:dst_port=5001 -- Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Friday, 16 January, 2015 17:38 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port Hi Sorin, Thank you for addressing the issues, specifically, executing the engine from a thread running in lower IRQL. Can you please add some comments on the testing you performed? Where you able to shortcut the fast path and to open the VXLAN UDP port in user mode so packets will go through the filter? Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, January 15, 2015 1:11 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port The kernel datapath supports only port 4789 for VXLAN tunnel creation. Added support in order to allow for the VXLAN tunnel port to be configurable to any port number set by the userspace. The patch also checks to see if an existing WFP filter, for the necessary UDP tunnel port, is already created before adding a new one. This is a double check, because currently the userspace also verifies this, but it is necessary to avoid future issues. Custom VXLAN tunnel port requires the addition of a new WFP filter with the new UDP tunnel port. The creation of a new WFP filter is triggered in OvsInitVxlanTunnel function and the removal of the WFP filter in OvsCleanupVxlanTunnel function. But the latter functions are running at IRQL = DISPATCH_LEVEL, due to the NDIS RW lock acquisition, and all WFP calls must be running at IRQL = PASSIVE_LEVEL. This is why I have created a system thread which records all filter addition/removal requests into a list for later processing by the system thread. The ThreadStart routine processes all received requests at IRQL = PASSIVE_LEVEL, which is the required IRQL for the necessary WFP calls for adding/removal of the WFP filters. The WFP filter for the default VXLAN port 4789 is not added anymore at filter attach. All WFP filters for the tunnel ports are added when the tunnel ports are initialized and are removed at cleanup. It is necessary that OvsTunnelFilterUninitialize function is called after OvsClearAllSwitchVports in order to allow for the added WFP filters to be removed. OvsTunnelFilterUninitialize function closes the global engine handle used by most of the WFP calls, including filter removal. Signed-off-by: Sorin Vinturis
Re: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port
Hi Sorin, Thank you for addressing the issues, specifically, executing the engine from a thread running in lower IRQL. Can you please add some comments on the testing you performed? Where you able to shortcut the fast path and to open the VXLAN UDP port in user mode so packets will go through the filter? Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Thursday, January 15, 2015 1:11 PM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Support for custom VXLAN tunnel port The kernel datapath supports only port 4789 for VXLAN tunnel creation. Added support in order to allow for the VXLAN tunnel port to be configurable to any port number set by the userspace. The patch also checks to see if an existing WFP filter, for the necessary UDP tunnel port, is already created before adding a new one. This is a double check, because currently the userspace also verifies this, but it is necessary to avoid future issues. Custom VXLAN tunnel port requires the addition of a new WFP filter with the new UDP tunnel port. The creation of a new WFP filter is triggered in OvsInitVxlanTunnel function and the removal of the WFP filter in OvsCleanupVxlanTunnel function. But the latter functions are running at IRQL = DISPATCH_LEVEL, due to the NDIS RW lock acquisition, and all WFP calls must be running at IRQL = PASSIVE_LEVEL. This is why I have created a system thread which records all filter addition/removal requests into a list for later processing by the system thread. The ThreadStart routine processes all received requests at IRQL = PASSIVE_LEVEL, which is the required IRQL for the necessary WFP calls for adding/removal of the WFP filters. The WFP filter for the default VXLAN port 4789 is not added anymore at filter attach. All WFP filters for the tunnel ports are added when the tunnel ports are initialized and are removed at cleanup. It is necessary that OvsTunnelFilterUninitialize function is called after OvsClearAllSwitchVports in order to allow for the added WFP filters to be removed. OvsTunnelFilterUninitialize function closes the global engine handle used by most of the WFP calls, including filter removal. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_66d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=VmREdmxxsERc3TdRTLuqj-tDd42IJUEuvcXW-vWM5Mcs=M_OrcxSLPFtZNI5KVfqaF7oSnM_vU3_Sj2E0GAESvqce= --- datapath-windows/ovsext/Switch.c | 2 +- datapath-windows/ovsext/Tunnel.h | 6 - datapath-windows/ovsext/TunnelFilter.c | 484 - datapath-windows/ovsext/TunnelIntf.h | 4 + datapath-windows/ovsext/Vport.c| 13 +- datapath-windows/ovsext/Vxlan.c| 53 +++- datapath-windows/ovsext/Vxlan.h| 2 +- 7 files changed, 473 insertions(+), 91 deletions(-) diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index a228d8e..cf5e3c4 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -261,8 +261,8 @@ OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) if (switchContext) { dpNo = switchContext-dpNo; -OvsTunnelFilterUninitialize(gOvsExtDriverObject); OvsClearAllSwitchVports(switchContext); +OvsTunnelFilterUninitialize(gOvsExtDriverObject); OvsUninitSwitchContext(switchContext); OvsFreeMemory(switchContext); } diff --git a/datapath-windows/ovsext/Tunnel.h b/datapath-windows/ovsext/Tunnel.h index 2978bb3..2c45e35 100644 --- a/datapath-windows/ovsext/Tunnel.h +++ b/datapath-windows/ovsext/Tunnel.h @@ -32,12 +32,6 @@ typedef struct OVS_TUNNEL_PENDED_PACKET_ FWPS_CLASSIFY_OUT *classifyOut; } OVS_TUNNEL_PENDED_PACKET; -/* Shared global data. */ - -extern UINT16 configNewDestPort; - -extern UINT32 gCalloutIdV4; - // // Shared function prototypes // diff --git a/datapath-windows/ovsext/TunnelFilter.c b/datapath-windows/ovsext/TunnelFilter.c index e0adc37..b4289e6 100644 --- a/datapath-windows/ovsext/TunnelFilter.c +++ b/datapath-windows/ovsext/TunnelFilter.c @@ -63,9 +63,6 @@ /* The session name isn't required but it's useful for diagnostics. */ #define OVS_TUNNEL_SESSION_NAME LOVS tunnel session -/* Configurable parameters (addresses and ports are in host order) */ -UINT16 configNewDestPort = VXLAN_UDP_PORT; - /* * Callout and sublayer GUIDs */ @@ -105,14 +102,57 @@ DEFINE_GUID( 0xa5, 0x36, 0x1e, 0xed, 0xb9, 0xe9, 0xba, 0x6a ); +KSTART_ROUTINE OvsTunnelFilterThreadProc; +NTSTATUSOvsTunnelFilterThreadInit(); +VOIDOvsTunnelFilterThreadStop(); +VOIDOvsTunnelFilterThreadCleanup(); + /* - * Callout driver global
Re: [ovs-dev] OVN architecture
No problem, my point is that it is doable to have a dynamic linking model. Unless there is a custom installer and mechanism to enforce versioning it is better to package the static libraries with the executable. Thanks, Eitan -Original Message- From: Gurucharan Shetty [mailto:shet...@nicira.com] Sent: Thursday, January 15, 2015 9:07 AM To: Eitan Eliahu Cc: Thomas Graf; dev; YAMAMOTO Takashi Subject: Re: [ovs-dev] OVN architecture On Thu, Jan 15, 2015 at 8:55 AM, Eitan Eliahu elia...@vmware.com wrote: Shared libraries on Windows could be implemented as DLLs (Dynamic Link Libraries) with some custom support for versioning. This means also that updates of new versions of the DLLs should controlled by a custom installer. I did not intend to mean that Windows does not support shared libraries. Sorry about that. What I was saying is that autoconf/automake in openvswitch does not allow shared library building on Windows right now (it does on Linux). -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Thomas Graf Sent: Thursday, January 15, 2015 7:19 AM To: Gurucharan Shetty Cc: dev; YAMAMOTO Takashi Subject: Re: [ovs-dev] OVN architecture On 01/15/15 at 07:04am, Gurucharan Shetty wrote: On Thu, Jan 15, 2015 at 4:06 AM, Thomas Graf tg...@noironetworks.com wrote: On 01/15/15 at 03:36pm, YAMAMOTO Takashi wrote: On Thu, Jan 15, 2015 at 10:38:45AM +0900, YAMAMOTO Takashi wrote: ovn-controller -- neutron ofagent agent has a similar design to ovn-controller. you might be able to reuse at least some of code if python+ryu is acceptable. https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com _ openstack_neutron_tree_stable_juno_neutron_plugins_ofagentd=Aw I GaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6Ex L XY798tmo3LJ4e3geGYp56lkcH-5cLCYm=BOjy7uXWvQ7_zay-Yzf-Z2zPIMCBc 5 NiTCjTNxYAdYUs=bQdLaLSSbfeFOSxAm6ke5xfCzrQA39wkiG0g_ZcR04Ue= I didn't know that there was an existing local controller. I'll learn something about the design. similar: - it's a local OpenFlow controller running on each nodes - it has ARP suppression feature implemented with packet-ins (called local arp responder there) different: - ofagent doesn't have a layer equivalent to OVN database. it obtains the necessary info from its CMS (neutron) directly Another local controller to look at is the OpFlex OVS agent which runs locally as well and uses libopenvswitch and libofproto to talk OF/OVSDB to OVS. (I think OVN should be built on top of the now exposed shared libraries as well). A point to be noted while taking a decision is that there is currently no capability to build shared libraries on Windows platform. Good point. I don't know enough about packaging on Windows to know whether fall back to static linking for Windows would impose any packaging/distribution problems. On Linux, the shared library dependency would simplify the packaging in Linux distributions. (A bug in OF code must be pushed to both OVS and OVN packages.) ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_ma ilman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt- uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=BOjy7uXWvQ7_zay-Yz f-Z2zPIMCBc5NiTCjTNxYAdYUs=UyabyhKPWJeZTHnkqZ2RX5jEpNn_edhyd3ljIMS0sN 4e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] OVN architecture
Shared libraries on Windows could be implemented as DLLs (Dynamic Link Libraries) with some custom support for versioning. This means also that updates of new versions of the DLLs should controlled by a custom installer. -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Thomas Graf Sent: Thursday, January 15, 2015 7:19 AM To: Gurucharan Shetty Cc: dev; YAMAMOTO Takashi Subject: Re: [ovs-dev] OVN architecture On 01/15/15 at 07:04am, Gurucharan Shetty wrote: On Thu, Jan 15, 2015 at 4:06 AM, Thomas Graf tg...@noironetworks.com wrote: On 01/15/15 at 03:36pm, YAMAMOTO Takashi wrote: On Thu, Jan 15, 2015 at 10:38:45AM +0900, YAMAMOTO Takashi wrote: ovn-controller -- neutron ofagent agent has a similar design to ovn-controller. you might be able to reuse at least some of code if python+ryu is acceptable. https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ openstack_neutron_tree_stable_juno_neutron_plugins_ofagentd=AwI GaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExL XY798tmo3LJ4e3geGYp56lkcH-5cLCYm=BOjy7uXWvQ7_zay-Yzf-Z2zPIMCBc5 NiTCjTNxYAdYUs=bQdLaLSSbfeFOSxAm6ke5xfCzrQA39wkiG0g_ZcR04Ue= I didn't know that there was an existing local controller. I'll learn something about the design. similar: - it's a local OpenFlow controller running on each nodes - it has ARP suppression feature implemented with packet-ins (called local arp responder there) different: - ofagent doesn't have a layer equivalent to OVN database. it obtains the necessary info from its CMS (neutron) directly Another local controller to look at is the OpFlex OVS agent which runs locally as well and uses libopenvswitch and libofproto to talk OF/OVSDB to OVS. (I think OVN should be built on top of the now exposed shared libraries as well). A point to be noted while taking a decision is that there is currently no capability to build shared libraries on Windows platform. Good point. I don't know enough about packaging on Windows to know whether fall back to static linking for Windows would impose any packaging/distribution problems. On Linux, the shared library dependency would simplify the packaging in Linux distributions. (A bug in OF code must be pushed to both OVS and OVN packages.) ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=BOjy7uXWvQ7_zay-Yzf-Z2zPIMCBc5NiTCjTNxYAdYUs=UyabyhKPWJeZTHnkqZ2RX5jEpNn_edhyd3ljIMS0sN4e= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port
Hi Sorin, On the default port, it is also created through the user mode using the NL interface so if we create all other ports dynamically I would prefer to create the default port using the same method. (unless you see an issue here). On the concurrency issue: The spec reads as follows: Each client session can have only one transaction in progress at a time If we don't serialize transactions we cannot guaranty that transactions are not overlapped . You are right the second transaction will return with IN_PROGRESS but is should have really completeed successfully if we were serializing the transactions. I realize that it involves a significant work to serialize the transactions and to initiate them from another thread which runs in a lower IRQL. Let me get back to you on that ( iad this code before but removed it). Perhaps we could retry if it fails on with FWP_E_TXN_IN_PROGRESS. Thank you, Eitan -Original Message- From: Sorin Vinturis [mailto:svintu...@cloudbasesolutions.com] Sent: Wednesday, January 07, 2015 11:59 AM To: Eitan Eliahu; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port Hi Eitan, I think we should keep the default port filter creation at the initialization phase because most users are using the default port. Regarding the new filter creation for other tunnel port, the OvsTunnelAddFilterEx function does not open the session to the filtering engine. The session is already opened when the OvsTunnelAddFilterEx function is called. It is opened during tunnel initialization phase at filter attach and is closed at filter detach. The FwpmTransactionBegin0 function begins an explicit transaction within the current session. The function cannot be called from within an already started transaction. It will fail with FWP_E_TXN_IN_PROGRESS error. So, a subsequent call to OvsTunnelAddFilterEx would be unsuccessful if a transaction is in progress. I don't think that this scenario is common. I can add an error log in case the function fails. What do you think? Thanks, Sorin -Original Message- From: Eitan Eliahu [mailto:elia...@vmware.com] Sent: Wednesday, 7 January, 2015 17:04 To: Sorin Vinturis; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port Hi Sorin, thank you for working on this. Do you thing the default port filter had to be created during initialization ? On another thing, since OvsTunnelAddFilterEx is called with IRQL = PASSIVE and no lock is handled it may be called from multiple thread contexts. I am not sure if opening. Closing and aborting the transaction engine would be thread safe. We might need to serialize the calls and to invoke the engine from a different thread context running on PASSIVE_IRQL. Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Wednesday, January 07, 2015 6:24 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Support for custom VXLAN tunnel port The kernel datapath supports only port 4789 for VXLAN tunnel creation. Added support in order to allow for the VXLAN tunnel port to be configurable to any port number set by the userspace. The patch also checks to see if an existing WFP filter, for the necessary UDP tunnel port, is already created before adding a new one. This is a double check, because currently the userspace also verifies this, but in my opinion is necessary to avoid future inconsistencies. Custom VXLAN tunnel port requires the addition of a new WFP filter with the new UDP tunnel port. The cleanest way for the creation or removal of the new WFP filters is to add them in OvsInitVxlanTunnel or OvsCleanupVxlanTunnel functions. But the latter functions are running at IRQL = DISPATCH_LEVEL, due to the NDIS RW lock acquisition, and all WFP calls must be running at IRQL = PASSIVE_LEVEL. This is why the WFP filter creation/removal is made when the spinlock is released and the IRQL level is lowered at PASSIVE_LEVEL. The default VXLAN tunnel port 4789 behaviour is unchanged. The WFP filter for UDP port 4789 is added when the extension is enabled and is removed when the extension is disabled. No other NL command is able to remove it. Now it is necessary that OvsTunnelFilterUninitialize function is called after OvsClearAllSwitchVports in order to allow for the added WFP filters to be removed. OvsTunnelFilterUninitialize function closes the global engine handle used by most of the WFP calls, including filter removal. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Alin Gabriel Serdean aserd...@cloudbasesolutions.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_66d=AwIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=fVUQFtLj8jLS3oqKrhXRCrc7OwBHhpU4eYO-t9Nbm-gs
Re: [ovs-dev] [PATCH 1/2] datapath-windows: refactor BuildReplyMsgFromMsgIn BuildErrorMsg
Acked-by: Eitan Eliahu elia...@vmware.com Thanks! Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Monday, December 08, 2014 9:43 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 1/2] datapath-windows: refactor BuildReplyMsgFromMsgIn BuildErrorMsg In this patch, we consolidate code in Netlink.c. Signed-off-by: Nithin Raju nit...@vmware.com --- datapath-windows/ovsext/Datapath.c|2 +- datapath-windows/ovsext/Flow.c|4 +- datapath-windows/ovsext/Netlink/Netlink.c | 40 - datapath-windows/ovsext/Netlink/Netlink.h |6 +--- datapath-windows/ovsext/User.c|2 +- datapath-windows/ovsext/Vport.c | 28 +--- 6 files changed, 30 insertions(+), 52 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index f6e6e50..af8d818 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -1324,7 +1324,7 @@ cleanup: POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) usrParamsCtx-outputBuffer; -BuildErrorMsg(msgIn, msgError, nlError); +NlBuildErrorMsg(msgIn, msgError, nlError); *replyLen = msgError-nlMsg.nlmsgLen; } diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index f47d469..f50bb39 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -355,7 +355,7 @@ done: if (nlError != NL_ERROR_SUCCESS) { POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) usrParamsCtx-outputBuffer; -BuildErrorMsg(msgIn, msgError, nlError); +NlBuildErrorMsg(msgIn, msgError, nlError); *replyLen = msgError-nlMsg.nlmsgLen; rc = STATUS_SUCCESS; } @@ -387,7 +387,7 @@ OvsFlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, (usrParamsCtx-outputBuffer)) { POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR) usrParamsCtx-outputBuffer; -BuildErrorMsg(msgIn, msgError, nlError); +NlBuildErrorMsg(msgIn, msgError, nlError); *replyLen = msgError-nlMsg.nlmsgLen; status = STATUS_SUCCESS; goto done; diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c index 7633f2f..0d48d08 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.c +++ b/datapath-windows/ovsext/Netlink/Netlink.c @@ -102,41 +102,23 @@ NlFillNlHdr(PNL_BUFFER nlBuf, UINT16 nlmsgType, return writeOk ? STATUS_SUCCESS : STATUS_INVALID_BUFFER_SIZE; } -static VOID -BuildMsgOut(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, UINT16 type, -UINT32 length, UINT16 flags) -{ -msgOut-nlMsg.nlmsgType = type; -msgOut-nlMsg.nlmsgFlags = flags; -msgOut-nlMsg.nlmsgSeq = msgIn-nlMsg.nlmsgSeq; -msgOut-nlMsg.nlmsgPid = msgIn-nlMsg.nlmsgPid; -msgOut-nlMsg.nlmsgLen = length; - -msgOut-genlMsg.cmd = msgIn-genlMsg.cmd; -msgOut-genlMsg.version = msgIn-genlMsg.version; -msgOut-genlMsg.reserved = 0; -} - /* - * XXX: should move out these functions to a Netlink.c or to a OvsMessage.c - * or even make them inlined functions in Datapath.h. Can be done after the - * first sprint once we have more code to refactor. + * + -- + - + * Prepare a 'OVS_MESSAGE_ERROR' message. + * + -- + - */ VOID -BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, UINT16 flags) +NlBuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgError, UINT +errorCode) { -BuildMsgOut(msgIn, msgOut, msgIn-nlMsg.nlmsgType, sizeof(OVS_MESSAGE), -flags); -} +NL_BUFFER nlBuffer; -VOID -BuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgOut, UINT errorCode) -{ -BuildMsgOut(msgIn, (POVS_MESSAGE)msgOut, NLMSG_ERROR, -sizeof(OVS_MESSAGE_ERROR), 0); +NlBufInit(nlBuffer, (PCHAR)msgError, sizeof *msgError); +NlFillNlHdr(nlBuffer, NLMSG_ERROR, 0, +msgIn-nlMsg.nlmsgSeq, msgIn-nlMsg.nlmsgPid); -msgOut-errorMsg.error = errorCode; -msgOut-errorMsg.nlMsg = msgIn-nlMsg; +msgError-errorMsg.error = errorCode; +msgError-errorMsg.nlMsg = msgIn-nlMsg; +msgError-nlMsg.nlmsgLen = sizeof(OVS_MESSAGE_ERROR); } /* diff --git a/datapath-windows/ovsext/Netlink/Netlink.h b/datapath-windows/ovsext/Netlink/Netlink.h index 18e40b1..a7a53e0 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.h +++ b/datapath-windows/ovsext/Netlink/Netlink.h @@ -94,10 +94,8 @@ NTSTATUS NlFillNlHdr(PNL_BUFFER nlBuf, UINT16 nlmsgType, UINT16 nlmsgFlags, UINT32 nlmsgSeq, UINT32 nlmsgPid); -VOID BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn
Re: [ovs-dev] [PATCH 2/2] datapath-windows: return bool from NlFillOvs[Msg/Hdr]
Acked-by: Eitan Eliahu elia...@vmware.com Thanks for addressing my comment. Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Monday, December 08, 2014 9:43 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 2/2] datapath-windows: return bool from NlFillOvs[Msg/Hdr] Per review comment, in this patch, we update the return values of NlFillOvsMsg() and NlFillOvsHdr() from NTSTATUS to BOOLEAN to make them consistent with the Nl* functions. Signed-off-by: Nithin Raju nit...@vmware.com --- datapath-windows/ovsext/Flow.c| 31 ++-- datapath-windows/ovsext/Netlink/Netlink.c |8 +++--- datapath-windows/ovsext/Netlink/Netlink.h | 12 +- datapath-windows/ovsext/User.c| 12 +++--- datapath-windows/ovsext/Vport.c | 30 ++-- 5 files changed, 53 insertions(+), 40 deletions(-) diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index f50bb39..93f37a0 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -247,6 +247,7 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, UINT32 *replyLen) { NTSTATUS rc = STATUS_SUCCESS; +BOOLEAN ok; POVS_MESSAGE msgIn = (POVS_MESSAGE)usrParamsCtx-inputBuffer; POVS_MESSAGE msgOut = (POVS_MESSAGE)usrParamsCtx-outputBuffer; PNL_MSG_HDR nlMsgHdr = (msgIn-nlMsg); @@ -258,7 +259,6 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, OvsFlowStats stats; struct ovs_flow_stats replyStats; NL_ERROR nlError = NL_ERROR_SUCCESS; - NL_BUFFER nlBuf; RtlZeroMemory(mappedFlow, sizeof(OvsFlowPut)); @@ -294,13 +294,14 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, usrParamsCtx-outputLength); /* Prepare nl Msg headers */ -rc = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, 0, +ok = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, 0, nlMsgHdr-nlmsgSeq, nlMsgHdr-nlmsgPid, genlMsgHdr-cmd, OVS_FLOW_VERSION, ovsHdr-dp_ifindex); - -if (rc == STATUS_SUCCESS) { +if (ok) { *replyLen = msgOut-nlMsg.nlmsgLen; +} else { +rc = STATUS_INVALID_BUFFER_SIZE; } } @@ -330,13 +331,15 @@ OvsFlowNlCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, usrParamsCtx-outputLength); /* Prepare nl Msg headers */ -rc = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, 0, +ok = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, 0, nlMsgHdr-nlmsgSeq, nlMsgHdr-nlmsgPid, genlMsgHdr-cmd, OVS_FLOW_VERSION, ovsHdr-dp_ifindex); - -if (rc != STATUS_SUCCESS) { +if (!ok) { +rc = STATUS_INVALID_BUFFER_SIZE; goto done; +} else { +rc = STATUS_SUCCESS; } /* Append OVS_FLOW_ATTR_STATS attribute */ @@ -586,15 +589,20 @@ _FlowNlDumpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, /* Done with Dump, send NLMSG_DONE */ if (!(dumpOutput.n)) { +BOOLEAN ok; + OVS_LOG_INFO(Dump Done); nlMsgOutHdr = (PNL_MSG_HDR)(NlBufAt(nlBuf, NlBufSize(nlBuf), 0)); -rc = NlFillNlHdr(nlBuf, NLMSG_DONE, NLM_F_MULTI, +ok = NlFillNlHdr(nlBuf, NLMSG_DONE, NLM_F_MULTI, nlMsgHdr-nlmsgSeq, nlMsgHdr-nlmsgPid); -if (rc != STATUS_SUCCESS) { +if (!ok) { +rc = STATUS_INVALID_BUFFER_SIZE; OVS_LOG_ERROR(Unable to prepare DUMP_DONE reply.); break; +} else { +rc = STATUS_SUCCESS; } NlMsgAlignSize(nlMsgOutHdr); @@ -603,17 +611,18 @@ _FlowNlDumpCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, FreeUserDumpState(instance); break; } else { +BOOLEAN ok; hdrOffset = NlBufSize(nlBuf); nlMsgOutHdr = (PNL_MSG_HDR)(NlBufAt(nlBuf, hdrOffset, 0)); /* Netlink header */ -rc = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, NLM_F_MULTI, +ok = NlFillOvsMsg(nlBuf, nlMsgHdr-nlmsgType, NLM_F_MULTI, nlMsgHdr-nlmsgSeq, nlMsgHdr-nlmsgPid, genlMsgHdr-cmd, genlMsgHdr-version, ovsHdr-dp_ifindex); -if (rc != STATUS_SUCCESS) { +if (!ok) { /* Reset rc to success so that we can * send already added messages to user space. */ rc = STATUS_SUCCESS; diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c index 0d48d08..589e3a1 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.c +++ b
Re: [ovs-dev] [PATCH 1/3] datapath-windows: Move Build*Msg() to Netlink.c
Acked-by: Eitan Eliahu elia...@vmware.com Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Nithin Raju Sent: Wednesday, December 03, 2014 7:56 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH 1/3] datapath-windows: Move Build*Msg() to Netlink.c Moving the functions that build netlink messages to Netlink.c from Vport.c Signed-off-by: Nithin Raju nit...@vmware.com --- datapath-windows/ovsext/Datapath.h| 14 datapath-windows/ovsext/Netlink/Netlink.c | 37 ++ datapath-windows/ovsext/Netlink/Netlink.h | 13 datapath-windows/ovsext/Vport.c | 47 +++- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h index e436699..2e3bac5 100644 --- a/datapath-windows/ovsext/Datapath.h +++ b/datapath-windows/ovsext/Datapath.h @@ -25,14 +25,6 @@ #define __DATAPATH_H_ 1 /* - * 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; - -/* * Device operations to tag netlink commands with. This is a bitmask since it * is possible that a particular command can be invoked via different device * operations. @@ -98,12 +90,6 @@ NTSTATUS OvsCompleteIrpRequest(PIRP irp, ULONG_PTR infoPtr, NTSTATUS status); VOID OvsAcquireCtrlLock(); VOID OvsReleaseCtrlLock(); -/* XXX: Move this to netlink.[ch] eventually. */ -VOID BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, -UINT16 flags); -VOID BuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgOut, - UINT errorCode); - /* * Utility structure and functions to collect in one place all the parameters * passed during a call from userspace. diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c index ae10a87..7633f2f 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.c +++ b/datapath-windows/ovsext/Netlink/Netlink.c @@ -102,6 +102,43 @@ NlFillNlHdr(PNL_BUFFER nlBuf, UINT16 nlmsgType, return writeOk ? STATUS_SUCCESS : STATUS_INVALID_BUFFER_SIZE; } +static VOID +BuildMsgOut(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, UINT16 type, +UINT32 length, UINT16 flags) { +msgOut-nlMsg.nlmsgType = type; +msgOut-nlMsg.nlmsgFlags = flags; +msgOut-nlMsg.nlmsgSeq = msgIn-nlMsg.nlmsgSeq; +msgOut-nlMsg.nlmsgPid = msgIn-nlMsg.nlmsgPid; +msgOut-nlMsg.nlmsgLen = length; + +msgOut-genlMsg.cmd = msgIn-genlMsg.cmd; +msgOut-genlMsg.version = msgIn-genlMsg.version; +msgOut-genlMsg.reserved = 0; +} + +/* + * XXX: should move out these functions to a Netlink.c or to a +OvsMessage.c + * or even make them inlined functions in Datapath.h. Can be done after +the + * first sprint once we have more code to refactor. + */ +VOID +BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, UINT16 +flags) { +BuildMsgOut(msgIn, msgOut, msgIn-nlMsg.nlmsgType, sizeof(OVS_MESSAGE), +flags); +} + +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; } + /* * --- * Adds Netlink Header to the NL_BUF. diff --git a/datapath-windows/ovsext/Netlink/Netlink.h b/datapath-windows/ovsext/Netlink/Netlink.h index 438d857..18e40b1 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.h +++ b/datapath-windows/ovsext/Netlink/Netlink.h @@ -32,6 +32,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; + /* Netlink attribute types. */ typedef enum { @@ -86,6 +94,11 @@ NTSTATUS NlFillNlHdr(PNL_BUFFER nlBuf, UINT16 nlmsgType, UINT16 nlmsgFlags, UINT32 nlmsgSeq, UINT32 nlmsgPid); +VOID BuildReplyMsgFromMsgIn(POVS_MESSAGE msgIn, POVS_MESSAGE msgOut, +UINT16 flags); VOID +BuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgOut, + UINT errorCode); + /* Netlink message accessing the payload */ PVOID NlMsgAt(const PNL_MSG_HDR nlh, UINT32 offset); UINT32 NlMsgSize(const PNL_MSG_HDR nlh); diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index fc905b1..35f95bc 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -1631,44 +1631,6 @@ OvsWaitActivate(POVS_SWITCH_CONTEXT switchContext
[ovs-dev] [PATCH] datapath-windows: Add PID Number attribute for port notification / Fix logic
[1] User mode OVS expects to have the PID number in the port state notification command [2] Fix logic error-for-Windows-user-mode Signed-off-by: Eitan Eliahu elia...@vmware.com --- datapath-windows/ovsext/Datapath.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index b9d97f8..0a8ddc5 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -2148,7 +2148,7 @@ OvsPortFillInfo(POVS_USER_PARAMS_CONTEXT usrParamsCtx, PNL_BUFFER nlBuf) { NTSTATUS status; -BOOLEAN rc; +BOOLEAN ok; OVS_MESSAGE msgOutTmp; PNL_MSG_HDR nlMsg; POVS_VPORT_ENTRY vport; @@ -2177,8 +2177,8 @@ OvsPortFillInfo(POVS_USER_PARAMS_CONTEXT usrParamsCtx, } msgOutTmp.ovsHdr.dp_ifindex = gOvsSwitchContext-dpNo; -rc = NlMsgPutHead(nlBuf, (PCHAR)msgOutTmp, sizeof msgOutTmp); -if (!rc) { +ok = NlMsgPutHead(nlBuf, (PCHAR)msgOutTmp, sizeof msgOutTmp); +if (!ok) { status = STATUS_INVALID_BUFFER_SIZE; goto cleanup; } @@ -2189,10 +2189,12 @@ OvsPortFillInfo(POVS_USER_PARAMS_CONTEXT usrParamsCtx, goto cleanup; } -rc = NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_PORT_NO, eventEntry-portNo) || - NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_TYPE, vport-ovsType) || +ok = NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_PORT_NO, eventEntry-portNo) + NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_TYPE, vport-ovsType) + NlMsgPutTailU32(nlBuf, OVS_VPORT_ATTR_UPCALL_PID, + vport-upcallPid) NlMsgPutTailString(nlBuf, OVS_VPORT_ATTR_NAME, vport-ovsName); -if (!rc) { +if (!ok) { status = STATUS_INVALID_BUFFER_SIZE; goto cleanup; } -- 1.9.4.msysgit.2 ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Fix BSOD when uninstalling driver
Hi Alin, Thank you for fixing this issue. Do you think we can acquire the lock in OvsDeleteFlowTable() ? Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean Sent: Tuesday, November 25, 2014 9:09 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Fix BSOD when uninstalling driver Add an additional check to see if the flowTable is not NULL. kd k Child-SP RetAddr Call Site d000`26166af8 f802`dde5e7c6 nt!DbgBreakPointWithStatus d000`26166b00 f802`dde5e0d7 nt!KiBugCheckDebugBreak+0x12 d000`26166b60 f802`51a4 nt!KeBugCheck2+0x8ab d000`26167270 f802`ddde0be9 nt!KeBugCheckEx+0x104 d000`261672b0 f802`f43a nt!KiBugCheckDispatch+0x69 d000`261673f0 f800`024cb4d4 nt!KiPageFault+0x23a d000`26167580 f800`024cc3ef OVSExt!OvsDoDumpFlows+0xa0 [c:\work\ovs\datapath-windows\ovsext\flow.c @ 2015] d000`261675e0 f800`024d134c OVSExt!_FlowNlDumpCmdHandler+0x197 [c:\work\ovs\datapath-windows\ovsext\flow.c @ 590] d000`26167740 f800`024e128f OVSExt!InvokeNetlinkCmdHandler+0x6c [c:\work\ovs\datapath-windows\ovsext\datapath.c @ 952] d000`26167770 f800`0053bc18 OVSExt!OvsDeviceControl+0x263 [c:\work\ovs\datapath-windows\ovsext\datapath.c @ 862] d000`26167840 f802`de04f395 NDIS!ndisDummyIrpHandler+0x88 d000`26167870 f802`de04fd2a nt!IopXxxControlFile+0x845 d000`26167a20 f802`ddde08b3 nt!NtDeviceIoControlFile+0x56 d000`26167a90 `775a2772 nt!KiSystemServiceCopyEnd+0x13 `009eee88 `775a2371 wow64cpu!CpupSyscallStub+0x2 `009eee90 `775c323a wow64cpu!DeviceIoctlFileFault+0x31 `009eef40 `775c317e wow64!RunCpuSimulation+0xa `009eef90 7ffb`c1ca6bd0 wow64!Wow64LdrpInitialize+0x172 `009ef4d0 7ffb`c1ca6aa6 ntdll!_LdrpInitialize+0xd8 `009ef540 ` ntdll!LdrInitializeThunk+0xe kd !analyze -v *** * * *Bugcheck Analysis* * * *** DRIVER_IRQL_NOT_LESS_OR_EQUAL (d1) An attempt was made to access a pageable (or completely invalid) address at an interrupt request level (IRQL) that is too high. This is usually caused by drivers using improper addresses. If kernel debugger is available get stack backtrace. Arguments: Arg1: , memory referenced Arg2: 0002, IRQL Arg3: , value 0 = read operation, 1 = write operation Arg4: f800024cb4d4, address which referenced memory Debugging Details: -- KERNEL32.DLL was not found in the image list. Debugger will attempt to load KERNEL32.DLL at given base `. Please provide the full image name, including the extension (i.e. kernel32.dll) for more reliable results.Base address and size overrides can be given as .reload image.ext=base,size. Unable to add module at ` READ_ADDRESS: CURRENT_IRQL: 2 FAULTING_IP: OVSExt!OvsDoDumpFlows+a0 [c:\work\ovs\datapath-windows\ovsext\flow.c @ 2015] f800`024cb4d4 488b18 mov rbx,qword ptr [rax] DEFAULT_BUCKET_ID: WIN8_DRIVER_FAULT BUGCHECK_STR: AV PROCESS_NAME: ovs-vswitchd.e ANALYSIS_VERSION: 6.3.9600.17237 (debuggers(dbg).140716-0327) amd64fre TRAP_FRAME: d000261673f0 -- (.trap 0xd000261673f0) NOTE: The trap frame does not contain all registers. Some register values may be zeroed or incorrect. rax= rbx= rcx= rdx=d000261675e0 rsi= rdi= rip=f800024cb4d4 rsp=d00026167580 rbp= r8=d00026167601 r9= r10=c00d r11=d000261677b0 r12= r13= r14= r15= iopl=0 nv up ei pl zr na po nc OVSExt!OvsDoDumpFlows+0xa0: f800`024cb4d4 488b18 mov rbx,qword ptr [rax] ds:`= Resetting default scope LAST_CONTROL_TRANSFER: from f802dde5e7c6 to f802bc90 STACK_TEXT: d000`26166af8 f802`dde5e7c6 : ` ` d000`26166c60 f802`ddd83654 : nt!DbgBreakPointWithStatus d000`26166b00 f802`dde5e0d7 : `0003 d000`26166c60 f802`ddde3070 `00d1 : nt!KiBugCheckDebugBreak+0x12 d000`26166b60 f802`51a4 : ` `0001 f6fb` d000`26e0 : nt!KeBugCheck2+0x8ab d000`26167270 f802`ddde0be9 : `000a ` `0002 ` : nt!KeBugCheckEx+0x104
Re: [ovs-dev] [PATCH] datapath-windows: Update OVSEXT VS project to support 6.40
Hi Sorin, Can we have Win8.1 DDK for both NDIS 6.40 and NDIS 6.30 drivers? We don't want to have 6.30 driver built with not current DDK. Thanks, Eitan Acked-by: Eitan Eliahu elia...@vmware.com -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, November 24, 2014 8:18 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Update OVSEXT VS project to support 6.40 Added support for creating OVS extension driver NDIS 6.40 compliant. Currently the OVSEXT Visual Studio project has four build configurations, 'Win8 Release', 'Win8 Debug', 'Win8.1 Release' and 'Win8.1 Debug'. All of them are creating a binary that is NDIS 6.30 compliant. I have changed the Win8.1 build configurations in order to create a binary that is NDIS 6.40 compliant. In this way, the OVSEXT project is able to create a release/debug binary that is NDIS 6.30 compliant, using the 'Win8 Release' and 'Win8 Debug' build configurations, as well as a release/debug binary that is NDIS 6.40 compliant, using the 'Win8.1 Release' and 'Win8.1 Debug' build configurations. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com --- datapath-windows/ovsext/ovsext.vcxproj | 35 +- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj index 88c9122..693bc50 100644 --- a/datapath-windows/ovsext/ovsext.vcxproj +++ b/datapath-windows/ovsext/ovsext.vcxproj @@ -102,7 +102,7 @@ PropertyGroup TargetNameOVSExt/TargetName /PropertyGroup - ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8 + Release|x64' ClCompile PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions /ClCompile @@ -113,6 +113,39 @@ PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions /ResourceCompile /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8.1 Release|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8 Debug|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8.1 Debug|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup ItemDefinitionGroup Link AdditionalDependencies%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)\fwpkclnt.lib;$(SDK_LIB_PATH)\uuid.lib;$(DDK_LIB_PATH)\netio.lib/AdditionalDependencies -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=Vvf3Ian_SaQZWBuLksgcYMJrE9Z1Gpp3lbgkr1MkdbAs=x19l9o7TC5LKuchoj9q1j83Kk8gulY8hOKnaWhpDGsYe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH v2] datapath-windows: Update OVSEXT VS project to support 6.40
Sorin, did you remove Win8 project? Can we have 8.1 WInDDK libraries for both 6.30 and 6.40 drivers? Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Monday, November 24, 2014 9:03 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH v2] datapath-windows: Update OVSEXT VS project to support 6.40 Added support for creating OVS extension driver NDIS 6.40 compliant. Currently the OVSEXT Visual Studio project has four build configurations, 'Win8 Release', 'Win8 Debug', 'Win8.1 Release' and 'Win8.1 Debug'. All of them are creating a binary that is NDIS 6.30 compliant. I have changed the Win8.1 build configurations in order to create a binary that is NDIS 6.40 compliant. In this way, the OVSEXT project is able to create a release/debug binary that is NDIS 6.30 compliant, using the 'Win8 Release' and 'Win8 Debug' build configurations, as well as a release/debug binary that is NDIS 6.40 compliant, using the 'Win8.1 Release' and 'Win8.1 Debug' build configurations. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Acked-by: Eitan Eliahu elia...@vmware.com --- datapath-windows/ovsext/ovsext.vcxproj | 35 +- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj index 88c9122..693bc50 100644 --- a/datapath-windows/ovsext/ovsext.vcxproj +++ b/datapath-windows/ovsext/ovsext.vcxproj @@ -102,7 +102,7 @@ PropertyGroup TargetNameOVSExt/TargetName /PropertyGroup - ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8 + Release|x64' ClCompile PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions /ClCompile @@ -113,6 +113,39 @@ PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions /ResourceCompile /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8.1 Release|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8 Debug|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup + ItemDefinitionGroup Condition='$(Configuration)|$(Platform)'=='Win8.1 Debug|x64' +ClCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ClCompile +Midl + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/Midl +ResourceCompile + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1/PreprocessorDefinitions +/ResourceCompile + /ItemDefinitionGroup ItemDefinitionGroup Link AdditionalDependencies%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)\fwpkclnt.lib;$(SDK_LIB_PATH)\uuid.lib;$(DDK_LIB_PATH)\netio.lib/AdditionalDependencies -- 1.9.0.msysgit.0 ___ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_devd=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=LrfnoGch9G6_TPkJ5ZHRsNTI3exzEFBiWaD6dUH_zFQs=n4bOIxBT0f4aoMlS1R30ZavdqgdgJLZAj9W5yK21nAMe= ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] datapath-windows: Support for hybrid forwarding
Hi Sorin, This change applies only for 6.40 drivers. Unless we bump the driver version this code has no effect. You may want to bump the minor version. #define NDIS_FILTER_MAJOR_VERSION 6 #define NDIS_FILTER_MINOR_VERSION 30 40 driverChars.MajorNdisVersion = NDIS_FILTER_MAJOR_VERSION; driverChars.MinorNdisVersion = NDIS_FILTER_MINOR_VERSION; Thanks, Eitan -Original Message- From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Sorin Vinturis Sent: Friday, November 21, 2014 8:16 AM To: dev@openvswitch.org Subject: [ovs-dev] [PATCH] datapath-windows: Support for hybrid forwarding In a hybrid forwarding environment, there are two types of packets that enter and leave the Hyper-V extensible switch: NVGRE packets and non-NVGRE packets. Hybrid forwarding involves filtering the incoming traffic based on packet type. Thus, we must split the incoming traffic into NVGRE and non-NVGRE packets. All non-NVGRE traffic is forwarded by the OVS extension and processed as usual, and the NVGRE traffic is passed to NDIS to be handled by the HNV module. Currently, the OVS extension supports only NDIS 6.30, but hybrid forwarding involves supporting NDIS 6.40. Thus, I have changed the necessary compiler settings to reflect this. More details about hybrid forwarding and the necessary NDIS 6.40 support is provided in issue #52. Signed-off-by: Sorin Vinturis svintu...@cloudbasesolutions.com Reported-by: Nithin Raju nit...@vmware.com Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_52d=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCYm=IF9N0kgUMpt8gOjYSq3_AJkSJSQlF85oyI1sxDSezaEs=KskXnDJSk-dizBlmk1XJga2EXqtmL6-7g7HTZF0rEloe= --- datapath-windows/ovsext/PacketIO.c | 33 +++-- datapath-windows/ovsext/ovsext.vcxproj | 6 +++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/PacketIO.c b/datapath-windows/ovsext/PacketIO.c index 1af391b..d022c45 100644 --- a/datapath-windows/ovsext/PacketIO.c +++ b/datapath-windows/ovsext/PacketIO.c @@ -193,6 +193,10 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext, LIST_ENTRY missedPackets; UINT32 num = 0; OvsCompletionList completionList; +PNET_BUFFER_LIST extForwardedNbls = NULL; +PNET_BUFFER_LIST nativeForwardedNbls = NULL; +PNET_BUFFER_LIST *nextExtForwardNbl = extForwardedNbls; +PNET_BUFFER_LIST *nextNativeForwardedNbl = nativeForwardedNbls; dispatch = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(SendFlags)? NDIS_RWL_AT_DISPATCH_LEVEL : 0; @@ -201,8 +205,27 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext, InitializeListHead(missedPackets); OvsInitCompletionList(completionList, switchContext, sendCompleteFlags); - -for (curNbl = netBufferLists; curNbl != NULL; curNbl = nextNbl) { + +/* + * Split NBL list into NBLs to be forwarded by us, and those that require + * native forwarding. */ +for (curNbl = netBufferLists; curNbl != NULL; curNbl = nextNbl) { +nextNbl = curNbl-Next; +curNbl-Next = NULL; +fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(curNbl); + +if (fwdDetail-NativeForwardingRequired) { +*nextNativeForwardedNbl = curNbl; +nextNativeForwardedNbl = (curNbl-Next); +} +else +{ +*nextExtForwardNbl = curNbl; +nextExtForwardNbl = (curNbl-Next); +} +} + +for (curNbl = extForwardedNbls; curNbl != NULL; curNbl = nextNbl) { POVS_VPORT_ENTRY vport; UINT32 portNo; OVS_DATAPATH *datapath = switchContext-datapath; @@ -315,6 +338,12 @@ dropit: } } +if (nativeForwardedNbls) { +/* This is NVGRE encapsulated traffic and is forwarded to NDIS + * in order to be handled by the HNV module. */ +OvsSendNBLIngress(switchContext, nativeForwardedNbls, SendFlags); +} + /* Queue the missed packets. */ OvsQueuePackets(missedPackets, num); OvsFinalizeCompletionList(completionList); diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj index 88c9122..2a34f5d 100644 --- a/datapath-windows/ovsext/ovsext.vcxproj +++ b/datapath-windows/ovsext/ovsext.vcxproj @@ -104,13 +104,13 @@ /PropertyGroup ItemDefinitionGroup ClCompile - PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions + + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640 + =1/PreprocessorDefinitions /ClCompile Midl - PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1/PreprocessorDefinitions + + PreprocessorDefinitions%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640 + =1/PreprocessorDefinitions /Midl ResourceCompile -