From patchwork Tue Oct 17 14: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: 116115 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4935333qgn; Tue, 17 Oct 2017 07:03:07 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q3cMPOHg6Hf+yIYOSugia4nOuR43rXTWQmQwLyhcpIMwaoH2QEnKQ0xY4M4QJ+sPVhxdXe X-Received: by 10.107.135.202 with SMTP id r71mr16292754ioi.26.1508248987226; Tue, 17 Oct 2017 07:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508248987; cv=none; d=google.com; s=arc-20160816; b=uo0rXKdfgsXxl9BsREcewt7Ey7PA6VpYra/FtLjnZvgHyhRyCr5KEgEow6pDLJrrJO +hqGiHYR8bY2ZU0LP/PXmr9FZvIEf3g9/AV2ymH52c3mxnGGwPMR5m+2tgsuGSfP6i2J kQA/XdQ1Nu6TgOSxsben5APJIJXvPBt5UqvHSIijWpUdAkPKusof5yGzhckIlY0RFY2t RsLWX6Eg7orjY4m9RQz+uBkkMzrbiN4VVfhBISZLDpG6KafITzxZEI99byjWLfjqXnPu QrrH5QKi0ztvmtRIc2TIhW9V3hgRyBSMShdb9fZQfRXfzluie2mI80N+T3JUV/rfPMCN 8SLQ== 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=mU1bzgJsHvenhmg83jG7w3fqSaIO53KqQNMD+4hPi90=; b=EOaGVcRPGy2w9LqubmBh00ZVQAhmuBLqbW0XZiSW8ZNH7ntD9ntzFvkamAyRkbwnPa YnH/mkfVDdUbhq4Ro2UhyktReAesZjJnymQ6/r9g9bp3LMRdtzcyrO7pH+YBLwihtVyH obCQPvj0TEpJFAPX0IIkjh8OzjbSYkwDskywFJl3gL3lNz9uNxCV3dwb8cYr5lTUdOjT o+s+UrTJhJ3Ax1HWhrzRq0ZG6wal8cw5I0jt2qp6rg7tKNvqO8Aat3namcslWrhdodTu pJxFzJCPCB0GUImqg40233rqDHgF2D6mKaX9wIJTAPWlD62zq2XBcA9/39F60XdLSTqI T+7w== 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 p133si7094195ite.14.2017.10.17.07.03.06; Tue, 17 Oct 2017 07:03:07 -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 BD02F628C4; Tue, 17 Oct 2017 14:03: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=-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 39AF3628AA; Tue, 17 Oct 2017 14:00: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 6E188628A9; Tue, 17 Oct 2017 14:00:25 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id F2338628A9 for ; Tue, 17 Oct 2017 14:00:16 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 626326A83EC1 for ; Tue, 17 Oct 2017 17:00:15 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ca0LKx01yS-0FtiQSdG; Tue, 17 Oct 2017 17:00:15 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tTs7mS0qFy-0E4ih1c0; Tue, 17 Oct 2017 17:00:14 +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: Tue, 17 Oct 2017 17:00:03 +0300 Message-Id: <1508248809-4850-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508248809-4850-1-git-send-email-odpbot@yandex.ru> References: <1508248809-4850-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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 */