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-boun...@openvswitch.org> on behalf of Nithin Raju <nit...@vmware.com> Date: Friday, March 18, 2016 at 12:16 PM To: "dev@openvswitch.org" <dev@openvswitch.org>, Sorin Vinturis <svintu...@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 <nit...@vmware.com> > >>On 3/18/16, 7:58 AM, "Sorin Vinturis" <svintu...@cloudbasesolutions.com> >>wrote: >> >>>Signed-off-by: Sorin Vinturis <svintu...@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@openvswitch.org >http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev