From patchwork Tue May 30 20:26:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 100733 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp19940qge; Tue, 30 May 2017 13:26:58 -0700 (PDT) X-Received: by 10.200.50.67 with SMTP id y3mr28289446qta.27.1496176018578; Tue, 30 May 2017 13:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496176018; cv=none; d=google.com; s=arc-20160816; b=PL1+0r0QwGgWHHqM63lxJkwB7kvjsTXwFgF+p1k/HlQLTho0dwFJfTU/1bXEB/xrpS T/xgPt7wQiB6oLFf11UbE5N6hsOU1zTI0DSHeQInYWoI1wnLLbGDi79wHSlltUXlP+7L 5qleO1vNOMVt6588V//rcl1oztbN7IUzgDGZOo3/v1KMGdCg+XaMUc194BcSZIKpYGel KFQh6p6HWmuV5BI7gEL1iZdRj96Bul6xm6alAPvNTHRdWFKBuNVqlBz0u0Z81aiPrn4K SZpGa+HxPgazYQRJOwKthu8sTUkLO+dRuL++1w3172E6Em1t5nr1nJ6XC97PT95l5JqY 1izw== 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=7Gwvt1QYny7TgsOg/kz7FC/QnQ5+Vpyifhz3PtBNabI=; b=ljpAZauKOfOVz+iQLfYXVfhfBJyJ9s3B95azL3W/206mRMUvluECeIsHlhL+8dDwbO kjAEXvkUxCkiBqc8nyDEeq/8JZ/AkOWCp/tUEKv65jV3jEhAlXxUL66Gd3dTSRb+20zG 6Vwe3wACgcZGlGDxcrC/yhgoEBINbDVY7glf2sdHuxnGkRzxDw9CAg53ee04Skqrs6Xm X28pzqP4+IgLkjamQ6Q3AXsN9IqebvWS7hGIr1wYiOuSukcd6YjjnX1OB1QYpiwNyB6e 4Zn5bQJbPGDzuiaY6d9sNVXb5xlsICpPESUDo3+kOaA2BaDku4EXIMk2O53rM0gd5CP3 S6Mg== 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 96si7227819qkz.73.2017.05.30.13.26.58; Tue, 30 May 2017 13:26:58 -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 E067B60C19; Tue, 30 May 2017 20:26:57 +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 7256660C16; Tue, 30 May 2017 20:26: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 E539C60C17; Tue, 30 May 2017 20:26:51 +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 0B9CA60C14 for ; Tue, 30 May 2017 20:26:51 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id h4so126203747oib.3 for ; Tue, 30 May 2017 13:26:51 -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=7Gwvt1QYny7TgsOg/kz7FC/QnQ5+Vpyifhz3PtBNabI=; b=m3cZ8yeQx5EpQZjtIMvcEUjl/uGqDjbU1elazBFMcKgTri/XrAsh6xQ6eIIN3VgUWx ihhfXMB5NZS3T2fRIFM9LQSNAvD/CH7spGXtcpPKN1GmBSw5FJO3ps/HopKGjOqXyfJB Jc57sJriCDlZWwqSF8JcDM/b07aJ7Se6onWBN1lKwZYd73w1U6vJmXX25HtzuKbL//3h faDV06hTGEIXIHcF2XfPrCiYEdg6Shp0uX1bRjSP2RAUxoMOGwkZpsq5ktiUOGNcucBW 0i3BCLwS/8N2vNIRFc1V+4UaDvyUmcjs7ztBFy+YofdL28PKcYBQ3HrC+E8bzWURpxm0 rNUg== X-Gm-Message-State: AODbwcB5eQ0tyEq7CWsOAa+s5gePecvQw+PGG3C4MAOkJk/Ef8oGXFba j6j7u/o3oD7UcKlojLCrOWVr X-Received: by 10.157.50.41 with SMTP id t41mr11281099otc.199.1496176010253; Tue, 30 May 2017 13:26:50 -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 m60sm3113281otc.10.2017.05.30.13.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 13:26:49 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 30 May 2017 15:26:47 -0500 Message-Id: <20170530202647.21516-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [RFC API-NEXT PATCH] api: init: add unused feature hints to init struct 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" RFC based on discussions we had today regarding feature hints. Add an optimization hint, allow applications to indicate which ODP feature(s) they will not use. This may permit implementations to behave more efficiently if it knows that certain features will not be used by the application. Also add the new API odp_init_param_init() to initialize the odp_init_t to default values. Alternative: Should this be a separate parameter to odp_init_global()? Signed-off-by: Bill Fischofer --- include/odp/api/spec/init.h | 82 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) -- 2.11.0 diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 154cdf8f..ab2ec577 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -105,6 +105,78 @@ typedef int (*odp_log_func_t)(odp_log_level_t level, const char *fmt, ...); /** Replaceable abort function */ typedef void (*odp_abort_func_t)(void) ODP_NORETURN; +/** ODP Feature set. Used to inform implementation which + * ODP features will not be used by this application. Knowing this may + * improve implementation efficiency. + */ +typedef union odp_unused_feature_t { + uint64_t all_features; + struct { + /** APIs in atomic.h are not used */ + uint32_t atomic:1; + /** APIs in barrier.h are not used */ + uint32_t barrier:1; + /** APIs in buffer.h are not used */ + uint32_t buffer:1; + /** APIs in byteorder.h are not used */ + uint32_t byteorder:1; + /** APIs in classification.h are not used */ + uint32_t classification:1; + /** APIs in cpu.h are not used */ + uint32_t cpu:1; + /** APIs in cpumask.h are not used */ + uint32_t cpumask:1; + /** APIs in crypto.h are not used */ + uint32_t crypto:1; + /** APIs in errno.h are not used */ + uint32_t odp_errno:1; + /** APIs in event.h are not used */ + uint32_t event:1; + /** APIs in hash.h are not used */ + uint32_t hash:1; + /** APIs in ipsec.h are not used */ + uint32_t ipsec:1; + /** APIs in packet_flags.h are not used */ + uint32_t packet_flags:1; + /** APIs in packet.h are not used */ + uint32_t packet:1; + /** APIs in packet_io.h are not used */ + uint32_t packet_io:1; + /** APIs in packet_io_stats.h are not used */ + uint32_t packet_io_stats:1; + /** APIs in pool.h are not used */ + uint32_t pool:1; + /** APIs in queue.h are not used */ + uint32_t queue:1; + /** APIs in random.h are not used */ + uint32_t random:1; + /** APIs in rwlock.h are not used */ + uint32_t rwlock:1; + /** APIs in rwlock_recursive.h are not used */ + uint32_t rwlock_recursive:1; + /** APIs in schedule.h are not used */ + uint32_t schedule:1; + /** APIs in std_clib.h are not used */ + uint32_t std_clib:1; + /** APIs in sync.h are not used */ + uint32_t sync:1; + /** APIs in system_info.h are not used */ + uint32_t system_info:1; + /** APIs in thread.h are not used */ + uint32_t thread:1; + /** APIs in thrmask.h are not used */ + uint32_t thrmask:1; + /** APIs in ticketlock.h are not used */ + uint32_t ticketlock:1; + /** APIs in time.h are not used */ + uint32_t time:1; + /** APIs in timer.h are not used */ + uint32_t timer:1; + /** APIs in traffic_mngr.h are not used */ + uint32_t traffic_mngr:1; + }; +} odp_unused_feature_t; + /** * ODP initialization data * @@ -153,6 +225,10 @@ typedef struct odp_init_t { odp_log_func_t log_fn; /** Replacement for the default abort fn */ odp_abort_func_t abort_fn; + /** Hints to allow application to tell implementation which ODP + * features will not be used by this application. + */ + odp_unused_feature_t unused_features; } odp_init_t; /** @@ -165,6 +241,12 @@ typedef struct odp_init_t { * passing any required platform specific data. */ +/** + * 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); /** * Global ODP initialization