From patchwork Mon Oct 16 13: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: 115908 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3657324qgn; Mon, 16 Oct 2017 06:02:36 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RWMohmzlL7J1+tC6T/X9DPvdwqcBWY6A/m+5lwxBR+8uuMmUXkDO3tuOeFEHdh1NKGXZ1I X-Received: by 10.36.116.216 with SMTP id o207mr964513itc.22.1508158956641; Mon, 16 Oct 2017 06:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508158956; cv=none; d=google.com; s=arc-20160816; b=JB/ez+qx+AemgokWrCpbwWjxclpEZV4IUlTSEd34JZQmYJtcXyRLzbOrlG63yWVksC QT2ww41fJahbmWdYG3/rdhi9nldOi2bKJesazuxNDhIHpRdX/k6FuZhM0l7qDuj92ch0 dcypuPPBXkqUWq4QfwyhrPEyGWyFKjBv9WgJ8Fo+cAeQLtCy2sZ9qT8LCuhVvwBwiSiQ T58kbgrlj4NhtoptjZ21rUVT4bhO2SA4yRtaLQkFdmz3fbEcvG2EtRdNv0C559FAHvCx iRIOPh6I2OIcsAlRGdhlVFcFs26QJ26gXiv91H1NMhuHuVRMWFZZEAfOtLduYfEjtJVY pD8w== 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=qiC0c8P/EWFx/gNxq6NsnS+w66UYRNWqfJG1cbi7Cn0=; b=Iju+/I+vk5RaqYxINDErv2+kPei7/71eS0E5B9UmUWuzT4TX13Yr2/Bca8vL+1GMDC 068uNZxZTqVXxas0qKcY8MotdXg9y6u6eTwPsSLJazMxzZUjORjHdqPJfBq4rXZ1pZ83 QeXaL2e9MLVWvEke/LVrEK3NoWsfYT7YWlQ5ouxDjvAUriaKIh64qo1oTwe6/tfZzgX1 pMlAZg/gL8D22RvLz2yr6fPUDFZQI8lIOxS5dhNVyR213XUAbR8HeWarnCFyRWb1SyZV S4LMT/IcqCgUEy6GtF0j5c5TrOIQkjpvUJKkrtbQbeiR0HVN38s66tcFJqmgJV5Yocj4 7kwA== 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 u1si2683684iti.161.2017.10.16.06.02.36; Mon, 16 Oct 2017 06:02: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 23FDA60C3A; Mon, 16 Oct 2017 13:02:36 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 0EED260A1A; Mon, 16 Oct 2017 13:00:39 +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 CDAF460923; Mon, 16 Oct 2017 13:00:22 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id BA5D360845 for ; Mon, 16 Oct 2017 13:00:18 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 70E6E1802D38 for ; Mon, 16 Oct 2017 16:00:17 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4ZkVwA1s8H-0GXibv78; Mon, 16 Oct 2017 16:00:17 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0GQ4ovSG; Mon, 16 Oct 2017 16:00:16 +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 16:00:03 +0300 Message-Id: <1508158805-5932-7-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 6/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: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: 54f5fc670a7c125b6b0098e34e68fe3b45875069 **/ 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 7b1e2d467..40834524e 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -360,8 +360,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; /** @@ -375,7 +391,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); /**