From patchwork Mon Jun 12 20:54:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 103675 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp105420qgd; Mon, 12 Jun 2017 13:54:50 -0700 (PDT) X-Received: by 10.55.50.203 with SMTP id y194mr6866964qky.40.1497300890311; Mon, 12 Jun 2017 13:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497300890; cv=none; d=google.com; s=arc-20160816; b=pqs2CF7c7zuoId72pUq27AvdlogF/rJIwmHVRjnYxIV8lusraCO9VQAjqhUAQcAzmF gqZB477b3fR1imfmYOedR1pIPG3Nd4ezT1TbbnRPMrzTC+3hiTec/5T0e7vJ7uGgl6Vi LQ3UTmwmolCO86G1Wj/GSYk2T4cfWchgxhH4cT2PIrWxl2q5YUIBOyxUzrhX2yDacI2T Te+KwmIHPKJoQpEJaIsA2VGZMk6UZu5yRnhBmrRDvZQt1YmIiyRyRPjXI6Aqqk5+wwPd nHyhWCQC0sx7sllAkGX/5K3BX6ywcM5HfpH0eDqUAle5cKLKirgZfVLN2ImmqCdWWJg1 YIRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :delivered-to:arc-authentication-results; bh=EO3a5OGc4pWEqqGiHKc48GgsToXJUdLUdeXLOhxGqvQ=; b=wKEkiGEXszlvfFU4Xb3RxYMMqipmhgLLxIo3RItF8Ja5dUk63k5U/9cWkN4WdPizHq Nh9GO+XyVEijnc6WdG/fH1amx9FyHiU1+URxL35DSwktgFeOJaprGayClH/i58guDWwH eFfTGScgLW0AvudqVybMF85A0EPgMGGErRkqL4IUmf5Xc8IKVn0KejiAh/NrKRDVrn8M +JVAnbU3tFSkElpOSD3N2CSz5uYwO18XPMPo2mkow0wy6cMM6kCw9MEKcm3XGdOo+J+R t/mSkIl0/SBIhng9P8pKgY1skmUV0yCSko7yAMGW5WwyfUGBTmf2e0M8BRDQ3sDgX5Az /K2A== ARC-Authentication-Results: i=1; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 40si3091499qtt.63.2017.06.12.13.54.49; Mon, 12 Jun 2017 13:54:50 -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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 612C060A36; Mon, 12 Jun 2017 20:54:49 +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=-0.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED, URIBL_SBL, URIBL_SBL_A 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 E365160993; Mon, 12 Jun 2017 20:54:42 +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 214806099C; Mon, 12 Jun 2017 20:54:40 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id 17B0C60956 for ; Mon, 12 Jun 2017 20:54:39 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id s3so58970135oia.0 for ; Mon, 12 Jun 2017 13:54:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EO3a5OGc4pWEqqGiHKc48GgsToXJUdLUdeXLOhxGqvQ=; b=Xic7U7Xgnqj2WXHS7zhjRUFuMY8cn9bDr97v7EESsdJo2Yumvtf6xDJtuSpem4hYhH 8fMspCxYafZazEQEyx8MpaYN5iPCyeUuW1byfQNA0fCXNDrSeJ0bBClmngPqf+as2Any 6Duw5dn6XiTIqomRXwjguX4UFOl5VCsroMZHMscPwiBPd1gux1Hx2ohA8KdxsZK6fBIx 6LZecEwoEpRVfIhGHxrVX+81zAvxRxbSW4/fP3wkHaMbeaQuIbwGIka2kJrzEfcHR6iF xw5Gu3qqH24jvFPS+TwkuaiOn4L3VauxJDC9I+EqgesnUfDeIJcHVBnI2qqNhwxsoe5M S/sw== X-Gm-Message-State: AODbwcBZ+a5higcuSNzqyFOz2Nmn4nI24VeHuYtTP1QQzu+CbbBMlSr1 AiE4DkuNmRpWWRqtpXXyCPYH X-Received: by 10.202.197.3 with SMTP id v3mr22517994oif.144.1497300878061; Mon, 12 Jun 2017 13:54:38 -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 y34sm5427056oty.53.2017.06.12.13.54.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 13:54:36 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 12 Jun 2017 15:54:30 -0500 Message-Id: <20170612205434.21993-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT PATCHv5 1/5] api: feature: add odp feature bits 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 new odp_feature_t bits that permit other APIs/components to refer to various ODP features. Signed-off-by: Bill Fischofer --- include/odp/api/spec/feature.h | 65 ++++++++++++++++++++++++ include/odp_api.h | 1 + platform/Makefile.inc | 1 + platform/linux-generic/Makefile.am | 3 +- platform/linux-generic/include/odp/api/feature.h | 34 +++++++++++++ 5 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 include/odp/api/spec/feature.h create mode 100644 platform/linux-generic/include/odp/api/feature.h -- 2.11.0 diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h new file mode 100644 index 00000000..dd8db780 --- /dev/null +++ b/include/odp/api/spec/feature.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP features. + * Define various ODP feature sets that can be referenced by other + * components. + */ + +#ifndef ODP_API_FEATURE_H_ +#define ODP_API_FEATURE_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @defgroup odp_features ODP_FEATURE + * ODP feature definitions + * @{ + */ + +/** Definition of ODP features */ +typedef union odp_feature_t { + /** All features */ + uint32_t all_feat; + + /** Individual feature bits */ + struct { + /** Classifier APIs are not used, e.g., odp_cls_xxx(), + * odp_cos_xxx() */ + uint32_t cls:1; + /** Crypto APIs are not used, e.g., odp_crypto_xxx() */ + uint32_t crypto:1; + /** IPsec APIs are not used, e.g., odp_ipsec_xxx() */ + uint32_t ipsec:1; + /** Scheduler APIs are not used, e.g., odp_schedule_xxx() */ + uint32_t schedule:1; + /** Time APIs are not used, e.g., odp_time_xxx(), + * odp_timeout_xxx() */ + uint32_t time:1; + /** Timer APIs are not used, e.g., odp_timer_xxx() */ + uint32_t timer:1; + /** Traffic Manager APIs are not used, e.g., odp_tm_xxx() */ + uint32_t tm:1; + } feat; +} odp_feature_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/include/odp_api.h b/include/odp_api.h index 8146e024..86232ee1 100644 --- a/include/odp_api.h +++ b/include/odp_api.h @@ -32,6 +32,7 @@ extern "C" { #include #include #include +#include #include #include #include diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 3d609aa7..9f856a15 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -32,6 +32,7 @@ odpapispecinclude_HEADERS = \ $(top_srcdir)/include/odp/api/spec/deprecated.h \ $(top_srcdir)/include/odp/api/spec/errno.h \ $(top_srcdir)/include/odp/api/spec/event.h \ + $(top_srcdir)/include/odp/api/spec/feature.h \ $(top_srcdir)/include/odp/api/spec/support.h \ $(top_srcdir)/include/odp/api/spec/hash.h \ $(top_srcdir)/include/odp/api/spec/hints.h \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 58c73767..b4bbd07e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -38,7 +38,7 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/deprecated.h \ $(srcdir)/include/odp/api/errno.h \ $(srcdir)/include/odp/api/event.h \ - $(srcdir)/include/odp/api/support.h \ + $(srcdir)/include/odp/api/feature.h \ $(srcdir)/include/odp/api/hash.h \ $(srcdir)/include/odp/api/hints.h \ $(srcdir)/include/odp/api/init.h \ @@ -59,6 +59,7 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/spinlock_recursive.h \ $(srcdir)/include/odp/api/std_clib.h \ $(srcdir)/include/odp/api/std_types.h \ + $(srcdir)/include/odp/api/support.h \ $(srcdir)/include/odp/api/sync.h \ $(srcdir)/include/odp/api/system_info.h \ $(srcdir)/include/odp/api/thread.h \ diff --git a/platform/linux-generic/include/odp/api/feature.h b/platform/linux-generic/include/odp/api/feature.h new file mode 100644 index 00000000..55a86a83 --- /dev/null +++ b/platform/linux-generic/include/odp/api/feature.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP features. + */ + +#ifndef ODP_PLAT_FEATURE_H_ +#define ODP_PLAT_FEATURE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odp_feature + * @{ + */ + +/** + * @} + */ + +#include + +#ifdef __cplusplus +} +#endif + +#endif