From patchwork Wed Mar 23 22:19:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 64280 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp297256lbc; Wed, 23 Mar 2016 15:20:08 -0700 (PDT) X-Received: by 10.55.22.162 with SMTP id 34mr6665446qkw.63.1458771608849; Wed, 23 Mar 2016 15:20:08 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u24si3951155qku.113.2016.03.23.15.20.08; Wed, 23 Mar 2016 15:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7E24F61806; Wed, 23 Mar 2016 22:20:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D7E8D6183E; Wed, 23 Mar 2016 22:19:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4A06061806; Wed, 23 Mar 2016 22:19:37 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by lists.linaro.org (Postfix) with ESMTPS id 232B861806 for ; Wed, 23 Mar 2016 22:19:36 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id d205so38463687oia.0 for ; Wed, 23 Mar 2016 15:19:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HMm+QyjQRIFfVC05LUHCgj1rdcWLw/opEmKV+gG0IvQ=; b=A5F0vxRHPj5LlgNz9oANKfqA3wjp6HK2fueSGLaUfr4jY1/a/ZTV+TlVhE0UkO+OYN Z1nZwuMnqlJ4w2LNcWPN+QeIuAIOuNIJceGcZDr7MpRqozN4Ivsaal2NKdljPFktyHSU mAl4cg+STIOthevM7He6szuGYp0aRJhJ2XtYorRQCxeSI1N7gm2H+t9s/EnwsOo1zujs M11BXqW9ddsyiHUNXCbCBy4Sn0OzXf95o8p5FMiWyX/6TrjX9Cj+qLqW6cAgP3w/IAqZ 1HeqrbXijB6Kz5wigVP4tGcz5nBex2iZ78xI9shIbAE2mwnQLwtYKvnLMVsckqDoFqlQ OJ/Q== X-Gm-Message-State: AD7BkJLfgmxT+67rcR30THylnT68OTwF8nwWzeYbSrdLfjjo6g7dnk5UnXDevfV6epjIngdSlSE= X-Received: by 10.157.59.5 with SMTP id z5mr3095763otb.153.1458771575711; Wed, 23 Mar 2016 15:19:35 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id p203sm1330444oif.16.2016.03.23.15.19.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Mar 2016 15:19:34 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 23 Mar 2016 17:19:27 -0500 Message-Id: <1458771569-17717-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458771569-17717-1-git-send-email-bill.fischofer@linaro.org> References: <1458771569-17717-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 2/4] api: cpu: add routines for obtaining socket ids X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add odp_cpu_socket_id() and odp_cpu_socket_id_cpu() routines Signed-off-by: Bill Fischofer --- include/odp/api/spec/cpu.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h index f0e20c4..d383c3b 100644 --- a/include/odp/api/spec/cpu.h +++ b/include/odp/api/spec/cpu.h @@ -36,6 +36,31 @@ 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 specific CPU on NUMA systems. + * Socket ID numbering is system specific. + * + * @param cpu_id ID of the CPU for which socket ID information is requested. + * + * @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. + */ +uint32_t odp_cpu_socket_id_cpu(int cpu_id); + +/** * CPU count * * Report the number of CPU's available to this ODP program.