From patchwork Mon Oct 23 12:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116729 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4575280qgn; Mon, 23 Oct 2017 05:14:43 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RISJrVDeJyJ5/3RCtXtXNepnG+qyf6aLXJt22aop3pIaxSkqHa63c1LGA5Dsn5PBY7Vdnb X-Received: by 10.237.37.8 with SMTP id v8mr20135983qtc.275.1508760882934; Mon, 23 Oct 2017 05:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508760882; cv=none; d=google.com; s=arc-20160816; b=TsosZKxfFzX8fgeOIChzzrEAjHE9TFN/zm/Qs94sqmenw2xO5FnfPBGtECq54AtJSG +kV1Ml4uq6u0gYLnOtmRlePeKy+GxB9iwDTQoYVTpF3VCcrhMXzFsIup7Zr7KFAvj3cx uUR2wiePW1dSiwX9uMFJ0OL+1C3bvqK5wDmbCcOve3XYPWo4TUsP5CzFCJomgqnqUPTZ XGr5B4zBzEODlochMQNqbbSyF9pP0JAI7yUHakMKAXjKHjr+JdBlB/ORQx53SA/YYZl6 rbRDZkB2qvRl1Kc2qQEKkJWN/ZS+HxBUxrnmrArQxalpcwGw4zP2iLRMtqQIvPViiKiF tJ7Q== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=bUlAcuwjHp/EuzhIcLezN9/PvKaaz9jMJPqbDp9rRYk=; b=1Eqjnuz+mu5oG+t2C+eyXzoBuwHS2P4/ZhHZsNyE49cemx+xZwA5IXHdV7DazhGOZJ H8Ym7gekS9Q/U53mUELwyz0eoHjCwhVb/pwROcqNLlS4661omC7LvsHyFLjAZlN6Ck9b qTV43hf8h02Y2eaFucocv//Jh6/+dVJKzayfBkMA79pAw0CHbtdI6KwBIGzgcHfTnLrp Lcw4XoqFLc6fSqaRB7/GpFbu+8bFjQ8lTQdEnr23aQCU8VsCPqMawOwteLnAHfVExmpj ILg9YMYToOhB8qWvTuqSp0V2i32eEARD8CpOCIFrKUUiJLqzuNfbgeL5xqSckx4r6h7h NGfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 127si3558844qko.404.2017.10.23.05.14.42; Mon, 23 Oct 2017 05:14:42 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 9B1E26229D; Mon, 23 Oct 2017 12:14:42 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 2BD4D622A0; Mon, 23 Oct 2017 12:13:39 +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 04AA162291; Mon, 23 Oct 2017 12:13:33 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 5D68C62925 for ; Mon, 23 Oct 2017 12:00:27 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward104o.mail.yandex.net (Yandex) with ESMTP id E601E704DD1 for ; Mon, 23 Oct 2017 15:00:25 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id edBcyhJFFF-0PFePvLd; Mon, 23 Oct 2017 15:00:25 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0Pt8es2L; Mon, 23 Oct 2017 15:00:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:03 +0300 Message-Id: <1508760010-14064-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 1/8] api: pool: relax packet pool param num 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" From: Petri Savolainen Added packet pool parameter 'max_num', so that 'num' parameter can be round up by the implementation. Most implementations have a fixed segment size, and need this flexibility. For example, when 'len' is larger than the pool segment size, there may be e.g. 2 x 'num' segments in the poool, and thus it would be able to allocate 2 x 'num' small packets. When application needs to limit maximum number of packets on a pool, it can use the new max_num param for that. Otherwise, it would leave 'max_num' to zero (== no limit). Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ include/odp/api/spec/pool.h | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 221798ee8..f1c8b1158 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -164,10 +164,11 @@ int odp_pool_capability(odp_pool_capability_t *capa); /** * Pool parameters - * Used to communicate pool creation options. - * @note A single thread may not be able to allocate all 'num' elements - * from the pool at any particular time, as other threads or hardware - * blocks are allowed to keep some for caching purposes. + * + * A note for all pool types: a single thread may not be able to allocate all + * 'num' elements from the pool at any particular time, as implementations are + * allowed to store some elements (per thread and HW engine) for caching + * purposes. */ typedef struct odp_pool_param_t { /** Pool type */ @@ -192,17 +193,34 @@ typedef struct odp_pool_param_t { /** Parameters for packet pools */ struct { - /** The number of packets that the pool must provide - that are packet length 'len' bytes or smaller. - The maximum value is defined by pool capability - pkt.max_num. */ + /** Minimum number of 'len' byte packets. + * + * The pool must contain at least this many packets + * that are 'len' bytes or smaller. An implementation + * may round up the value, as long as the 'max_num' + * parameter below is not violated. The maximum value + * for this field is defined by pool capability + * pkt.max_num. + */ uint32_t num; - /** Minimum packet length that the pool must provide - 'num' packets. The number of packets may be less - than 'num' when packets are larger than 'len'. - The maximum value is defined by pool capability - pkt.max_len. Use 0 for default. */ + /** Maximum number of packets. + * + * This is the maximum number of packets of any length + * that can be allocated from the pool. The maximum + * value is defined by pool capability pkt.max_num. + * Use 0 when there's no requirement for the maximum + * number of packets. The default value is 0. + */ + uint32_t max_num; + + /** Minimum length of 'num' packets. + * + * The pool must contain at least 'num' packets up to + * this packet length (1 ... 'len' bytes). The maximum + * value for this field is defined by pool capability + * pkt.max_len. Use 0 for default. + */ uint32_t len; /** Maximum packet length that will be allocated from From patchwork Mon Oct 23 12:00:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116730 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4576261qgn; Mon, 23 Oct 2017 05:15:42 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TxZd16erB1xEIG5IsKN6Gkhj0TxKsv63EIkBfS6pWwjMizTofMaXYfx9c4L+J3TTRQg6N+ X-Received: by 10.55.149.70 with SMTP id x67mr18288417qkd.62.1508760942272; Mon, 23 Oct 2017 05:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508760942; cv=none; d=google.com; s=arc-20160816; b=mfUpzDe4fhZn7hP3ddeyn0R6ym1izSCQOuwEuPcwbTscQGSE/CIBCuSx+YnaDVxvjQ OZKp6IQSIdLHTq0K8PZz1E/JDepSA5VMw6pijctipp2M/G5bLn44GStSNGeHRxsMmf0o cIUTxf7Zyzc0EMlYezmyWkL0Cl9r4/g7vMLOn31FuBBu5CIguklVXZQYVJ8Dn4OqPdWa +LKGlhgwF+x8pF5ZVTOdl+6xF4pYT3nKqpt9g4G3vpMGNDKtjQ9QMdNU8f89T43wuF4K X5oaGO0en1xYT09lLPgOYPy1yFhZXwB3ua4ObofwugzMfjSDNdbENlloRE/mI0GyY3x/ +75w== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=SDr7XBg+xq19zbw+ivXmjC4YiVXe+/dSifnDyR+sfMk=; b=cXTDyC/+xd5+LaGBt2wXb7Odjbnhe9D6oIhf6BrZ/ZKRbiiccbMlb5sNui35W9zLjf LZWlAHwjJocMsFxRCNjPUanevVQ+E7JN9M3GUTz01MsV4bhDHcBpz5gf8eq4tqM81UrJ V0FWt+o/Spe9Z6tFYtzs5RcwoqHVn1Zdo86Vo8KKM4urrohDu2wpN2W1ksWa2ox6rJJQ ujM8UtLohFnbfmLAxkjpAS3gCzpRUQDegZcmptyC+cxAsuq/WvE7hEuF8k3MNpGmr3sU qUlBFF3R1TQtz7KPoqpHkrQ0UxcegLeDohzcJomy58XoMr589TtRa2F8C7fBxys4Kgfb E44Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id y20si66657qtj.403.2017.10.23.05.15.41; Mon, 23 Oct 2017 05:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id BDBE5610AF; Mon, 23 Oct 2017 12:15:41 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 9F444622CF; Mon, 23 Oct 2017 12:13:42 +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 C420E6204C; Mon, 23 Oct 2017 12:13:34 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 36F5D62988 for ; Mon, 23 Oct 2017 12:00:31 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 861211820B6 for ; Mon, 23 Oct 2017 15:00:28 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bOppXzUcUL-0RFeg4oa; Mon, 23 Oct 2017 15:00:28 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0QtCsW0c; Mon, 23 Oct 2017 15:00:27 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:04 +0300 Message-Id: <1508760010-14064-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 2/8] api: pool: add packet pool subparameters 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" From: Petri Savolainen Additional packet length and number specification gives more information to implementation about intended packet length distribution in the pool. This enables e.g. correct initialization when pool implementation is based on multiple fixed packet / segment sizes (subpools). The specification does require subpool implementation but allows it. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ include/odp/api/spec/pool.h | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index f1c8b1158..61be2f974 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -41,6 +41,9 @@ extern "C" { * Maximum pool name length in chars including null char */ +/** Maximum number of packet pool subparameters */ +#define ODP_POOL_MAX_SUBPARAMS 7 + /** * Pool capabilities */ @@ -134,6 +137,12 @@ typedef struct odp_pool_capability_t { * The value of zero means that limited only by the available * memory size for the pool. */ uint32_t max_uarea_size; + + /** Maximum number of subparameters + * + * Maximum number of packet pool subparameters. Valid range is + * 0 ... ODP_POOL_MAX_SUBPARAMS. */ + uint8_t max_num_subparam; } pkt; /** Timeout pool capabilities */ @@ -163,6 +172,18 @@ typedef struct odp_pool_capability_t { int odp_pool_capability(odp_pool_capability_t *capa); /** + * Packet pool subparameters + */ +typedef struct odp_pool_pkt_subparam_t { + /** Number of 'len' byte packets. */ + uint32_t num; + + /** Packet length in bytes */ + uint32_t len; + +} odp_pool_pkt_subparam_t; + +/** * Pool parameters * * A note for all pool types: a single thread may not be able to allocate all @@ -246,6 +267,33 @@ typedef struct odp_pool_param_t { capability pkt.max_headroom. Use zero if headroom is not needed. */ uint32_t headroom; + + /** Number of subparameters + * + * The number of subparameter table entries used. + * The maximum value is defined by pool + * capability pkt.max_num_subparam. The default value + * is 0. + */ + uint8_t num_subparam; + + /** Subparameter table + * + * Subparameters continue pool configuration with + * additional packet length requirements. The first + * table entry follows the num/len specification above. + * So that, sub[0].len > 'len', and sub[0].num refers + * to packet lengths between 'len' + 1 and sub[0].len. + * Similarly, sub[1] follows sub[0] specification, and + * so on. + * + * Each requirement is supported separately and may be + * rounded up, as long as the 'max_num' parameter is + * not violated. It's implementation specific if some + * requirements are supported simultaneously (e.g. + * due to subpool design). + */ + odp_pool_pkt_subparam_t sub[ODP_POOL_MAX_SUBPARAMS]; } pkt; /** Parameters for timeout pools */ From patchwork Mon Oct 23 12:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116731 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4577034qgn; Mon, 23 Oct 2017 05:16:31 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SGCUIP6SPjgJyHjDAR6euThpMgooDEXOPmIcO0ebWvSMYhzUsaAT/bbl2FCko/ux9JbIzD X-Received: by 10.200.63.20 with SMTP id c20mr20828983qtk.178.1508760990900; Mon, 23 Oct 2017 05:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508760990; cv=none; d=google.com; s=arc-20160816; b=j+HDHA8Fgom+X6yOpf/0SFIOlOvLVPWwxzxpQntMtNsTyrOfYtOzUAoQcpASnbRsmM mBybN4EvZIXlusIXHhAAEEQeSaj6Bpp68bRr9gSXLY698LZKNRrDyjzHJK2is84D+5bX qDmYiaqZp3VrthBiq1tYYsFE5YveGXtuI19d6HvzBSGeDTrHnkr2OOG+3zo/272PEVAM Z5vIB6ZVAnBs6v9Sz/oK40/YLOD1Ajw90Jrgc730Up6MVUHdhLefY3+V9pjFAJoc3lSW NsQICgEzKr6bIdkzLi+8m68VSkfWPY8p8jky3nh7owbCXr9oqshtf/F42ZfNcl5iSVyO DOxQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=1ZIygx4KR6Torfv0C+DgbMIFTAIdU+kqvqCV53QuCoU=; b=luaAHwvA+5/UAiA+MeR1r2mcWB31P4GHs+9TgQofrsqNGSbEL6DAo+m0gJJisTEEMW xdlUTESMf50p9cCcxcOAtsZmigX6tRM7bIJNaHQ1wUU7McxLMdQE36nvchYftVVpzLtg MLE6FMdTkiilagh6kmYRuFp2YUclV114o2/H8Lf+tYJzIllDiMvO6CaT0XJK94zemP8L 9k+FSJxiCW7uL6SyYRPCEDzeUjW8KaSEuGGoQ8nK2Zv51e9EdZWebOreOq2Epy0oY1EC NKXnBazKHZLol+XpOO4PORvMeVJfzb9UKVACxFkjsV2zRnt8lUV0n3748lOYB9ji02VE 1Brw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id k54si4546864qta.90.2017.10.23.05.16.30; Mon, 23 Oct 2017 05:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 8ABD76083F; Mon, 23 Oct 2017 12:16:30 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 F218F622DC; Mon, 23 Oct 2017 12:13:45 +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 026E86204C; Mon, 23 Oct 2017 12:13:36 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 51FA86298E for ; Mon, 23 Oct 2017 12:00:31 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward102o.mail.yandex.net (Yandex) with ESMTP id B664D5A02B36 for ; Mon, 23 Oct 2017 15:00:29 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ab4qMTMuYw-0TFitTwL; Mon, 23 Oct 2017 15:00:29 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0TtK73qb; Mon, 23 Oct 2017 15:00:29 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:05 +0300 Message-Id: <1508760010-14064-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 3/8] validation: pool: add subparam test 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" From: Petri Savolainen Test packet pool subparameters when those are supported. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ test/validation/api/pool/pool.c | 98 +++++++++++++++++++++++++++++++++++++++++ test/validation/api/pool/pool.h | 3 +- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index e633137ab..c38a336ce 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -10,6 +10,9 @@ #include "odp_cunit_common.h" #include "pool.h" +#define PKT_LEN 400 +#define PKT_NUM 500 + static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; @@ -96,10 +99,105 @@ void pool_test_lookup_info_print(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +void pool_test_alloc_packet(void) +{ + odp_pool_t pool; + odp_pool_param_t param; + uint32_t i, num; + odp_packet_t pkt[PKT_NUM]; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET, + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + + pool = odp_pool_create(NULL, ¶m); + + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + num = 0; + + for (i = 0; i < PKT_NUM; i++) { + pkt[num] = odp_packet_alloc(pool, PKT_LEN); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + +void pool_test_alloc_packet_subparam(void) +{ + odp_pool_t pool; + odp_pool_capability_t capa; + odp_pool_param_t param; + uint32_t i, j, num, num_sub; + odp_packet_t pkt[PKT_NUM]; + + CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); + num_sub = capa.pkt.max_num_subparam; + + CU_ASSERT_FATAL(num_sub <= ODP_POOL_MAX_SUBPARAMS); + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET, + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + param.pkt.num_subparam = num_sub; + + for (i = 0; i < num_sub; i++) { + param.pkt.sub[i].num = PKT_NUM; + param.pkt.sub[i].len = PKT_LEN + (i * 100); + } + + pool = odp_pool_create(NULL, ¶m); + + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + num = 0; + + for (i = 0; i < PKT_NUM; i++) { + pkt[num] = odp_packet_alloc(pool, PKT_LEN); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + + for (j = 0; j < num_sub; j++) { + num = 0; + + for (i = 0; i < param.pkt.sub[j].num; i++) { + pkt[num] = odp_packet_alloc(pool, param.pkt.sub[j].len); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + } + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + odp_testinfo_t pool_suite[] = { ODP_TEST_INFO(pool_test_create_destroy_buffer), ODP_TEST_INFO(pool_test_create_destroy_packet), ODP_TEST_INFO(pool_test_create_destroy_timeout), + ODP_TEST_INFO(pool_test_alloc_packet), + ODP_TEST_INFO(pool_test_alloc_packet_subparam), ODP_TEST_INFO(pool_test_lookup_info_print), ODP_TEST_INFO_NULL, }; diff --git a/test/validation/api/pool/pool.h b/test/validation/api/pool/pool.h index 29e517633..3f8f5ebce 100644 --- a/test/validation/api/pool/pool.h +++ b/test/validation/api/pool/pool.h @@ -13,8 +13,9 @@ void pool_test_create_destroy_buffer(void); void pool_test_create_destroy_packet(void); void pool_test_create_destroy_timeout(void); -void pool_test_create_destroy_buffer_shm(void); void pool_test_lookup_info_print(void); +void pool_test_alloc_packet(void); +void pool_test_alloc_packet_subparam(void); /* test arrays: */ extern odp_testinfo_t pool_suite[]; From patchwork Mon Oct 23 12:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116735 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4579567qgn; Mon, 23 Oct 2017 05:19:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q2OW3X/llL4mZQp/oPrSnKC8J84o2rwTmtqwTLM/KPOCPX260/GMq4+wc1oQ8UF1cHRce2 X-Received: by 10.200.46.114 with SMTP id s47mr19115183qta.165.1508761155708; Mon, 23 Oct 2017 05:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508761155; cv=none; d=google.com; s=arc-20160816; b=lV+iej/fU/RT/fs9r1sFMglvx6eySrZ2Vv1gwe4mcJtgPhPJ8kommqLLRFfwz8NgiD 5/5hDdx62DsHiXO++36tvIf/3okmqU7wZ+iWFYxqpuyPHjSF7bHq8sWr0ab9VHfNbfQi Owbeu0QexlEqQb6g+ZcI0CM05m6TSQ9Ws84digSJ/xhwA+AnWPF+ArI8cezjX7m+iX9p gsr7uX9G67/Ic64rbTAutBgt9UtOBB+eObX29pQyJ6n6ZkVMEkdvCq4JqEwE9AiEjLWM s5cHFXqGmTimEF1C6E4hBhTsqVlU4Rp7/+GCnxuR026pUmNIhuI8HPJYcFPNbNW25uJE PZPg== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=2RgX3iow2h/cWSPjLMqmb/wRuqF1DhHOwd0+YwicHnE=; b=ZWOb9h8N6/9ctV99k+y+fVPWPqYFYzU0NanQIsdWFN5HXT4wSRqJKx65TlN4LOYHPP CFoiNiabuLL3u+3WNhWU6PvKEgqkTZ1VWnMFTrJo13SVonZcdBX5bL9fC86SKksQ0zLH RiyO4wnJhJ7xynh6iTOpK2b7hrN57FvBM6lY/IoYdav0cDb0EU0b/Iu6iVTcp84ICLhO bPesK7j2iuQYo33tbvJ0wgaMf6Nqa/LnRo700lGS2a0EIGq6rfdliupVugOgAU0J2REO iGRK6T94R7ptX+V93BLixsjjCRqABZlaGlLHaCnXjHH9Ib+jlb1XA+Riild2mVzyTAfZ Bdjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id r35si320663qkh.244.2017.10.23.05.19.15; Mon, 23 Oct 2017 05:19:15 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 647A2622D5; Mon, 23 Oct 2017 12:19:15 +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=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 2E4FB61C9E; Mon, 23 Oct 2017 12:14:03 +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 8BF3D622E3; Mon, 23 Oct 2017 12:13:48 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 5375B62994 for ; Mon, 23 Oct 2017 12:00:38 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 6297534C30B1 for ; Mon, 23 Oct 2017 15:00:30 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id oXazdTFWOO-0UjWXhcq; Mon, 23 Oct 2017 15:00:30 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0Tt8bneF; Mon, 23 Oct 2017 15:00:29 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:06 +0300 Message-Id: <1508760010-14064-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 4/8] validation: pool: initialize params correctly 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" From: Petri Savolainen Use odp_pool_param_init() to initialize pool parameters. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ test/validation/api/pool/pool.c | 87 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index c38a336ce..461715cc9 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -16,11 +16,11 @@ static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; -static void pool_create_destroy(odp_pool_param_t *params) +static void pool_create_destroy(odp_pool_param_t *param) { odp_pool_t pool; - pool = odp_pool_create(NULL, params); + pool = odp_pool_create(NULL, param); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); CU_ASSERT(odp_pool_to_u64(pool) != odp_pool_to_u64(ODP_POOL_INVALID)); @@ -29,42 +29,41 @@ static void pool_create_destroy(odp_pool_param_t *params) void pool_test_create_destroy_buffer(void) { - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER, + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_packet(void) { - odp_pool_param_t params = { - .pkt = { - .seg_len = 0, - .len = default_buffer_size, - .num = default_buffer_num, - }, - .type = ODP_POOL_PACKET, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET; + param.pkt.len = default_buffer_size; + param.pkt.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_timeout(void) { - odp_pool_param_t params = { - .tmo = { - .num = default_buffer_num, - }, - .type = ODP_POOL_TIMEOUT, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_TIMEOUT; + param.tmo.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_lookup_info_print(void) @@ -72,16 +71,16 @@ void pool_test_lookup_info_print(void) odp_pool_t pool; const char pool_name[] = "pool_for_lookup_test"; odp_pool_info_t info; - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool = odp_pool_create(pool_name, ¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER; + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool = odp_pool_create(pool_name, ¶m); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); pool = odp_pool_lookup(pool_name); @@ -89,10 +88,10 @@ void pool_test_lookup_info_print(void) CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); - CU_ASSERT(params.buf.size <= info.params.buf.size); - CU_ASSERT(params.buf.align <= info.params.buf.align); - CU_ASSERT(params.buf.num <= info.params.buf.num); - CU_ASSERT(params.type == info.params.type); + CU_ASSERT(param.buf.size <= info.params.buf.size); + CU_ASSERT(param.buf.align <= info.params.buf.align); + CU_ASSERT(param.buf.num <= info.params.buf.num); + CU_ASSERT(param.type == info.params.type); odp_pool_print(pool); From patchwork Mon Oct 23 12:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116733 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4578305qgn; Mon, 23 Oct 2017 05:17:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Qbx3wwwgmtdeTkxs7OgzcI2rDE4azTc3UI4JwERttnJa2UnRLCbrOoZY9FPZYCjf2GTjyT X-Received: by 10.55.217.203 with SMTP id q72mr19632977qkl.245.1508761070339; Mon, 23 Oct 2017 05:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508761070; cv=none; d=google.com; s=arc-20160816; b=Vc1nb4l2qE30YtkfJmpLOxQHnPEGelKkIM5wEaFBiC6AMCZHwodhPv9ZO5lQKmN9qR Gd6UyX99lSf9NFRlC2d/8yQH9fAx+Z4b/nLUQhbLAl1ZKKWv6oXXrKiy7bTuv5EE84ws LvyXiPYE7Hz89EVhm4EUqxDcSzcaMsK0U22EVjT0ZAb50W+qw4TFLr55w1pqVLypMDeX SgvO8KSJt50rBh0N2ugWUeC0pomR+42SLfq9Fpjz/vu+fnCEFZQgpgAzHmoawvMPauUr tIM9oU1onNOHdBAaUcGvWzjF8uQQcMw1VFc+rmtvpa2PgD3v0SOriQW26Zxz+cbUlqsf JEyg== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ou3gRPhoS6+ESWU0h6OUsKBoeOzIzzQEAh5KxYAvIv8=; b=d/FGERIRnYxIL/3H5ISmil+HyEjFs9Cvj1i7ForrEQLEP/FXOPomaw/WdN3US3vUD5 SGnhlWpEe84Y9jRLsZFbln0Vj3wK5KlbQTCtKkFTDC3sRDEZyrPTrBXY+5BVIKcVYifE 9eizsWhE/d3nWCh0D7qP7OMXGq+ufqFKk/ANtE2CsHmk6vwIVjFYlyKEyeSr+Ephsx6a uAuxYpOrkbkMfiZfllPo4lkRGf5H9pgvWKM8FO3qiLqIuOXzlPeZL6pz/WfKXUht8QsO vkfPXeyh3FRHvRfDwzZVaY94e3L5t1CJIV8afaw5pdFwycz6d2ij57iFf7q5EmozjzbN owUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 41si5407964qtu.211.2017.10.23.05.17.50; Mon, 23 Oct 2017 05:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 0C49E61057; Mon, 23 Oct 2017 12:17:50 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 8A12A622E6; Mon, 23 Oct 2017 12:13:51 +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 130B5622D7; Mon, 23 Oct 2017 12:13:40 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 0051C6298F for ; Mon, 23 Oct 2017 12:00:32 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward106p.mail.yandex.net (Yandex) with ESMTP id CC39E2D8527B for ; Mon, 23 Oct 2017 15:00:30 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id b51pC0JGTK-0UU06MpN; Mon, 23 Oct 2017 15:00:30 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0Ut8JRhm; Mon, 23 Oct 2017 15:00:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:07 +0300 Message-Id: <1508760010-14064-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 5/8] api: pool: add max packet num info 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" From: Petri Savolainen Packet pool parameters does not require application to specify the maximum number of packet. Application is more portable, if it does not restrict max_num, but instead uses this info field after pool creation. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ include/odp/api/spec/pool.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 61be2f974..63e063bef 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -358,8 +358,24 @@ odp_pool_t odp_pool_lookup(const char *name); * Used to get information about a pool. */ typedef struct odp_pool_info_t { - const char *name; /**< pool name */ - odp_pool_param_t params; /**< pool parameters */ + /** Pool name */ + const char *name; + + /** Copy of pool parameters */ + odp_pool_param_t params; + + /** Additional info for packet pools */ + struct { + /** Maximum number of packets of any length + * + * This is the maximum number of packets that can be allocated + * from the pool at anytime. Application can use this e.g. + * to prepare enough per packet contexts. + */ + uint32_t max_num; + + } pkt; + } odp_pool_info_t; /** @@ -373,7 +389,6 @@ typedef struct odp_pool_info_t { * @retval 0 Success * @retval -1 Failure. Info could not be retrieved. */ - int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info); /** From patchwork Mon Oct 23 12:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116732 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4577708qgn; Mon, 23 Oct 2017 05:17:12 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TNbS7Cb+MFQ5zZUahnjI6fzY8ajX9l+36rRrMT88olHUeSv6sBAnfcoxPwxN+0oLvb6Kbr X-Received: by 10.200.41.174 with SMTP id 43mr8901447qts.86.1508761032434; Mon, 23 Oct 2017 05:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508761032; cv=none; d=google.com; s=arc-20160816; b=xta8FzH364ZyoVSqVr9QFpyLujFFdZtUxAeE43+vvdZ6yC8KFTWQLKThZZp7y1fExv qM8hn3nYOAez0M8LnUU9oPWKjWIkvFsefQtDc+/c052ihIe4ZmwHG5wOzf3k3sb5KCVz Pl+8UHrCMh0XbrdfvPLpSmy/Qc6U4Q+XLlUNrCB6InrV0Ug4McOqCy3sUrTQKS7kRSR+ UIz55+OLQ1XNVT4yZRHkDBaRrEP6U7+bikzO3zBHxqu0Wa51TRbpVU9O9eM8e0IryZC4 TcaoxUlMHXqKveDcZfdFbkSRLGOejXc26L6GIrxib+iSUke/Y5BJ35TzwOQT+2ZFIn4E 2ugA== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=tMO732Vv8/PM5NG78o3nJRDWiAkA+vyu1LqBE7y/VFU=; b=K1lwDhGYM6i86GWUIp3vwb/txzmALWydmv8yNb9zg3Ew4F+FPaZ8D4Zl+2eOG8mF9f s2/vFOHsUGMChN0him/4ncLwodSNRqz8Dpq1YZnj9reQxTbgIUWMOCCHZ+qaV4WTHw4l HhfehcDT9fu9PdqTwBrfZyEuPrhdv68L8ovZnQ+IPvRTboGlFpQIAfiMbA+XEUFgIcoJ U0lCW+VOzaWY+et/2O9m2j6ZBzguIIzOaPxYD2l8jDxmVumnLJa8rYivJIn/cJurLCyu SqxSrQVfAG9+oljMLiJp5QqXVJY5iZmjL748zUVMXfXlVeWXvYKuMXQCISJgwkmNsGSB gMDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w45si1546144qta.387.2017.10.23.05.17.12; Mon, 23 Oct 2017 05:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 1D899608B6; Mon, 23 Oct 2017 12:17:12 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 44F626286D; Mon, 23 Oct 2017 12:13:49 +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 1C44962291; Mon, 23 Oct 2017 12:13:39 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 1FAB662983 for ; Mon, 23 Oct 2017 12:00:33 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward103o.mail.yandex.net (Yandex) with ESMTP id B9F455884FB4 for ; Mon, 23 Oct 2017 15:00:31 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uby0NfDc8J-0VjuRKoF; Mon, 23 Oct 2017 15:00:31 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0Ut0dJ8S; Mon, 23 Oct 2017 15:00:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:08 +0300 Message-Id: <1508760010-14064-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 6/8] linux-gen: pool: implement max_num info 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" From: Petri Savolainen Implemented max_num info for packet pools. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ platform/linux-generic/odp_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 40114093a..326cc82a0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -701,6 +701,9 @@ int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) info->name = pool->name; info->params = pool->params; + if (pool->params.type == ODP_POOL_PACKET) + info->pkt.max_num = pool->num; + return 0; } From patchwork Mon Oct 23 12:00:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116734 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4578835qgn; Mon, 23 Oct 2017 05:18:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TwQxsb2gPVPstdBprvUoVbzHO27UsEtwdXc2L/TFFYgKAsLdlm2/zr0EKIHKlDdIFBIHVq X-Received: by 10.200.15.83 with SMTP id l19mr18977823qtk.168.1508761103666; Mon, 23 Oct 2017 05:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508761103; cv=none; d=google.com; s=arc-20160816; b=cOIeyilR3GFbQ8YRlfWkyOsSf92AR4+79oftCHKcWmEZLoag7UW8OJHknpc/OZ5nXh lWulzmDi+f+WGpmOJx0fpdiX/opYoGSFwsrr9Yykv99KLLNOxrAKjsKoFNgvVEBOiGjE 71qLBAHZFzax36B/N6kgDu8kwT+/UeJ4aLW5kS/1NFoexSREyJVxuw3rhkFcjbtpqmXX qqmDXkRfWWssYprjwQQbh+PY8BZe5Vivoa4E3P1NPhAxEMuifgBxIpFWrNcIvaDWy+Od ZpwNncHqPWfkX1by0Xp3KfhCLCW9/P4f+11X86R7gr+Kh+j6P0txrYFyHQ1Pof9u4Pab 3taQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=w99L0nnjilnf8fgSLO3YCrJbAYQSjGyMwHx+exgouvA=; b=a81AGGDmCLlTgsG8KmCfWL9HMDX9PnXo+RHyNWqaWUGuuGR4cEpGw5XsSMcXP8jmLX lyxZjNbKlYuse7HAWEMDaFESyLsfOWwiFZ5NaNTyBXxD3SNrQ1fJ8yWGIfs0v26CFZ/w PbXxwZvPwUAjRNeWKsXCjXn/iJIOys9ngcUwUfe2LM0s4v7+fE+IKGGtrtbKdKQVlcvV Y+pew9elei2sE0VgWHT/qRxAfifCseKYib0G5oEh16C73chcuUrSJUcoJVsfZP2yQVwq 9igf+8Fltg68GORwA5BmY+ZHY2qWICd+AseMAQOC0j60cmNp21ztkHss9aN6Qz6W6XDO qOaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id d129si16055qkf.177.2017.10.23.05.18.23; Mon, 23 Oct 2017 05:18:23 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5FB5D610DF; Mon, 23 Oct 2017 12:18:23 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 DDE31628B1; Mon, 23 Oct 2017 12:13:56 +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 0643B622D9; Mon, 23 Oct 2017 12:13:45 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id CABC362991 for ; Mon, 23 Oct 2017 12:00:34 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 3D04B6A8383F for ; Mon, 23 Oct 2017 15:00:33 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Oc2UaYqC4O-0X5i5cJ7; Mon, 23 Oct 2017 15:00:33 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0WtWove5; Mon, 23 Oct 2017 15:00:32 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 15:00:10 +0300 Message-Id: <1508760010-14064-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> References: <1508760010-14064-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v3 8/8] api: pool: remove union from params 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" From: Petri Savolainen Remove anonymous union from pool parameter structure. Union makes it impossible to initialize parameters per pool type (use other values than all zeros). This change is not visible to applications (union was anonymous). Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1 **/ include/odp/api/spec/pool.h | 211 ++++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 107 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 63e063bef..b615831cf 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -195,113 +195,110 @@ typedef struct odp_pool_param_t { /** Pool type */ int type; - /** Variant parameters for different pool types */ - union { - /** Parameters for buffer pools */ - struct { - /** Number of buffers in the pool */ - uint32_t num; - - /** Buffer size in bytes. The maximum number of bytes - application will store in each buffer. */ - uint32_t size; - - /** Minimum buffer alignment in bytes. Valid values are - powers of two. Use 0 for default alignment. - Default will always be a multiple of 8. */ - uint32_t align; - } buf; - - /** Parameters for packet pools */ - struct { - /** Minimum number of 'len' byte packets. - * - * The pool must contain at least this many packets - * that are 'len' bytes or smaller. An implementation - * may round up the value, as long as the 'max_num' - * parameter below is not violated. The maximum value - * for this field is defined by pool capability - * pkt.max_num. - */ - uint32_t num; - - /** Maximum number of packets. - * - * This is the maximum number of packets of any length - * that can be allocated from the pool. The maximum - * value is defined by pool capability pkt.max_num. - * Use 0 when there's no requirement for the maximum - * number of packets. The default value is 0. - */ - uint32_t max_num; - - /** Minimum length of 'num' packets. - * - * The pool must contain at least 'num' packets up to - * this packet length (1 ... 'len' bytes). The maximum - * value for this field is defined by pool capability - * pkt.max_len. Use 0 for default. - */ - uint32_t len; - - /** Maximum packet length that will be allocated from - the pool. The maximum value is defined by pool - capability pkt.max_len. Use 0 for default (the - pool maximum). */ - uint32_t max_len; - - /** Minimum number of packet data bytes that are stored - in the first segment of a packet. The maximum value - is defined by pool capability pkt.max_seg_len. - Use 0 for default. */ - uint32_t seg_len; - - /** User area size in bytes. The maximum value is - defined by pool capability pkt.max_uarea_size. - Specify as 0 if no user area is needed. */ - uint32_t uarea_size; - - /** Minimum Headroom size in bytes. Each newly allocated - packet from the pool must have at least this much - headroom. The maximum value is defined by pool - capability pkt.max_headroom. - Use zero if headroom is not needed. */ - uint32_t headroom; - - /** Number of subparameters - * - * The number of subparameter table entries used. - * The maximum value is defined by pool - * capability pkt.max_num_subparam. The default value - * is 0. - */ - uint8_t num_subparam; - - /** Subparameter table - * - * Subparameters continue pool configuration with - * additional packet length requirements. The first - * table entry follows the num/len specification above. - * So that, sub[0].len > 'len', and sub[0].num refers - * to packet lengths between 'len' + 1 and sub[0].len. - * Similarly, sub[1] follows sub[0] specification, and - * so on. - * - * Each requirement is supported separately and may be - * rounded up, as long as the 'max_num' parameter is - * not violated. It's implementation specific if some - * requirements are supported simultaneously (e.g. - * due to subpool design). - */ - odp_pool_pkt_subparam_t sub[ODP_POOL_MAX_SUBPARAMS]; - } pkt; - - /** Parameters for timeout pools */ - struct { - /** Number of timeouts in the pool */ - uint32_t num; - } tmo; - }; + /** Parameters for buffer pools */ + struct { + /** Number of buffers in the pool */ + uint32_t num; + + /** Buffer size in bytes. The maximum number of bytes + * application will store in each buffer. + */ + uint32_t size; + + /** Minimum buffer alignment in bytes. Valid values are + * powers of two. Use 0 for default alignment. + * Default will always be a multiple of 8. + */ + uint32_t align; + } buf; + + /** Parameters for packet pools */ + struct { + /** Minimum number of 'len' byte packets. + * + * The pool must contain at least this many packets that are + * 'len' bytes or smaller. An implementation may round up the + * value, as long as the 'max_num' parameter below is not + * violated. The maximum value for this field is defined by + * pool capability pkt.max_num. + */ + uint32_t num; + + /** Maximum number of packets. + * + * This is the maximum number of packets of any length that can + * be allocated from the pool. The maximum value is defined by + * pool capability pkt.max_num. Use 0 when there's no + * requirement for the maximum number of packets. The default + * value is 0. + */ + uint32_t max_num; + + /** Minimum length of 'num' packets. + * + * The pool must contain at least 'num' packets up to this + * packet length (1 ... 'len' bytes). The maximum value for + * this field is defined by pool capability pkt.max_len. + * Use 0 for default. + */ + uint32_t len; + + /** Maximum packet length that will be allocated from + * the pool. The maximum value is defined by pool capability + * pkt.max_len. Use 0 for default (the pool maximum). + */ + uint32_t max_len; + + /** Minimum number of packet data bytes that are stored in the + * first segment of a packet. The maximum value is defined by + * pool capability pkt.max_seg_len. Use 0 for default. + */ + uint32_t seg_len; + + /** User area size in bytes. The maximum value is defined by + * pool capability pkt.max_uarea_size. Specify as 0 if no user + * area is needed. + */ + uint32_t uarea_size; + + /** Minimum headroom size in bytes. Each newly allocated + * packet from the pool must have at least this much headroom. + * The maximum value is defined by pool capability + * pkt.max_headroom. Use zero if headroom is not needed. + */ + uint32_t headroom; + + /** Number of subparameters + * + * The number of subparameter table entries used. The maximum + * value is defined by pool capability pkt.max_num_subparam. + * The default value is 0. + */ + uint8_t num_subparam; + + /** Subparameter table + * + * Subparameters continue pool configuration with additional + * packet length requirements. The first table entry follows + * the num/len specification above. So that, sub[0].len > 'len' + * and sub[0].num refers to packet lengths between 'len' + 1 + * and sub[0].len. Similarly, sub[1] follows sub[0] + * specification, and so on. + * + * Each requirement is supported separately and may be rounded + * up, as long as the 'max_num' parameter is not violated. It's + * implementation specific if some requirements are supported + * simultaneously (e.g. due to subpool design). + */ + odp_pool_pkt_subparam_t sub[ODP_POOL_MAX_SUBPARAMS]; + } pkt; + + /** Parameters for timeout pools */ + struct { + /** Number of timeouts in the pool */ + uint32_t num; + } tmo; + } odp_pool_param_t; /** Packet pool*/