From patchwork Tue Oct 17 13:00:22 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: 116097 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4881580qgn; Tue, 17 Oct 2017 06:15:53 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RkDoypbDHW3dG25qlV2G5VFLbg9R578Fgv7zn2a3v62b7kIbecDbpNOqpPBHWdiaQfK9V1 X-Received: by 10.36.245.76 with SMTP id k73mr5076031ith.126.1508246153406; Tue, 17 Oct 2017 06:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246153; cv=none; d=google.com; s=arc-20160816; b=sltFMVQh7pR2QZcJNxNvt3Ucy0IxQOuFdNB5+QgJtddmE2el0fIMFSm/khh+lWMgH/ NVANK142v6iOD/1jJtW+nh/xoBUHLXs9QN5MsF3MtWVeNktPMJhYUQkRB2qZ/aFNN6En WkDc+lXsgc9OrL4mBG7EyXS8j9VNtlWEMB4M0+e0KaDdgwEsoqMJhx/We+77fMqulzXg uLrzIFIc//4areLDr0Nzs1KcBfAoqB5dR9lKn9b47FYpBttOnBIPrlJ9lQut7TbvRycA o3QQJc9oOGBCz+AyIPP5CMDp2K4XjfZIrZm9UHziY+osHni2qtugos5bzLPzPQAy4tjL Ts4A== 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=LUUxu71pcO5EsMjQakzXGXYGGqD8hen0wXuIDwCujGG6azKSjrvO+pRqWWYy75Vmd0 050oVXISNbIi1psC3FRxWat1HBeqpoVQ8qYMkuZQDx65XDxEaNMIRy38fmSad34Ep1tE JaBu6VAuNqROVJ+QA0wpRtMi/GTAKlOQWRLInED+yRWyhGaZc2Q1tC+hB7vTG/HV6VB3 Nfm8rVlx388Bw476FKWq356h64XvG4z2xrFSN9z6jGvB5VR490a73QgE0JGItDWjHCS6 5vTMmp7HUIjsazWRwDwJSNDl6J3eRSwXCF3QI2ZfksJ0Z2ALupr3fLUgOX++Q4O+gYC+ gbhA== 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 7si6932135ioa.289.2017.10.17.06.15.52; Tue, 17 Oct 2017 06:15:53 -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 B542C6297C; Tue, 17 Oct 2017 13:15:52 +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 6DE6262940; Tue, 17 Oct 2017 13:03:22 +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 120B86293C; Tue, 17 Oct 2017 13:03:09 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id E832B60C48 for ; Tue, 17 Oct 2017 13:00:34 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward104o.mail.yandex.net (Yandex) with ESMTP id E130C702689 for ; Tue, 17 Oct 2017 16:00:33 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id v8iQPMsXEN-0Xf4pede; Tue, 17 Oct 2017 16:00:33 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0X4m57aA; Tue, 17 Oct 2017 16:00:33 +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 16:00:22 +0300 Message-Id: <1508245228-16824-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-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 */