From patchwork Fri Oct 27 08: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: 117300 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp476864qgn; Fri, 27 Oct 2017 01:05:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QaZDLhnrWGph3pC1H/BpEiBlAjgoBJpiFeBWWdcHuIPDwClOQ8zTn28MprG9CswqN2ufJa X-Received: by 10.36.141.65 with SMTP id w62mr2243075itd.152.1509091502698; Fri, 27 Oct 2017 01:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091502; cv=none; d=google.com; s=arc-20160816; b=KPCHRTiFfEiGo9HJrkndLx9NE9xhPObEn65O/3rPawsroKaS14ghKqcZ8Pa1PAfX7/ ffVjd9r7aprbphVvxa6L7Gh/X+Ied7iZj37FJw4w9UD1bmalAZ51lqzFBNKSw944uXvw Bcy9FXtz/pW0P1Jwvokm1EkmSqfxaSgJNOuPCJrM2BA/p8sW41tfH8TWmqNiADhhoUvl s6L9fBw9Zw0qlfp3fOtjm0orMIqrXXKZ80FpjfwJmmQltaeO16sre9bjtHaty+UEajiy ildnEIbukyp6C3DO9XVUaXTrMDpBkiTxHW0h5hZ2TeaCArwii/ILXjskIaAUtdnlCrwB qCyA== 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=hXPLmHqYEOqLtfpu/cT6y/EPjWkn4WOn0Jn1AEocSSE=; b=LfmhCCOfJsih6eXieSjUujBWhYdCaHO/AGGzRPOnntWxRaTQIkm9ROXiQaozbKsb2N gMPJYaP/ZIDbUz+fWWRdmaxQfcMIlma7wGjo85MFESmOY1lkbXlmPjCLNANkSktWWq28 AAMhwXhYtWiTfb2sV643MYdRIqFBRnmiNKHOcumaSbgV4aFheacOhOKVbKapxZWXDmHG GlBq9dSSLnh+JTNQKALp8AAjyyhzaHD/4l9p5QLam34bzHGLVFR+ilAZQganZ/1t2iGI sULHHuLw2aab8Fa5xRv0r4xcZO1+mTm1MaeUplrHP6hn81S46qu8kDrlFpMFx9avBaYm H2UQ== 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 g4si922093ite.1.2017.10.27.01.05.02; Fri, 27 Oct 2017 01:05:02 -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 37A32609D2; Fri, 27 Oct 2017 08:05:02 +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 DC4E46295C; Fri, 27 Oct 2017 08:01:29 +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 36BF5608BD; Fri, 27 Oct 2017 08:00:56 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id BEFE06098C for ; Fri, 27 Oct 2017 08:00:49 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward103p.mail.yandex.net (Yandex) with ESMTP id BAB162186C7A for ; Fri, 27 Oct 2017 11:00:48 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ENOQJeeALx-0msaHPwZ; Fri, 27 Oct 2017 11:00:48 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0lJenemx; Fri, 27 Oct 2017 11:00:47 +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: Fri, 27 Oct 2017 11:00:06 +0300 Message-Id: <1509091212-14398-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ 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 dc07851c4..2900fc469 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 */