From patchwork Fri Oct 27 08:00:09 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: 117299 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp476127qgn; Fri, 27 Oct 2017 01:04:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RXHCogWXQCJMpeRq45SwVwLLpcer0ItB32sH0uMbaNDwDWkWk6J3/lgayhWc1wfsmoKW0l X-Received: by 10.200.47.169 with SMTP id l38mr36834082qta.272.1509091458367; Fri, 27 Oct 2017 01:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091458; cv=none; d=google.com; s=arc-20160816; b=CYiMkCjyTiFrSYX7qnwjH1WRzNTRAwaRDDkCqEwehfFjidQRkXURu5qRfWCqCNw+8G 4uVda1HAjGyukW8M8qwRT/F+jKcl6NGDnz8CggnxmnOazjyJWvEOM5NVpVKdFZS+ep7/ tSdwFj2D4BPxBufqmmLm/hSYi3oV4aa2+Yokvt/TS/i5cyJugEGOmYf0MlR945dZgXwp xS68DLlq8sNO0ShVZWa/6SnOohOIWN71+vES5tZn2x34XodNtPT6qaQIoyHKnl+Vpiw7 WVXBBh2gjwaiyDQDmd5cHFbqJpVfwywbuE6qlPGFNcqedKoLz/RjSIST7HAdPDgeQnMf es6Q== 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=suFKe2PGpqz4LD2Q+8rayV67Hyfx4DoMybsg/0/zjAA=; b=N4huevQJVQn1LYaH2ZQ8RMKG1Ib1xEAOFT6LbHJkMPFuQRokXkuLcUJlFDEeSMybgs lLIjT9xqasyD5EUyBOIzr68HqU1dmpL+OJOwh2EH0TfM2G6ZcrHYiG9g3ncPj3JRvGJ6 3buaLPDABTDrg5shIbDmW5l3K5gxTfTzChEgw0P/uujQTnZIQDsPTzwjyrlCHE8Dz6xW SfqM6a9C829S65LABPxbYj/JRmAl5bsAn0E5O2V+saf38Tcypr0BvhbTyPlqzaxmeq5d jwyOuCZLICnnhAejpSBuNXFPGQP9MRm3Rl3yCChB+HMMStqubgOFqrkdOEqHetwtWty2 qnTQ== 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 b2si67362qke.152.2017.10.27.01.04.18; Fri, 27 Oct 2017 01:04:18 -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 00C44628FD; Fri, 27 Oct 2017 08:04:17 +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 9912B6295A; Fri, 27 Oct 2017 08:01:25 +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 398A3608BD; Fri, 27 Oct 2017 08:00:55 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id C3F3861044 for ; Fri, 27 Oct 2017 08:00:51 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward103p.mail.yandex.net (Yandex) with ESMTP id ACE442186BEA for ; Fri, 27 Oct 2017 11:00:50 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nc8VugHSS5-0o5ST1cT; Fri, 27 Oct 2017 11:00:50 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0nJ47lGo; Fri, 27 Oct 2017 11:00:50 +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:09 +0300 Message-Id: <1509091212-14398-6-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 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ include/odp/api/spec/pool.h | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 2900fc469..11feb1bc6 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -358,24 +358,42 @@ 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; /** Minimum data address. - * This is the minimum address that application accessible - * data of any object (event) allocated from the pool may - * locate. When there's no application accessible data - * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. + * + * This is the minimum address that application accessible + * data of any object (event) allocated from the pool may + * locate. When there's no application accessible data + * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. */ uintptr_t min_data_addr; /** Maximum data address. - * This is the maximum address that application accessible - * data of any object (event) allocated from the pool may - * locate. When there's no application accessible data - * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. + * + * This is the maximum address that application accessible + * data of any object (event) allocated from the pool may + * locate. When there's no application accessible data + * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. */ uintptr_t max_data_addr; + } odp_pool_info_t; /** @@ -389,7 +407,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); /**