From patchwork Mon Oct 16 12:59:59 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: 115907 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3655929qgn; Mon, 16 Oct 2017 06:01:36 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDCpgg8u20EBgQ+EeUuHK1x7kgzhOVpMq9w/HAydQXyQ91LM+MwvSsa1ytDZ/6j821x2wkk X-Received: by 10.107.20.137 with SMTP id 131mr12499061iou.137.1508158896271; Mon, 16 Oct 2017 06:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508158896; cv=none; d=google.com; s=arc-20160816; b=EhLI7eUssQDFeMLa2kCpgbtjUuZW0gwg//YrcMBAfLeyfNWkfjpOujNdtUtx3A5g+M ndAYUu44OMmtrwRvazVi4IqriPAq4D0i3FLKtC8s81KAWYd0K70kIEV3b0gbCnH5oFpV bb5AApvG+ncX8Ine6WcAI6P1rtr19OroEmxIDQIbYpJo8aFcluLaZswDgYGHNM4F1cVR e3gKtAHW4be+3mvWONcycMqvH8HErFGR+00ny5BL9Oyzzb/iLo/gPFUK207LDSpyMoeV qLDS4dhnzAcrQgfHpd9ydg0L2ktoUJqGb30WuwIlG7OAWiFQG4/1kYlxV21wQZeas0pY bSvQ== 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=Z52YrjiICuGRGT2+I0DJrs/5QsenzbQIabhy2CCRwyE=; b=boBkxQkM8+PfOY2yBwGlXzQ57vL4a3L0h8gqRv8EMei+rlEcVSVa9m/Z3AmU1MOhBz R874UcR57adky6mP5Z86+rrbqQ3e08sPQnHszKW/41zZa/wEvg4hcJSKgEs0fqdI/YYA qez9ndjChiZAE/h6kcWzwTiGdx2489wzvXWVmsFdh9oCHT4Ghr91Xt6oBuQiWaQfG2N4 NnFJ/K41uv4hvRXzyTKn4RpRyJNHPK1ytEuY2ibeiOvptPZYf+O/76JJkRiKFvdBSd1g bVftNxHwvyu2FbUtKvBrEks0O2j6ifoYP/x93w+lywl/oRO0RCYNK+8AwtdrrbzdcbpI oAvw== 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 g19si5403299iod.115.2017.10.16.06.01.35; Mon, 16 Oct 2017 06:01:36 -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 9B1B160853; Mon, 16 Oct 2017 13:01:35 +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 A480C6095C; Mon, 16 Oct 2017 13:00:32 +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 4726A60632; Mon, 16 Oct 2017 13:00:17 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id E8C0E60632 for ; Mon, 16 Oct 2017 13:00:14 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 6C397510189A for ; Mon, 16 Oct 2017 16:00:12 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5hcA9Ugoh3-0CkWZokq; Mon, 16 Oct 2017 16:00:12 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0BQ820aV; Mon, 16 Oct 2017 16:00:11 +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, 16 Oct 2017 15:59:59 +0300 Message-Id: <1508158805-5932-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508158805-5932-1-git-send-email-odpbot@yandex.ru> References: <1508158805-5932-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v1 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: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: 54f5fc670a7c125b6b0098e34e68fe3b45875069 **/ include/odp/api/spec/pool.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index f1c8b1158..7c9bee8ee 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_sub; } 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,32 @@ 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_sub. The default value is 0. + */ + uint8_t num_sub; + + /** 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 */