From patchwork Mon Oct 23 12:00:07 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: 116733 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4578305qgn; Mon, 23 Oct 2017 05:17:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Qbx3wwwgmtdeTkxs7OgzcI2rDE4azTc3UI4JwERttnJa2UnRLCbrOoZY9FPZYCjf2GTjyT X-Received: by 10.55.217.203 with SMTP id q72mr19632977qkl.245.1508761070339; Mon, 23 Oct 2017 05:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508761070; cv=none; d=google.com; s=arc-20160816; b=Vc1nb4l2qE30YtkfJmpLOxQHnPEGelKkIM5wEaFBiC6AMCZHwodhPv9ZO5lQKmN9qR Gd6UyX99lSf9NFRlC2d/8yQH9fAx+Z4b/nLUQhbLAl1ZKKWv6oXXrKiy7bTuv5EE84ws LvyXiPYE7Hz89EVhm4EUqxDcSzcaMsK0U22EVjT0ZAb50W+qw4TFLr55w1pqVLypMDeX SgvO8KSJt50rBh0N2ugWUeC0pomR+42SLfq9Fpjz/vu+fnCEFZQgpgAzHmoawvMPauUr tIM9oU1onNOHdBAaUcGvWzjF8uQQcMw1VFc+rmtvpa2PgD3v0SOriQW26Zxz+cbUlqsf JEyg== 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=ou3gRPhoS6+ESWU0h6OUsKBoeOzIzzQEAh5KxYAvIv8=; b=d/FGERIRnYxIL/3H5ISmil+HyEjFs9Cvj1i7ForrEQLEP/FXOPomaw/WdN3US3vUD5 SGnhlWpEe84Y9jRLsZFbln0Vj3wK5KlbQTCtKkFTDC3sRDEZyrPTrBXY+5BVIKcVYifE 9eizsWhE/d3nWCh0D7qP7OMXGq+ufqFKk/ANtE2CsHmk6vwIVjFYlyKEyeSr+Ephsx6a uAuxYpOrkbkMfiZfllPo4lkRGf5H9pgvWKM8FO3qiLqIuOXzlPeZL6pz/WfKXUht8QsO vkfPXeyh3FRHvRfDwzZVaY94e3L5t1CJIV8afaw5pdFwycz6d2ij57iFf7q5EmozjzbN owUg== 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 41si5407964qtu.211.2017.10.23.05.17.50; Mon, 23 Oct 2017 05:17:50 -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 0C49E61057; Mon, 23 Oct 2017 12:17:50 +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,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 8A12A622E6; Mon, 23 Oct 2017 12:13: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 130B5622D7; Mon, 23 Oct 2017 12:13:40 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 0051C6298F for ; Mon, 23 Oct 2017 12:00:32 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward106p.mail.yandex.net (Yandex) with ESMTP id CC39E2D8527B for ; Mon, 23 Oct 2017 15:00:30 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id b51pC0JGTK-0UU06MpN; Mon, 23 Oct 2017 15:00:30 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7orkcctvL2-0Ut8JRhm; Mon, 23 Oct 2017 15:00:30 +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:07 +0300 Message-Id: <1508760010-14064-6-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 5/8] api: pool: add max packet num info 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 Packet pool parameters does not require application to specify the maximum number of packet. Application is more portable, if it does not restrict max_num, but instead uses this info field after pool creation. 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 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 61be2f974..63e063bef 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -358,8 +358,24 @@ odp_pool_t odp_pool_lookup(const char *name); * Used to get information about a pool. */ typedef struct odp_pool_info_t { - const char *name; /**< pool name */ - odp_pool_param_t params; /**< pool parameters */ + /** Pool name */ + const char *name; + + /** Copy of pool parameters */ + odp_pool_param_t params; + + /** Additional info for packet pools */ + struct { + /** Maximum number of packets of any length + * + * This is the maximum number of packets that can be allocated + * from the pool at anytime. Application can use this e.g. + * to prepare enough per packet contexts. + */ + uint32_t max_num; + + } pkt; + } odp_pool_info_t; /** @@ -373,7 +389,6 @@ typedef struct odp_pool_info_t { * @retval 0 Success * @retval -1 Failure. Info could not be retrieved. */ - int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info); /**