From patchwork Mon Oct 24 19:56:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 79067 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2759062qge; Mon, 24 Oct 2016 12:56:24 -0700 (PDT) X-Received: by 10.31.60.7 with SMTP id j7mr2854932vka.30.1477338984038; Mon, 24 Oct 2016 12:56:24 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 17si6091730uai.43.2016.10.24.12.56.23; Mon, 24 Oct 2016 12:56:24 -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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6693D61DFA; Mon, 24 Oct 2016 19:56:23 +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 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 3BAD16171D; Mon, 24 Oct 2016 19:56:19 +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 D78AB61DF2; Mon, 24 Oct 2016 19:56:16 +0000 (UTC) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) by lists.linaro.org (Postfix) with ESMTPS id 16B5C616E4 for ; Mon, 24 Oct 2016 19:56:16 +0000 (UTC) Received: by mail-oi0-f46.google.com with SMTP id i127so2660498oia.2 for ; Mon, 24 Oct 2016 12:56:16 -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; bh=uVtVvfpvjz7PD7HRcuzie4t2liVYchXHG/KblD3Icm0=; b=XeBeXOmCg7S1ld4h1TpMb8v3LbZITSjHU1tgsNoPkD1Ukuy17EPyK8aq1TdYGtUMms quIPrlxJhnDXQFM2ZFH1W/4Ai2qYbSJuqs1k/pz04gu18Nsui0f2kHaHd701kxmUTOoB kGqkJrTH23hefJCXhLEm6gJh2u9A28VwpKK2+fhfoGpfCKijARmq6qO3CApivebkKyQa d5HTHWpK5H5BrzZizF8nOuDmFWlqZ9EW4MHDTCO5kKiuMiLJmtPmhEtXptSjlTv/5qgy UcSfYBsGfaGYWJYTSIiI/tM+omPFFb8AXtyW0pUn4VupKWZ/hjMy5vs8Lm3BexJW4zkP +nMQ== X-Gm-Message-State: AA6/9RlYhCPnblNiOfF4nSgLviWKbbTakcywMmkbd+9Vxpgb7FvN+KPmc2PWsRV3AgilVpxL+Bk= X-Received: by 10.202.51.193 with SMTP id z184mr21544376oiz.9.1477338975382; Mon, 24 Oct 2016 12:56:15 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id e192sm5722144oic.22.2016.10.24.12.56.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 12:56:14 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 24 Oct 2016 14:56:10 -0500 Message-Id: <1477338972-17132-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 1/3] api: dev: add device apis for numa support 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add the odp_dev_id() API used for NUMA support Signed-off-by: Bill Fischofer --- Changes for v2: - Incorporate changes suggested by Petri include/odp/api/spec/dev.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 include/odp/api/spec/dev.h -- 2.7.4 diff --git a/include/odp/api/spec/dev.h b/include/odp/api/spec/dev.h new file mode 100644 index 0000000..1f7ed8b --- /dev/null +++ b/include/odp/api/spec/dev.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP device + */ + +#ifndef ODP_API_DEV_H_ +#define ODP_API_DEV_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @defgroup odp_dev ODP DEVICE + * Operations on devices + * @{ + */ + +/** + * @typedef odp_dev_t + * ODP Device + */ + +/** + * @def ODP_DEV_NAME_LEN + * Maximum device name length in chars + */ + +/** + * @def ODP_DEV_ANY + * Any device + */ + +/** + * @def ODP_DEV_INVALID + * Invalid device + */ + +/** + * Get Device ID by Name + * + * Get an implementation-defined device identifier from a device name. Device + * names are supplied as parameter info (command line, file, etc.) to the + * application. This routine translates this symbolic name into an internal + * identifier that can be used to define a device connection hierarchy for + * NUMA or other purposes. + * + * The reserved id ODP_DEV_ANY may be used as a "don't care" placeholder + * wherever a device id is required. + * + * @param name Name of the device + * + * @return Device ID + * @retval ODP_DEV_INVALID Device is unknown + */ +odp_dev_t odp_dev_id(const char *name); + +/** + * Get printable value for an odp_dev_t + * + * @param hdl odp_dev_t handle to be printed + * @return uint64_t value that can be used to print/display this + * handle + * + * @note This routine is intended to be used for diagnostic purposes + * to enable applications to generate a printable value that represents + * an odp_dev_t handle. + */ +uint64_t odp_dev_to_u64(odp_dev_t hdl); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include +#endif