From patchwork Tue Jun 13 12:03:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105156 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp367718qgd; Tue, 13 Jun 2017 05:04:07 -0700 (PDT) X-Received: by 10.55.20.30 with SMTP id e30mr17249976qkh.51.1497355447591; Tue, 13 Jun 2017 05:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497355447; cv=none; d=google.com; s=arc-20160816; b=kzmYy5T+JDBMe2znzjGnlZKAjeG+mceK4M6Kj/ZdlzHH4R/1+rfkDorz4OjtLywgG5 woOnwY/S2oXS+yqpKCiJ0MDTJzed4Kjk2jmeTlAGiEIlk46I8km3S5jg7IQ6pQmAVLuF ecm+kbAN4a1IllcbU1DN03yNytboi7vfWC8rWIQcrvA0RDv5VrEzPTqbL/W3DszC3rUX wCP7x/2MHZ2hj+IXdP6ck8nQtk9j0uF/Sa93cb3qmV9Nj+hbcQ68nREYQJv+WK+CHDl/ I3XyjeBiOPet5awhSQEanxRq7EXdqlQe5zFJq+Mu4V9SxwV6Hx4wlXxTqUA2c09oVJ+V +OiQ== 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=emsFHPntxKSFao0t0ViWhKBGPcLnfH7IQqYyjpI4x1I=; b=IpQ+w+PvOtQkk2o+W2eQ8qnFtbKfKM2J19uyCJXIPhQe10Au5DJR8IasxjH8YzX3ll J8HOlrQXn5Bug0RgNJYlwfslK3MojD0o8c0qXUC5eogMqfuLL+8A50NaYd/4YMTOIJ0U x6nov4NlIKLmLj89Xa9AAJIj/305S0q55/m4q65BCi4LPUcPGrlax1jLiQGUk/XAK1Kf tXTN9gZgX6uN6FL670ChfRWjZ98VvsTp7Rc48L+NeAEkzLa411lcBdho3hyWl1oCyfMk ZFXaEjbsHfY4+Cb+/8J4qXbAaGfBTa2XXTXkwgwSaEX7VcvyRzshYMdWIiNRv8XBTzAi PZIw== 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 p43si11516697qtf.187.2017.06.13.05.04.07; Tue, 13 Jun 2017 05:04:07 -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 A378F60BFE; Tue, 13 Jun 2017 12:04:06 +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 1EE3C60BF1; Tue, 13 Jun 2017 12:03:33 +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 985C660732; Tue, 13 Jun 2017 12:03:29 +0000 (UTC) Received: from mail-ot0-f174.google.com (mail-ot0-f174.google.com [74.125.82.174]) by lists.linaro.org (Postfix) with ESMTPS id 7CFF160732 for ; Tue, 13 Jun 2017 12:03:27 +0000 (UTC) Received: by mail-ot0-f174.google.com with SMTP id a2so86061707oth.2 for ; Tue, 13 Jun 2017 05:03:27 -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=emsFHPntxKSFao0t0ViWhKBGPcLnfH7IQqYyjpI4x1I=; b=cHP3w2BPptNoZFlClEFS5ukwAsfjH/G2dB/Oguwm8APm950cqN8sMLpE7Wc70Djrob s7LslCM/Z4OC2l4NNu85zQblDH5xIvLhX7HR32Woh51dRO8m5ZjgFDpXAPyymf90pbir t7swsb7kskyryOr2c8cuNWTF3k6hjPv7+u+M05kjWxDjvTTldWj/O3q81b00gpT+8rj0 AdCCvrR/eNGknpzuH1fvmRSuNZJ3Y+9DpuLJ4aBJKo16e+8vs+Klw/UHBczNzq2ybShZ NLWr/hqLPIvvtpJaJZw5HD4PARYKudYFKCLWD8R7KYErFuMybYBgnGJQFBuz0af7TOVO vkGA== X-Gm-Message-State: AODbwcDoaCCZ9MPMvY43tx9jIPWVeGYZql6bvQ1gJCbnR5qM+9dcgxK+ YmbKPtyeo1EOYfPaY02QjHOC X-Received: by 10.157.36.47 with SMTP id p44mr31140415ota.14.1497355406493; Tue, 13 Jun 2017 05:03:26 -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 p3sm6389439ota.51.2017.06.13.05.03.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:03:25 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:03:19 -0500 Message-Id: <20170613120323.30475-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT PATCHv6 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 | 63 ++++++++++++++++++++++++ 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, 101 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..aed1df01 --- /dev/null +++ b/include/odp/api/spec/feature.h @@ -0,0 +1,63 @@ +/* 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