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 */