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 From patchwork Tue Jun 13 12:03:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105155 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp367347qgd; Tue, 13 Jun 2017 05:03:34 -0700 (PDT) X-Received: by 10.55.9.6 with SMTP id 6mr13239236qkj.163.1497355414443; Tue, 13 Jun 2017 05:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497355414; cv=none; d=google.com; s=arc-20160816; b=R2DfDM/f5gNZXVhM+kjgmjlr3xVXt0EGOaz8StlThp/h5tURXbGdE8IASbfPgwTsew ZF1js+qleTCJfAzDXut5uGF8635JrdnveB0c2xOjVKVodiuKHlQsHgR/b9fbmkRowqvy OTgCyacU8yUJ6wyqul8n5/66ea0HXg9izemZR8cd5Qk/1WZNy8O8LaxHmDjxACi1dL6i RXtdv4SfUPYJLrIF16+eG743qct7IlrA9QQnWoPuWB5bgR+ETMFKWt/EHSg1ioJ/vglu ptPRAB6Qq2bqG4jRlCGSoyU53qbmZ7fgWNwksdjfWSQ9+GNRh976PzzqncAF5sc0GyRo orNg== 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:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=lLVmjZKwMRjg60y5kCuHz9jPqw/+PsXr6rEBSu8fsMc=; b=j3BuaQUG0c34wcDE6uG2bcaqwjuSFgdXp/5fVHnaIZpVKV55ypl9bTTFrR7WN9eU6T 66wTikYA5TaO3TOha5S92Ex+9Fr7+ci6P1iLK/LBThfLgKyYqCrUbXLUWxBrRUFAvtOU yMBuIys6ntE43O2cL62nUGv520OGQtZ5iMXwceqYaSyDfXfZEVJgxzHFerc5xDqzx/Kb BR2iu0pQMVImIIke+uIXX9Aaw4x9pjxbi/zCaHpfn41dWXXvrt2oQlKH+W6JUr2lZmYK zt3zHpmxX+j11UcHs0HAgqAFP4qK4zK9Pg3ihzIv/lDPB4xrJCFPXeC8pCVjIeftlbwX cbqg== 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 u185si11390881qkd.28.2017.06.13.05.03.33; Tue, 13 Jun 2017 05:03:34 -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 9D99F60BF6; Tue, 13 Jun 2017 12:03:33 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED 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 8152D60AF1; Tue, 13 Jun 2017 12:03:30 +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 CB67C60B29; Tue, 13 Jun 2017 12:03:28 +0000 (UTC) Received: from mail-ot0-f177.google.com (mail-ot0-f177.google.com [74.125.82.177]) by lists.linaro.org (Postfix) with ESMTPS id EE5CC60A03 for ; Tue, 13 Jun 2017 12:03:27 +0000 (UTC) Received: by mail-ot0-f177.google.com with SMTP id k4so86050868otd.0 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:in-reply-to :references; bh=lLVmjZKwMRjg60y5kCuHz9jPqw/+PsXr6rEBSu8fsMc=; b=DGDsKY+F6iDJinA4bq8/SoieLrn2morahkNT2q60Fe1KVIh3X7oTtI7VI3YNbtB/Rk LsTEQaLE9XC/3eojGSdIqzph2A15D9rNRXgS8ccWTh/qDySSEJPEnl+u04mH0y3m3KjZ FRzDdKO7eAuNcZoDnXc8bZEHK+9BjTxBGsk3J+0U+X+bwGf6GcRX1QS9ejq/OegzxLNG LftiSBC5ThvFtlESwepVeqyDW74XCryzhhrDK4ZdN27y9q0my+SVH9BvjMV7p1teXrHG +lLh+1GqIyFzO67EBKSW9gX6rHk18z/LwOEZzFJD/7bS7F5F8R/bt+JNNMPTDAUYaVkF ZPUg== X-Gm-Message-State: AODbwcAIqol6+Z7VpRe5bFOcLyEYm1damMKpQ/lbG6rvQGcZsMW9O0N1 YlS7bH+BfQQB7BJimBzVIEbC X-Received: by 10.157.44.231 with SMTP id e36mr34938172otd.82.1497355407178; Tue, 13 Jun 2017 05:03:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:03:26 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:03:20 -0500 Message-Id: <20170613120323.30475-2-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613120323.30475-1-bill.fischofer@linaro.org> References: <20170613120323.30475-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv6 2/5] api: init: add support for unused features 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 not_used field to odp_init_t to permit applications to specify that they will not use various ODP features. This may allow implementations to provide optimized behavior. Also add the odp_init_param_init() API to initialize odp_init_t to default values. Signed-off-by: Bill Fischofer --- include/odp/api/spec/init.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.11.0 diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 154cdf8f..e8ec4113 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -29,6 +29,7 @@ extern "C" { #include #include +#include #include #include @@ -153,9 +154,23 @@ typedef struct odp_init_t { odp_log_func_t log_fn; /** Replacement for the default abort fn */ odp_abort_func_t abort_fn; + /** Unused features. These are hints to the ODP implementation that + * the application will not use any APIs associated with these + * features. Implementations may use this information to provide + * optimized behavior. Results are undefined if applications assert + * that a feature will not be used and it is used anyway. + */ + odp_feature_t not_used; } odp_init_t; /** + * Initialize the odp_init_t to default values for all fields + * + * @param[out] param Address of the odp_init_t to be initialized + */ +void odp_init_param_init(odp_init_t *param); + +/** * @typedef odp_platform_init_t * ODP platform initialization data * From patchwork Tue Jun 13 12:03:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105157 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp368001qgd; Tue, 13 Jun 2017 05:04:38 -0700 (PDT) X-Received: by 10.55.27.136 with SMTP id m8mr13735141qkh.196.1497355478322; Tue, 13 Jun 2017 05:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497355478; cv=none; d=google.com; s=arc-20160816; b=O5eBOTSX8t8DQnotHv34Avtec0N0OEPTwtXJm1mnUMRVacYubXxNEBUdUTJUfSBtNx oU4cOeeRYk5LetQ93POWs+Fvd/eraKj4khvSsgE/j8rsQJVwzUYjjzAeyPBmsW14JMsf WZVOulBnNTp8apwOisu/AKeHsJmvrQeZTGJLyOdXyx8LyaniPQD70g1uT22ICRuH+xQc KGpc3e2LVUBC2/rvdvaD9svxGSU1NkSoP1v40lJz1R7KX7XnncCpz//VAFQ1QhRB3ePC FxgeWfKZ/gIhIN8kH+Dlws75mUG7tVNJUoti9f2EG5HfuRBGeuLqpW1bU4qjleY8VRrb 3t4w== 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:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=LmNxT3Pg+LDeOg8Q5pmdwIYAflUaZ1hTS0cVH39Ttr4=; b=EhRyLT2TYvzxUgs3P4JIl59mh0Fd0PW4MNTulIRCtxfJo7i30ElodujefVDxJrse0z nfjiR/KGmGX7A+sBLBCn+kUEq6HKEmHBI87ic4PYhKjO9zdOWje2ZC9s8qX3IkizqnMY 2xbX1gER3sTugpLhIXZFbzvsbGQIR4YAERndr2ej9/GTFhLPWb8iKMnwBrNwLubNT5Pr o1TdK3kpMDfWRKq88+r1zPDKvrTsPMnPGMZ+WLRqe2EgsmyIpVjPfmHXzqVGrE5e14Ka IPcKXy3MfbYrOj5WHJsaiEbfvcnaGDgqKNzrFxXvex9PhM9c+VIfbQQyJ89pmIMLg0wd aSKQ== 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 p27si11559326qtf.293.2017.06.13.05.04.38; Tue, 13 Jun 2017 05:04:38 -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 F0F6460BF7; Tue, 13 Jun 2017 12:04:37 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED 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 1F32060A03; Tue, 13 Jun 2017 12:03:53 +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 2FD4B60BFE; Tue, 13 Jun 2017 12:03:50 +0000 (UTC) Received: from mail-ot0-f172.google.com (mail-ot0-f172.google.com [74.125.82.172]) by lists.linaro.org (Postfix) with ESMTPS id 0BE2160B2A for ; Tue, 13 Jun 2017 12:03:31 +0000 (UTC) Received: by mail-ot0-f172.google.com with SMTP id a2so86062768oth.2 for ; Tue, 13 Jun 2017 05:03:31 -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:in-reply-to :references; bh=LmNxT3Pg+LDeOg8Q5pmdwIYAflUaZ1hTS0cVH39Ttr4=; b=KeCSr+2Cc5BxSXVTNMpOSNqpp02T/W1hOhxJHJzTrupd1WNaj+IZLUeuYuTkJhvC0l kD/UoNOeGLb/Y1OAiWR02uTEJuE9LiBWkKIH0OZKmJgQBGjsW4DeOaun8pUvQgd0kUpA XkxmI6V9NvmpWkV53i1cTLLRptn0T/5cXgSdv4Hys1vXSPPe+Y7F40SFtZQQg+rLBYfU zarTNrdLpoGVLGPvaTgcimottbT7SsqQ5AzMRrfSMm1zFca+aqlZawVB9FIa7x1ui8na PHe1WtdoFeCq6j/jV+dEk1bQ3JwcjyfkXeDN5Hymqioyz4itl4I+9HKrNfisMwBDbgNi rGYw== X-Gm-Message-State: AKS2vOwpwJVez8T0aYRRrCujXMq0cBZHQkyoBqx0+rMKoqG+87jdNdwI W63GRDF7xjQ8yT1/5H7FVaAc X-Received: by 10.157.32.129 with SMTP id x1mr1393381ota.46.1497355410188; Tue, 13 Jun 2017 05:03:30 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:03:29 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:03:22 -0500 Message-Id: <20170613120323.30475-4-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613120323.30475-1-bill.fischofer@linaro.org> References: <20170613120323.30475-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv6 4/5] validation: init: use odp_init_param_init() in init tests 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" Provide test coverage for odp_init_param_init() API. Signed-off-by: Bill Fischofer --- test/common_plat/validation/api/init/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.11.0 diff --git a/test/common_plat/validation/api/init/init.c b/test/common_plat/validation/api/init/init.c index 61055fad..6f9556d7 100644 --- a/test/common_plat/validation/api/init/init.c +++ b/test/common_plat/validation/api/init/init.c @@ -24,10 +24,10 @@ static int odp_init_log(odp_log_level_t level, const char *fmt, ...); void init_test_odp_init_global_replace_abort(void) { int status; - struct odp_init_t init_data; + odp_init_t init_data; odp_instance_t instance; - memset(&init_data, 0, sizeof(init_data)); + odp_init_param_init(&init_data); init_data.abort_fn = &odp_init_abort; status = odp_init_global(&instance, &init_data, NULL); @@ -77,10 +77,10 @@ int init_main_abort(int argc, char *argv[]) void init_test_odp_init_global_replace_log(void) { int status; - struct odp_init_t init_data; + odp_init_t init_data; odp_instance_t instance; - memset(&init_data, 0, sizeof(init_data)); + odp_init_param_init(&init_data); init_data.log_fn = &odp_init_log; replacement_logging_used = 0; From patchwork Tue Jun 13 12:03:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105158 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp368276qgd; Tue, 13 Jun 2017 05:05:11 -0700 (PDT) X-Received: by 10.55.150.197 with SMTP id y188mr33122369qkd.26.1497355511661; Tue, 13 Jun 2017 05:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497355511; cv=none; d=google.com; s=arc-20160816; b=fZaurajfm/f6mQBdhLRL0XVS/6dnmAxmlZfd6CAMUIMl3DNJ2vc6XisMPY+IDijonl pQTcggR2v/xO7WSwJqboRaUhwGdrVAcNZwE3KtSzkz1NCcNGowgZ/Q3Rg5ps143p5+ak gGbQNVmM9gIQhzytuysSgRTvvFR94z9CsQA8n2fi569N5+IY1AN97dW1YQsLZYwd1I67 0L3ymF0v38MUe9ogTscmSVQLJ+/FBT0K5476D2qLZ8rf7y8MHBvY/9UvleVk8hiRm5Fm 9EgFXh9aVGh1Ql3jcq9119Gt8srohuqIuri10anuJOg+j73CtGNNqfPWwzF7x7aPR4Ie nJtA== 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:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=pk/gNV3fd6oeKOKecKjBBx2mY0K+G5WFcXJbM7Pl9Og=; b=XoI8nSj6xLBseYzwZdRViZhn9LjPeZFPh3ZqaonBXu1QlxVj0ZR8eSt5YiPA0dTPzv SUsJj+pcT6G+mjsiSHMUMKuBVf3pXnDer347f/jfDd6sgKfm1g+SANaQZRWrf1Ldn2ri SjvUjmABVaDgzbmkjZ6euJr6z/1PIw6qOp3QqKH5ElWXH2xPZk8XTS7NDu4VBEcNMh/I lnpmhz/PJrvHJymyOzKpKounJzbWiHY79ibYfj9nhAiLQpbl0qHNSXBeZKq8E2L89YLZ 44hLhERxtFLRKjdpMGbP2lShInEqaL1EdMksvmXwYvg8le4elPA4srjT71WcvHf1a2ZB cRbw== 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 4si4663832qkl.155.2017.06.13.05.05.11; Tue, 13 Jun 2017 05:05:11 -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 56B8960BF4; Tue, 13 Jun 2017 12:05:11 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED 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 D72C160B2A; Tue, 13 Jun 2017 12:04:02 +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 5051860BF6; Tue, 13 Jun 2017 12:03:59 +0000 (UTC) Received: from mail-ot0-f177.google.com (mail-ot0-f177.google.com [74.125.82.177]) by lists.linaro.org (Postfix) with ESMTPS id 73F5760BEE for ; Tue, 13 Jun 2017 12:03:32 +0000 (UTC) Received: by mail-ot0-f177.google.com with SMTP id k4so86052255otd.0 for ; Tue, 13 Jun 2017 05:03:32 -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:in-reply-to :references; bh=pk/gNV3fd6oeKOKecKjBBx2mY0K+G5WFcXJbM7Pl9Og=; b=QQ+xtr/k48wpeYsqhl7GsHNLDmT0q/k89as4S8ncTxGrhSXWfSkEivlJBXZ+iPe/cm qx1+3meQIhYAjrjI+YWQ0tpGtYHLBAMAZ4jJNu/daN28bY3vVc5KW5jNcYIL7svfOEMu 1E65zYTS5bUQrWlIRExcFl4DAIccEOErhjN7c+Pc8RQ7FS3ltNqTN9/vhy0eGPt5NRqe O44pASR0KQ5lA80slkLmfRLh7hJzxXjfbUncqrvf3cwH+nilw/9sX5QyhwsRV0gqTqS1 9nlKukWmaTvQtwwZ8GoUpvPuc0wg/nzNvS4oK2usUWucFpW8T3qcEBR4qVqBkzecnAz0 Oytw== X-Gm-Message-State: AODbwcBdAckb/FUB929faq8fDP5K8npVEaRVLQoWdrJY3IYEoQdfk9js gUMHL/1soNqfOqLXiLXbxTrH X-Received: by 10.157.25.7 with SMTP id j7mr28005478ota.175.1497355411626; Tue, 13 Jun 2017 05:03:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:03:30 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:03:23 -0500 Message-Id: <20170613120323.30475-5-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613120323.30475-1-bill.fischofer@linaro.org> References: <20170613120323.30475-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv6 5/5] doc: userguide: add odp_init_global() documentation for unused features 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" Update User Guide startup section to include current parameters for odp_init_global() and odp_init_local() as well as optimization hints for unused features. Signed-off-by: Bill Fischofer --- doc/users-guide/users-guide.adoc | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index ead8da5e..d78e0777 100755 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -530,20 +530,44 @@ calling the terminate functions should only be done when the application is sure it has closed the ingress and subsequently drained all queues, etc. === Startup -The first API that must be called by an ODP application is 'odp_init_global()'. +The first API that must be called by an ODP application is `odp_init_global()`: +[source,c] +----- +int odp_init_global(odp_instance_t *instance, + const odp_init_t *param, + const odp_platform_init_t *platform_param); +----- This takes two pointers. The first, `odp_init_t`, contains ODP initialization data that is platform independent and portable, while the second, `odp_platform_init_t`, is passed unparsed to the implementation to be used for platform specific data that is not yet, or may never be -suitable for the ODP API. +suitable for the ODP API. Each of these parameters is optional and may be +specified as NULL to accept the implementation-defined default initialization +values. -Calling odp_init_global() establishes the ODP API framework and MUST be +Calling `odp_init_global()` establishes the ODP API framework and MUST be called before any other ODP API may be called. Note that it is only called -once per application. Following global initialization, each thread in turn +once per application. A successful call to `odp_init_global()` returns rc = 0 +and sets the `instance` variable supplied as input to the call to an handle +representing this unique ODP instance. + +The `odp_init_t` parameter is used to specify various customizations to the +ODP environment being established by this call. For example, the caller can +specify the maximum number of worker threads it will use, the thread masks +associated with these threads, as well as whether the default logging or +abort functions are to be overridden with an application-supplied handler. + +The application may also provide optimization hints to the ODP implementation +if it knows that it will never use specific ODP feature sets, such as the +packet classifier or traffic manager. Implementations may use such hints to +provide optimized behavior to applications that are known not to need these +features. + +Following global initialization, each thread in turn calls 'odp_init_local()'. This establishes the local ODP thread context for that thread and MUST be called before other ODP APIs may be -called by that thread. The sole argument to this call is the _thread type_, -which is either `ODP_THREAD_WORKER` or `ODP_THREAD_CONTROL`. +called by that thread. The sole argument to this call is the `instance` +variable returned by `odp_init_global()`. === Shutdown Shutdown is the logical reverse of the initialization procedure, with