[ovs-dev] [PATCH v6 1/6] datapath-windows: Percpu allocation support function

Nithin Raju nithin at vmware.com
Fri Mar 18 19:34:38 UTC 2016


Alternately, you could just do combination of
KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS) and make this code
future proof.

You’ll have to update the code in 2/6 patch also to use
GetCurrentProcessorNumberEx().

-- Nitin
 


-----Original Message-----
From: dev <dev-bounces at openvswitch.org> on behalf of Nithin Raju
<nithin at vmware.com>
Date: Friday, March 18, 2016 at 12:16 PM
To: "dev at openvswitch.org" <dev at openvswitch.org>, Sorin Vinturis
<svinturis at cloudbasesolutions.com>
Subject: Re: [ovs-dev] [PATCH v6 1/6] datapath-windows: Percpu allocation
support function

>I had a few comments, but looks good otherwise.
>
>Acked-by: Nithin Raju <nithin at vmware.com>
>
>>On 3/18/16, 7:58 AM, "Sorin Vinturis" <svinturis at cloudbasesolutions.com>
>>wrote:
>>
>>>Signed-off-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
>>>---
>>> datapath-windows/ovsext/Util.c | 14 ++++++++++++++
>>> datapath-windows/ovsext/Util.h |  1 +
>>> 2 files changed, 15 insertions(+)
>>>
>>>diff --git a/datapath-windows/ovsext/Util.c
>>>b/datapath-windows/ovsext/Util.c
>>>index 65dd132..fdd0209 100644
>>>--- a/datapath-windows/ovsext/Util.c
>>>+++ b/datapath-windows/ovsext/Util.c
>>>@@ -116,3 +116,17 @@ OvsCompareString(PVOID string1, PVOID string2)
>>>     RtlInitString(&str2, string2);
>>>     return RtlEqualString(&str1, &str2, FALSE);
>>> }
>>>+
>>>+VOID *
>>>+OvsAllocateMemoryPerCpu(size_t size, ULONG tag)
>>>+{
>>>+    VOID *ptr = NULL;
>>>+    ULONG count = KeQueryActiveProcessorCount(NULL);
>
>Since we are dealing with per-CPU variables now, I was thinking that we
>should also add:
>
>An ASSERT(KeQueryActiveGroupCount() == 1);
>
>Also, hot-add of CPU doesn¹t seem to be added. It may be ok to punt on
>that.
>
>Alternately, 
>
>_______________________________________________
>dev mailing list
>dev at openvswitch.org
>http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list