From patchwork Tue Jun 13 12:55:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105160 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp449352obh; Tue, 13 Jun 2017 05:55:26 -0700 (PDT) X-Received: by 10.55.72.198 with SMTP id v189mr3124434qka.133.1497358526694; Tue, 13 Jun 2017 05:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497358526; cv=none; d=google.com; s=arc-20160816; b=uZsitg3JSKg6RbFPtrfRyLeLkaDItneHkX7/hXvy668bl4/o38VzlSo5WuEnkGMgdJ 6sSPGwc4PzV/vxkLT0gx5H6NchmYnGk9TiLlz3qvTCsnn37M5snLM38A9X8Z5F/hZ+CN MoQZEAH1LB5DB0u2r1aLalnfBzRmmfIWJxy89FVhfLyRp1oYIzQrjCiyor3Q83POPFs5 LxZG/bXpWys3Yg0qRx90mb06z0E0phDCR9fepFW4KZ+Rc7qYy6WaFMnBkKx+V3YcJE7L 9r7kFfQvTd9Ou1vvaA0s4v+Nl0YdYix8St6/6JzRtAVzATwcBaaHlBp+rCIzQUEHFsjG iUeg== 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=NIG5PxrpQMZvnqWmrVjMz/7loMJKm5nyCFCcRMAR1hM=; b=TXjriRnvaaPDTfQyhWcfvKYjRdAcwjVf3GgpTx13haNt1+Rvdmq/uAA36kn3YkGppZ mB6KENoCpDTT6KA9c+PMyKWxpzoWLpF4+xPfcJbB31iDNtLOlXO5tYj75Y0FF7f+shno K4wu83Mor0vajJeo6BZCsvUkqLPXQrEDwfgagnXx6OFZVbX/+0pRGs3kGvs4Tv9+10sq jUfrOWi96R3KCSi0WTVELeZXSjk2yi1f4xFaMJb+EGf7uvkYyNpuY9qm2RPynCWuAnIk P7MwjR6geMFATYpfW0uueP9QB+SQjcOhY8mB68u7Y0b2qovfAE4zSuf3yCyR012hTNv4 pZUw== 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 p37si7791059qtp.101.2017.06.13.05.55.26; Tue, 13 Jun 2017 05:55:26 -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 28A7360BF7; Tue, 13 Jun 2017 12:55:26 +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_DNSWL_NONE, 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 29C5E60BEE; Tue, 13 Jun 2017 12:55:22 +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 D2AC860BEE; Tue, 13 Jun 2017 12:55:19 +0000 (UTC) Received: from mail-ot0-f175.google.com (mail-ot0-f175.google.com [74.125.82.175]) by lists.linaro.org (Postfix) with ESMTPS id D72E8609E3 for ; Tue, 13 Jun 2017 12:55:18 +0000 (UTC) Received: by mail-ot0-f175.google.com with SMTP id k4so87013969otd.0 for ; Tue, 13 Jun 2017 05:55:18 -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=NIG5PxrpQMZvnqWmrVjMz/7loMJKm5nyCFCcRMAR1hM=; b=pC9vJNHOAuyajhaAvX4FPbdGlcuq3j4xXz3vHT14r/eeCwFetiezvbu6dr4M1oxQvG n76IgyUUgUNZVuoAxvXr5Pz5RHRzaSRSOeW/hNMzQO8mTU5nwH5gyFiGUDXKPtT0ZlJr 6Npsk6y5ObDsqeXMcN3LM0hAYjI8R4trs3jfFxK3MyW+LZc6ajUZorAmU4ArH5JQyeGK uvSk95sPc3ErPGgDMwMLDWypUTDt7a/aiXswPfpKQL+XgvqXd9oZ+Qa4VTLkXrEo1SsX PFs5h+b0yynA0j/FmkbkE16WIwKAxOu2/Gh28IlGmPwoWUE/Ix1CijcNuuYuWtxY4Eyv MZhQ== X-Gm-Message-State: AKS2vOzUsF6HsepGGaf/60mlekMhZMDqcXJmL7KNDpfFoRwSxmMbX1Ct 3Y3vBEO64WVof85qV2wmB8BI X-Received: by 10.157.34.197 with SMTP id y63mr27004128ota.218.1497358518000; Tue, 13 Jun 2017 05:55:18 -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 f35sm6530517otd.15.2017.06.13.05.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:55:17 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:55:11 -0500 Message-Id: <20170613125515.24874-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT PATCHv7 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 | 69 ++++++++++++++++++++++++ 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, 107 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 Reviewed-by: Petri Savolainen diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h new file mode 100644 index 00000000..0cfc141d --- /dev/null +++ b/include/odp/api/spec/feature.h @@ -0,0 +1,69 @@ +/* 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, e.g., odp_cls_xxx(), odp_cos_xxx() */ + uint32_t cls:1; + + /** Crypto APIs, e.g., odp_crypto_xxx() */ + uint32_t crypto:1; + + /** IPsec APIs, e.g., odp_ipsec_xxx() */ + uint32_t ipsec:1; + + /** Scheduler APIs, e.g., odp_schedule_xxx() */ + uint32_t schedule:1; + + /** Time APIs are, e.g., odp_time_xxx() */ + uint32_t time:1; + + /** Timer APIs, e.g., odp_timer_xxx(), odp_timeout_xxx() */ + uint32_t timer:1; + + /** Traffic Manager APIs, 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