From patchwork Mon Jun 12 19:42:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 103669 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp81259qgd; Mon, 12 Jun 2017 12:42:17 -0700 (PDT) X-Received: by 10.200.39.178 with SMTP id w47mr22642705qtw.87.1497296537746; Mon, 12 Jun 2017 12:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497296537; cv=none; d=google.com; s=arc-20160816; b=P97fwp7GAnAGIADXCuoWKMpVRFiE9P76+eM1dTxfky9ypMzTwL4YBHm0tnqj/WHE21 6RU17OAvyeH2v2wsEGPn7T4WAeHZXTF6B75fyVeitaWYzm0gLSb2EADVb7e2wDc7Mim7 Ssf7otkBRBZwsniWrWlzZAA0GP8tVcEg9BNmgL9sDz+0gZ9agPYfjcaKyZ/VqBVQcXOQ MMwx9kW9NqHGl/UK48lpGui4IsDJ0N4bDsKhZ9KMClo1IA3W/XI88YfuAPsmUPfGS0xp n/rJMoHptmbcGoIb3/3cxLvpJIuuf4bAt6tpaRd49AyfCcb1tYgxZJy0DZ93RcKt5Wge vfvQ== 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=OMHu1FpTin0aIExMy8+b553zj0bQtjcy5fV1adKTRF0DLLdjBbX20xz2F2YWfSPrZI UiQND1V0dw9yeo5enVi08zN663Sqmr45ggMMvWa7OXHEKGtKSepbrllBv3O03MjCa4sb /Qwf+EPauKa3VMGiYXWO9yu5oqOfyLlyxyzFBf9YOGBT13UKUQoOBuTDrKr6JmxiZCDg X4HRoQThlfexQ+ABeyAG0XlX474Hq3QcFgKTF6GcquIXGT1L388w3GynxE6U70uJuBhR pelHWf9kguJTy6hFf/CqUy9tolbRZN/0XjSDpSj1vC/STP/fZ3C4S4naiF8si1Fypz6b Gc2A== 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 o32si4823719qko.165.2017.06.12.12.42.16; Mon, 12 Jun 2017 12:42:17 -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 8147960BEC; Mon, 12 Jun 2017 19:42:16 +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.3 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, 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 D6CB2609A8; Mon, 12 Jun 2017 19:42:11 +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 DD4A9609A8; Mon, 12 Jun 2017 19:42:09 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) by lists.linaro.org (Postfix) with ESMTPS id DF3E960993 for ; Mon, 12 Jun 2017 19:42:08 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id e11so18560457oia.2 for ; Mon, 12 Jun 2017 12:42:08 -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=AYKa7hxN90i8wcSjVFDFqFNR0xRIysYndDrpcRbROdjuFRwIqkEbRew6nnnVjj8FyJ SrDMpy6k+KLTUVG3unZsP58QDfCkF1R+PElV6AnSmqW+XmpEv6GRH8QtpHvh5MMiQ42+ z1AF1/uPOmuhhPm+uPB2BTU2MjLA9nEpOiwWDeobxp+aSWtYtPxnnDDgu7gHMekmYdbp DWEA/rfILhrg3M5eaGwzlVMLP+HMNTPs++/Oqj35thkayHzkcddbKyxpS4yWJr2iTshr ugNcMoA3a1DXHJy/Yj4u3BrFIdGFgdJd8ebr1C8PsVrkUkjENg+DMt8uStEF9Pvv0zKJ bftg== X-Gm-Message-State: AODbwcAwfDfaPlANQqO9hm30NQGjb5rxu50jY3fkT/Q2i21Qm/w4iB6H FIn8CWhagol/lNwA2v8zWVwX X-Received: by 10.202.192.67 with SMTP id q64mr32720579oif.65.1497296528040; Mon, 12 Jun 2017 12:42:08 -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 c93sm4698347otb.38.2017.06.12.12.42.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 12:42:06 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 12 Jun 2017 14:42:01 -0500 Message-Id: <20170612194205.8592-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT PATCHv4 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