From patchwork Mon Oct 24 21:29:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 79087 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2795140qge; Mon, 24 Oct 2016 14:30:40 -0700 (PDT) X-Received: by 10.31.222.66 with SMTP id v63mr12438544vkg.46.1477344640506; Mon, 24 Oct 2016 14:30:40 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h60si5288329uad.79.2016.10.24.14.30.40; Mon, 24 Oct 2016 14:30:40 -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 30F2661727; Mon, 24 Oct 2016 21:30:40 +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 D7A2B6172A; Mon, 24 Oct 2016 21:29:39 +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 61481616E6; Mon, 24 Oct 2016 21:29:34 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 746C260967 for ; Mon, 24 Oct 2016 21:29:30 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id y2so61107653oie.0 for ; Mon, 24 Oct 2016 14:29:30 -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=FLV01RZoubgU8YCVxcesTdcFuxnSjDLIB/72mIW1yFE=; b=gCxkiP17qqQiDwcnZW6kMDy+TFHGZLVThwBmuXzRjhh+Z3x2ZZXeclmI6kEqCfzuRC B32OQr+Dez6WhH8rltbhM7oFgCZpUFpu47+8XjvnqfZ7L/moBXY83p5zx9Ec3mgSm1Rj IBL0dSOubQ2gw+GU69NrgvRjTRDhRjV9jXZ01j3aQEpgX4HOs7tyDWyvoEriTenXPpbV uFdw+qS9wGTUhtu6viXRmWp9A9K/KlHZYkKr5jy+uFKhhRYaNbIPcH/9ZKdGb3NutkS2 1vZ75HCAtcu6MOdbDKJq1G/hhD3rPUIqJy4smHUOBTP0b1x5qeQl7MeEmoaNDpoOhh4B 52zg== X-Gm-Message-State: ABUngvc49K0tzWS0NlUT05593gAv5svMVqRlONDBB04x0btSPPzsn+iARJXN3+wbtbPgEa6KI3c= X-Received: by 10.157.20.131 with SMTP id d3mr2907294ote.135.1477344569874; Mon, 24 Oct 2016 14:29:29 -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 l37sm5868103otd.33.2016.10.24.14.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 14:29:28 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 24 Oct 2016 16:29:25 -0500 Message-Id: <1477344567-2561-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 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 v3: - Correct ODP_DEV_ANY to ODP_DEV_DEFAULT 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..76d861a --- /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_DEFAULT + * Default 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_DEFAULT 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