From patchwork Fri Jan 29 02:44:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60771 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp853424lbb; Thu, 28 Jan 2016 18:45:25 -0800 (PST) X-Received: by 10.50.43.228 with SMTP id z4mr7341650igl.43.1454035525277; Thu, 28 Jan 2016 18:45:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o10si8633377igh.43.2016.01.28.18.45.21; Thu, 28 Jan 2016 18:45:25 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D53CB6672D; Fri, 29 Jan 2016 02:45:20 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Kfi8fy6L; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 F29E66672E; Fri, 29 Jan 2016 02:44:51 +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 C04756672A; Fri, 29 Jan 2016 02:44:48 +0000 (UTC) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by lists.linaro.org (Postfix) with ESMTPS id EFB4C6672A for ; Fri, 29 Jan 2016 02:44:47 +0000 (UTC) Received: by mail-ob0-f177.google.com with SMTP id is5so52530298obc.0 for ; Thu, 28 Jan 2016 18:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mkoJL5IBPeZEzeCKHablZnlEe3zm94+s9UTcZnUlicg=; b=Kfi8fy6LsPFQC+6ZyIMrayVRDWxPX65Z+pXN5k3KUf/QO+5D3WFtIl9cGUEThKZv5K p/PiywdcbQfpAfrKoVWwsgmaFnVSk22/m+pRiMzZXzO0e6LoQJPVgQPDAejc6uvhYTHK W4UG/a3pgj0LZwNlgtow34DGwLt11i+Cg7UVE= 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=mkoJL5IBPeZEzeCKHablZnlEe3zm94+s9UTcZnUlicg=; b=R6WCz4NmLixAalSHPhnR0ZrHlDVAlb4JRsxVeKigzYe1/RAWAZtHNPNdkxi/pU95Xp s3H2pyzgApj/9FCafu/MYm1dXBywPaDX24iVcNY5zEOmBphs/2SjohupPClawoYOF6JL PojIhbe3w3UP0Dvn/LY+uJ93Ce+Z7H8Oh2vKgArUzF4L0Gwv4z00tr4Hz6FoY94Pctg5 rI7DhuQJgNA3F/b7mOLuPDiB502wqRPy50GZB/0wuSWjcIW3vTCsDU9huAhr2Mds2f+E nWmKj1URL+3cpPmlDUlX02AgHtpPfhj5EUzuvJvbFyAjmZvs7RjG4eGZfURqvFEUse5X XGSg== X-Gm-Message-State: AG10YOSO8oEAMtmve6X2btHyxSoOsiw/yyrbQjZ0cA4oZpgPxFzIXjDj4QPFeyxT0noUKnUU7Gc= X-Received: by 10.182.200.201 with SMTP id ju9mr4750145obc.30.1454035487547; Thu, 28 Jan 2016 18:44:47 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id yr2sm506758obc.25.2016.01.28.18.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 18:44:47 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 28 Jan 2016 20:44:40 -0600 Message-Id: <1454035480-21776-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454035480-21776-1-git-send-email-bill.fischofer@linaro.org> References: <1454035480-21776-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [RFC API-NEXT PATCH 2/2] 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/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. + */ +uint32_t odp_cpu_socket_id_cpu(int cpu_id); + +/** * CPU count * * Report the number of CPU's available to this ODP program.