From patchwork Wed Oct 12 22:02:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 77592 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp639245qge; Wed, 12 Oct 2016 15:03:04 -0700 (PDT) X-Received: by 10.55.77.201 with SMTP id a192mr4003374qkb.198.1476309784568; Wed, 12 Oct 2016 15:03:04 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l133si4874221qke.126.2016.10.12.15.03.03; Wed, 12 Oct 2016 15:03:04 -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 B92A160970; Wed, 12 Oct 2016 22:03:03 +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 0F6F460898; Wed, 12 Oct 2016 22:02:58 +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 BE735608C8; Wed, 12 Oct 2016 22:02:55 +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 C01D360885 for ; Wed, 12 Oct 2016 22:02:54 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id t73so77158325oie.1 for ; Wed, 12 Oct 2016 15:02:54 -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=B4NjwcMCTSfsW0S6tt1i7g4Pq8YFcE/VTppFVyJ447s=; b=RgcuW/EmKUh7bGeRE+K0wPId24jLGd9scgRvkfHCg0TmNAL8rpo9XRQLwwd3Yvxyt8 7RYmyywv21ZAKX0WOMkm7eDOGWlBWabwwuI2EIPV6EbQAcX7o4KaOyPQ//aaLYPSxqR2 hnAkDHnMuHPu9WE3txf/cXIRXtdY0vf1eI94fxptel7JBjUbHQXn45a78oAXTlTEnr6h xla13XYCYynGpHfYCPa6glgH3G1SSXXRhg+vId5v2rcpSnq8KqPMtU47nCJ1Jcqk4fBE eyVanzgCrmwGNQlvgUM0U/snDbQGrD6DVg/HQ1VTeMoyaLdW007JpsqZcMS+rtVZKV7e +UGQ== X-Gm-Message-State: AA6/9RlRv8PiedkH/BWcXrEU1eeNJE4oLAtBFsyb05KpOjbP+aW1SFK0Ks5ivrdENi6N1+IH4P4= X-Received: by 10.202.74.197 with SMTP id x188mr2241189oia.155.1476309774206; Wed, 12 Oct 2016 15:02:54 -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 n8sm3493444oia.29.2016.10.12.15.02.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Oct 2016 15:02:53 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 12 Oct 2016 17:02:50 -0500 Message-Id: <1476309771-29533-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 1/2] 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 --- 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