From patchwork Wed Mar 23 22:19:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 64281 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp297404lbc; Wed, 23 Mar 2016 15:20:33 -0700 (PDT) X-Received: by 10.140.150.66 with SMTP id 63mr7065516qhw.91.1458771633236; Wed, 23 Mar 2016 15:20:33 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g72si3981869qkh.55.2016.03.23.15.20.32; Wed, 23 Mar 2016 15:20:33 -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 DF00D61840; Wed, 23 Mar 2016 22:20:32 +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 AB98C61846; Wed, 23 Mar 2016 22:19:48 +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 6122561840; Wed, 23 Mar 2016 22:19:42 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by lists.linaro.org (Postfix) with ESMTPS id 3B2946183B for ; Wed, 23 Mar 2016 22:19:37 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id u127so24883804oie.1 for ; Wed, 23 Mar 2016 15:19:37 -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=9+tMblx5CnWAGJXNX5zv/PeRBI/9oI/e3pz6I5W8FOI=; b=Cl0lqmIqbWC7xnCMCi42X+YXNyeEjDCzmH1JEd/+YqjEXVqq9nG03dbY2Q1pZ/7FVn wm6O31mwxgL6AO7Qro7xjzQ0HloauSCkFt6YYW4+pdjub+1KSV0AJKegXJ1Z5d5twdg+ VPrGxTQccdlzlw0dLqt4hq8nzvZUW8uifFy/H72U+HyH27AzYGxRfmn744L1V3uYYM09 tS2bo557fPcOkdkgbCF0km2xk31U9LMtfvOvmK0t/MKogk5bFG//fAjo/X7H68fBgIp7 n6yAWTcM+X16KJ1ez8sVzsoQaOPwE2m2A8wb3T3w5VsnwBNQSxpOug8NxOgFc21xYNXi 2MHg== X-Gm-Message-State: AD7BkJI+HbXX7/iOymuHTkcDo7kufQ18GNehJlnbjiBIifumr5jek2xAmHqh+SWtG2VQi4TDlhc= X-Received: by 10.157.17.72 with SMTP id p8mr3173828otp.162.1458771576817; Wed, 23 Mar 2016 15:19:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Mar 2016 15:19:36 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 23 Mar 2016 17:19:28 -0500 Message-Id: <1458771569-17717-3-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 3/4] linux-generic: pool: implement numa socket functions 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 default numa socket support including the functions odp_cpu_socket_id() and odp_cpu_socket_id_cpu() Signed-off-by: Bill Fischofer --- platform/linux-generic/include/odp/api/plat/pool_types.h | 2 ++ platform/linux-generic/odp_pool.c | 1 + platform/linux-generic/odp_thread.c | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/platform/linux-generic/include/odp/api/plat/pool_types.h b/platform/linux-generic/include/odp/api/plat/pool_types.h index 1ca8f02..8bbd6e1 100644 --- a/platform/linux-generic/include/odp/api/plat/pool_types.h +++ b/platform/linux-generic/include/odp/api/plat/pool_types.h @@ -30,6 +30,8 @@ typedef ODP_HANDLE_T(odp_pool_t); #define ODP_POOL_INVALID _odp_cast_scalar(odp_pool_t, 0xffffffff) +#define ODP_SOCKET_ID_ANY -1 + /** * Pool type */ diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index f6fa8f5..15405d0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -696,4 +696,5 @@ odp_pool_t odp_buffer_pool(odp_buffer_t buf) void odp_pool_param_init(odp_pool_param_t *params) { memset(params, 0, sizeof(odp_pool_param_t)); + params->socket_id = ODP_SOCKET_ID_ANY; } diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 420e4eb..19c3d65 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -217,6 +218,16 @@ int odp_cpu_id(void) return this_thread->cpu; } +uint32_t odp_cpu_socket_id(void) +{ + return ODP_SOCKET_ID_ANY; +} + +uint32_t odp_cpu_socket_id_cpu(int cpu_id ODP_UNUSED) +{ + return ODP_SOCKET_ID_ANY; +} + int odp_thrmask_worker(odp_thrmask_t *mask) { odp_thrmask_copy(mask, &thread_globals->worker);