From patchwork Tue Oct 17 14: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: 116116 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4936888qgn; Tue, 17 Oct 2017 07:04:04 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q/kmjF5v6EFstpjXRrLnZILMUh5QyiibEM+qPRb4Y6niMrm+slENyGJ7NrIWOMlH6C8M33 X-Received: by 10.107.34.132 with SMTP id i126mr11795247ioi.134.1508249044520; Tue, 17 Oct 2017 07:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508249044; cv=none; d=google.com; s=arc-20160816; b=FYDVF6iVoSK76aaUi+eUo49ZQOiUFS9Zztm5z1ZLaluyx8gc/l1KiBjXoJwb0gmhXz BYSJe8CQU2SWZZVHwpzFtIbEZc5Zeqi0JXTEUYZWL66+GiK++Tog/i2ilBtxn9DApugg x4N8nKz0uQOo9ehY/f7gGEyGvjA6DpquQRgXy6+8V0YD30ekKUaud+Qk0hC61B4GREFO SqXsTuV5qj0IGTu9rwlYZQ2rk8C5bMY/5qqq4vihigS8QYHUZgEUNHKnk2QnOrfUIQCG NIkZ65siH6m4bbGDDL1xBNpqJYiS/Ts719oeFp0Ucxc4ChRwD7+tETo9tjK63LRdHDhq o6/A== 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=6+GmNt5onJBYoEFMjmVb1mw2/OxouvDlggmg7ioCt2M=; b=UAfKYcP+I0BJiIWN3izcF3tLb2E9N9oY5wpq9H8iJW0kxZKTF6jcasUJz1OTxA/Uck kXmJ86Sw6kz/9neZFzFm1jNmlOBVsUscX6LzOUYxYNOrZIWyXTyQFgQl3NcehlrXgItv NWvTpH7h1JjxqA9uDZQJ5IclM6SJ+ABERpMBm6korDhYLaRefh3B2W1gqOOIhlubu4Bc 6YjODMBIHWm5+o+pNddfXBu18IE7ukexn0r+9sMuZmWIWv6zVgjhttXOO82Ey9p7JCla SISRDwEncbT6iD6YMp2b3yEfZHlcj6W13hJAbcE6RpOotgyh6XkceqiYhk+jZgePS8Kn 1E8g== 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 c66si6904893ioc.177.2017.10.17.07.04.04; Tue, 17 Oct 2017 07:04:04 -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 D801C62A5C; Tue, 17 Oct 2017 14:04:03 +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 7B80A628D4; Tue, 17 Oct 2017 14:00:58 +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 6A7BC628C1; Tue, 17 Oct 2017 14:00:26 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 01CE9628B2 for ; Tue, 17 Oct 2017 14:00:19 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 683F92A21FB9 for ; Tue, 17 Oct 2017 17:00:17 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id OZ9HKg5oRf-0HGCW4Th; Tue, 17 Oct 2017 17:00:17 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tTs7mS0qFy-0G4mqORB; Tue, 17 Oct 2017 17: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: Tue, 17 Oct 2017 17:00:06 +0300 Message-Id: <1508248809-4850-6-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 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: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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); /**