We'll be discussing this RFC on Monday's ARCH call. I'm certainly open to adding this if it's deemed useful. I do note that DPDK defines SOCK_ID_ANY to be -1 so I'd like to minimize translation overhead for odp-dpdk in this area as well.
On Fri, Jan 29, 2016 at 10:27 AM, Zoltan Kiss <zoltan.k...@linaro.org> wrote: > > > On 29/01/16 02:44, Bill Fischofer wrote: > >> Add odp_cpu_socket_id() and odp_cpu_socket_id_cpu() routines >> >> Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> >> --- >> include/odp/api/cpu.h | 23 +++++++++++++++++++++++ >> 1 file changed, 23 insertions(+) >> >> diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h >> index 4cbaf58..fe74825 100644 >> --- a/include/odp/api/cpu.h >> +++ b/include/odp/api/cpu.h >> @@ -36,6 +36,29 @@ extern "C" { >> int odp_cpu_id(void); >> >> /** >> + * CPU socket id >> + * >> + * Returns the socket id associated with the calling CPU on NUMA systems. >> + * Socket ID numbering is system specific. >> + * >> + * @return Socket ID of the calling CPU >> + * @retval ODP_SOCKET_ID_ANY If the caller is not running on a NUMA >> system. >> + */ >> +uint32_t odp_cpu_socket_id(void); >> + >> +/** >> + * CPU socket id of designated CPU >> + * >> + * Returns the socket id associated with a specified CPU on NUMA systems. >> + * Socket ID numbering is system specific. >> + * >> + * @return Socket ID of the designated CPU >> + * @retval ODP_SOCKET_ID_ANY If the specified CPU is unknown or caller is >> + * not running on a NUMA system. >> > > Maybe worth to differentiate between the two scenario with different > return value? To query for an invalid CPU sounds like a serious problem in > the application while the other is part of normal operation. > > > + */ >> +uint32_t odp_cpu_socket_id_cpu(int cpu_id); >> + >> +/** >> * CPU count >> * >> * Report the number of CPU's available to this ODP program. >> >>
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp