From patchwork Mon Oct 16 12:59:58 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: 115909 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3658680qgn; Mon, 16 Oct 2017 06:03:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SEJNC1dIoyYofzxyskyc1y4GY4S6imTu7LcEcVgv5cRpUdwl76mEZ3lBcj1DmpaZo68Ywe X-Received: by 10.107.161.144 with SMTP id k138mr11994953ioe.218.1508159012549; Mon, 16 Oct 2017 06:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159012; cv=none; d=google.com; s=arc-20160816; b=NmBOy0nDbGTvMuU2RCyga4zTRXh1+QJprWcUYDSLs5IlZGa09FbhRfJ5mxl+nXbcvk WMabRCCIivjk1qkHHrtyrRAPR0TTmYKLaKJhO3GnCj+o+C+WVe+PbpWrhvbJlG+4OxGz jLxSW7jP0KmQghBTvlFNxKZcAmYBtzHFCFgZru0hIOIlPPKhxh10xiRJIVABNM18PMQe /g01Fxo1PjNaz9meuTkcRlDsqlIzzQZJjjQaxdDGOgDCVVHnKUVQCqI47B8dKBqVnVZI rNgf7Q6WHI3RKqEbKRD1SH0ndp6ZbsGVAMvqKCpsxcLeHhdJ4QOJhhq1cuIvE8GPcDIX 753A== 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=iEVj1FcJpEesvh73bddjE6PKFWefG8x4KzccuPu69uk=; b=vB2dHIWT/YVklNs3K6fz1Xc+cGrP3WZaqD9WWJSrZsZW1WAGmPWW8w8ou9xwJWWvXV UQuy0u2uw/WRxrBs3v+4zRAzKRBX45x0zQGD1E0g/Iba3Zcq0a54ZN9H8xdTIs1sy8CZ +K1PwGr1y8SMjudmnqD1w65LqD0WUPHRjFpR0HYRu8qWKvzU15xV2U3fzcDW4ulxagow wLU4sm6TWPCQCr4OAxVArh56NZF8gqtRCAegmI/5rU5HpAXU9Lnkt3nsNCuHUMj+Tjhz 1CQ0xIQiPDKNHGbKLo3CzZsF2uzcMNpOpmPF7sEWbKtwH2NMbTvcTLOZlCSU0rZxithc IGrA== 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 b82si5393441iof.265.2017.10.16.06.03.32; Mon, 16 Oct 2017 06:03:32 -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 1480060B40; Mon, 16 Oct 2017 13:03:32 +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 4DE9F60A58; Mon, 16 Oct 2017 13:00:42 +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 9FD2160927; Mon, 16 Oct 2017 13:00:24 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id CCD71607DC for ; Mon, 16 Oct 2017 13:00:12 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward104j.mail.yandex.net (Yandex) with ESMTP id C646442412 for ; Mon, 16 Oct 2017 16:00:11 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id JJa9RybE9q-0BGmuURV; Mon, 16 Oct 2017 16:00:11 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0BQeKHss; Mon, 16 Oct 2017 16:00:11 +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 15:59:58 +0300 Message-Id: <1508158805-5932-2-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 1/8] api: pool: relax packet pool param num 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 Added packet pool parameter 'max_num', so that 'num' parameter can be round up by the implementation. Most implementations have a fixed segment size, and need this flexibility. For example, when 'len' is larger than the pool segment size, there may be e.g. 2 x 'num' segments in the poool, and thus it would be able to allocate 2 x 'num' small packets. When application needs to limit maximum number of packets on a pool, it can use the new max_num param for that. Otherwise, it would leave 'max_num' to zero (== no limit). 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 | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 221798ee8..f1c8b1158 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -164,10 +164,11 @@ int odp_pool_capability(odp_pool_capability_t *capa); /** * Pool parameters - * Used to communicate pool creation options. - * @note A single thread may not be able to allocate all 'num' elements - * from the pool at any particular time, as other threads or hardware - * blocks are allowed to keep some for caching purposes. + * + * A note for all pool types: a single thread may not be able to allocate all + * 'num' elements from the pool at any particular time, as implementations are + * allowed to store some elements (per thread and HW engine) for caching + * purposes. */ typedef struct odp_pool_param_t { /** Pool type */ @@ -192,17 +193,34 @@ typedef struct odp_pool_param_t { /** Parameters for packet pools */ struct { - /** The number of packets that the pool must provide - that are packet length 'len' bytes or smaller. - The maximum value is defined by pool capability - pkt.max_num. */ + /** Minimum number of 'len' byte packets. + * + * The pool must contain at least this many packets + * that are 'len' bytes or smaller. An implementation + * may round up the value, as long as the 'max_num' + * parameter below is not violated. The maximum value + * for this field is defined by pool capability + * pkt.max_num. + */ uint32_t num; - /** Minimum packet length that the pool must provide - 'num' packets. The number of packets may be less - than 'num' when packets are larger than 'len'. - The maximum value is defined by pool capability - pkt.max_len. Use 0 for default. */ + /** Maximum number of packets. + * + * This is the maximum number of packets of any length + * that can be allocated from the pool. The maximum + * value is defined by pool capability pkt.max_num. + * Use 0 when there's no requirement for the maximum + * number of packets. The default value is 0. + */ + uint32_t max_num; + + /** Minimum length of 'num' packets. + * + * The pool must contain at least 'num' packets up to + * this packet length (1 ... 'len' bytes). The maximum + * value for this field is defined by pool capability + * pkt.max_len. Use 0 for default. + */ uint32_t len; /** Maximum packet length that will be allocated from From patchwork Mon Oct 16 12:59:59 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: 115907 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3655929qgn; Mon, 16 Oct 2017 06:01:36 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDCpgg8u20EBgQ+EeUuHK1x7kgzhOVpMq9w/HAydQXyQ91LM+MwvSsa1ytDZ/6j821x2wkk X-Received: by 10.107.20.137 with SMTP id 131mr12499061iou.137.1508158896271; Mon, 16 Oct 2017 06:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508158896; cv=none; d=google.com; s=arc-20160816; b=EhLI7eUssQDFeMLa2kCpgbtjUuZW0gwg//YrcMBAfLeyfNWkfjpOujNdtUtx3A5g+M ndAYUu44OMmtrwRvazVi4IqriPAq4D0i3FLKtC8s81KAWYd0K70kIEV3b0gbCnH5oFpV bb5AApvG+ncX8Ine6WcAI6P1rtr19OroEmxIDQIbYpJo8aFcluLaZswDgYGHNM4F1cVR e3gKtAHW4be+3mvWONcycMqvH8HErFGR+00ny5BL9Oyzzb/iLo/gPFUK207LDSpyMoeV qLDS4dhnzAcrQgfHpd9ydg0L2ktoUJqGb30WuwIlG7OAWiFQG4/1kYlxV21wQZeas0pY bSvQ== 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=Z52YrjiICuGRGT2+I0DJrs/5QsenzbQIabhy2CCRwyE=; b=boBkxQkM8+PfOY2yBwGlXzQ57vL4a3L0h8gqRv8EMei+rlEcVSVa9m/Z3AmU1MOhBz R874UcR57adky6mP5Z86+rrbqQ3e08sPQnHszKW/41zZa/wEvg4hcJSKgEs0fqdI/YYA qez9ndjChiZAE/h6kcWzwTiGdx2489wzvXWVmsFdh9oCHT4Ghr91Xt6oBuQiWaQfG2N4 NnFJ/K41uv4hvRXzyTKn4RpRyJNHPK1ytEuY2ibeiOvptPZYf+O/76JJkRiKFvdBSd1g bVftNxHwvyu2FbUtKvBrEks0O2j6ifoYP/x93w+lywl/oRO0RCYNK+8AwtdrrbzdcbpI oAvw== 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 g19si5403299iod.115.2017.10.16.06.01.35; Mon, 16 Oct 2017 06:01: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 9B1B160853; Mon, 16 Oct 2017 13:01:35 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 A480C6095C; Mon, 16 Oct 2017 13:00:32 +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 4726A60632; Mon, 16 Oct 2017 13:00:17 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id E8C0E60632 for ; Mon, 16 Oct 2017 13:00:14 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 6C397510189A for ; Mon, 16 Oct 2017 16:00:12 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5hcA9Ugoh3-0CkWZokq; Mon, 16 Oct 2017 16:00:12 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0BQ820aV; Mon, 16 Oct 2017 16:00:11 +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 15:59:59 +0300 Message-Id: <1508158805-5932-3-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 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: 54f5fc670a7c125b6b0098e34e68fe3b45875069 **/ include/odp/api/spec/pool.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index f1c8b1158..7c9bee8ee 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_sub; } 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,32 @@ 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_sub. The default value is 0. + */ + uint8_t num_sub; + + /** 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 */ From patchwork Mon Oct 16 13:00:00 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: 115912 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3662622qgn; Mon, 16 Oct 2017 06:06:33 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB2VpvFxhd1JcES5mD7FOrkhDkCaAFBIy4Hlx7CNtyhPuZyY9I4+CuyV6NZYH9eKNJQBbJt X-Received: by 10.200.23.220 with SMTP id r28mr14218613qtk.247.1508159193457; Mon, 16 Oct 2017 06:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159193; cv=none; d=google.com; s=arc-20160816; b=OYsVJEx+ryIbAKCi9JIgESESuAZ1wM3OlaKkxf4dcHP60kr2hfylgv/Wj9TOZP95SS UhsEU5n5Jzgdsua29jN+OuLA0G4WCwYYcyXlJp4zovl6onRBppRruI6L1Qn6RO1vOLGv 7BGLcO544Au1Ge42GU37K3KbCaEeWQp9Lwo2eA+tQiQht9z2KHIJgEWiTtyaghxhlgJf yqbkpHWlpxjiG+6EBH6/5R9/TvG4czRaQYKbyNqGvQJ7yJXwZ72CEzjZsuLuRrkhngR+ psn/i7fntH2tnX8LxusWE6lFbXDQvHf4WjJyRdFHDQ/cJptigrNJli8X3gvxAI2ZU+hi mjng== 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=2L6FWnMgWCY3V+V3EGQlb9TZbPRiKhSTiE2aZc7S0o8=; b=k4fzQ8WAGKUaZtPcEcXD56fNqSI95oa7u6lCnaub7eXLhQgyj2j5GDzYSrRxvgztmX sXMrsRq0UMHnlbUkN5uGBZR1Ytdovth9DwPcSf7xW8JVYE37GtmDEQj8IFDELbywhY4u Q0M4fDfKTJ/RQYKtpkwRF3/3rDNsSBLKVt359Ae38XAvpkdp0yAkPSMxiqAEXniIc8hm g58bB/0VQmkYiSsENVH8ryrc+NnzEGLgcHf0XfZDCXnEgtKwad2angUo6BlVcRohUb40 XB6i9yM/VQXIaviOxlw8K9amTFyIpi2tnQ4+63HA1doSawsICndSu3z9UuWoEDHYAdOH bz4w== 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 x6si1504465qkg.233.2017.10.16.06.06.33; Mon, 16 Oct 2017 06:06:33 -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 2A21260D3D; Mon, 16 Oct 2017 13:06:33 +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_H4, 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 44FF660B19; Mon, 16 Oct 2017 13:00:53 +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 0DE4B60923; Mon, 16 Oct 2017 13:00:26 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 55CB260821 for ; Mon, 16 Oct 2017 13:00:15 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward105j.mail.yandex.net (Yandex) with ESMTP id EB73218215F for ; Mon, 16 Oct 2017 16:00:13 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 1SlOQg1R7D-0D58GnJk; Mon, 16 Oct 2017 16:00:13 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0CQqggmY; Mon, 16 Oct 2017 16:00:12 +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:00 +0300 Message-Id: <1508158805-5932-4-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 3/8] validation: pool: add subparam test 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 Test packet pool subparameters when those are supported. 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 **/ test/common_plat/validation/api/pool/pool.c | 98 +++++++++++++++++++++++++++++ test/common_plat/validation/api/pool/pool.h | 3 +- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/test/common_plat/validation/api/pool/pool.c b/test/common_plat/validation/api/pool/pool.c index e633137ab..bffb6c2bb 100644 --- a/test/common_plat/validation/api/pool/pool.c +++ b/test/common_plat/validation/api/pool/pool.c @@ -10,6 +10,9 @@ #include "odp_cunit_common.h" #include "pool.h" +#define PKT_LEN 400 +#define PKT_NUM 500 + static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; @@ -96,10 +99,105 @@ void pool_test_lookup_info_print(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +void pool_test_alloc_packet(void) +{ + odp_pool_t pool; + odp_pool_param_t param; + uint32_t i, num; + odp_packet_t pkt[PKT_NUM]; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET, + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + + pool = odp_pool_create(NULL, ¶m); + + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + num = 0; + + for (i = 0; i < PKT_NUM; i++) { + pkt[num] = odp_packet_alloc(pool, PKT_LEN); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + +void pool_test_alloc_packet_subparam(void) +{ + odp_pool_t pool; + odp_pool_capability_t capa; + odp_pool_param_t param; + uint32_t i, j, num, num_sub; + odp_packet_t pkt[PKT_NUM]; + + CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); + num_sub = capa.pkt.max_num_sub; + + CU_ASSERT_FATAL(num_sub <= ODP_POOL_MAX_SUBPARAMS); + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET, + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + param.pkt.num_sub = num_sub; + + for (i = 0; i < num_sub; i++) { + param.pkt.sub[i].num = PKT_NUM; + param.pkt.sub[i].len = PKT_LEN + (i * 100); + } + + pool = odp_pool_create(NULL, ¶m); + + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + num = 0; + + for (i = 0; i < PKT_NUM; i++) { + pkt[num] = odp_packet_alloc(pool, PKT_LEN); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + + for (j = 0; j < num_sub; j++) { + num = 0; + + for (i = 0; i < param.pkt.sub[j].num; i++) { + pkt[num] = odp_packet_alloc(pool, param.pkt.sub[j].len); + CU_ASSERT(pkt[num] != ODP_PACKET_INVALID); + + if (pkt[num] != ODP_PACKET_INVALID) + num++; + } + + for (i = 0; i < num; i++) + odp_packet_free(pkt[i]); + } + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + odp_testinfo_t pool_suite[] = { ODP_TEST_INFO(pool_test_create_destroy_buffer), ODP_TEST_INFO(pool_test_create_destroy_packet), ODP_TEST_INFO(pool_test_create_destroy_timeout), + ODP_TEST_INFO(pool_test_alloc_packet), + ODP_TEST_INFO(pool_test_alloc_packet_subparam), ODP_TEST_INFO(pool_test_lookup_info_print), ODP_TEST_INFO_NULL, }; diff --git a/test/common_plat/validation/api/pool/pool.h b/test/common_plat/validation/api/pool/pool.h index 29e517633..3f8f5ebce 100644 --- a/test/common_plat/validation/api/pool/pool.h +++ b/test/common_plat/validation/api/pool/pool.h @@ -13,8 +13,9 @@ void pool_test_create_destroy_buffer(void); void pool_test_create_destroy_packet(void); void pool_test_create_destroy_timeout(void); -void pool_test_create_destroy_buffer_shm(void); void pool_test_lookup_info_print(void); +void pool_test_alloc_packet(void); +void pool_test_alloc_packet_subparam(void); /* test arrays: */ extern odp_testinfo_t pool_suite[]; From patchwork Mon Oct 16 13:00:01 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: 115910 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3659926qgn; Mon, 16 Oct 2017 06:04:27 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ShZPQigwr5/jDPeYyIiij1NLUR4JyQCszXebtV23wA0U6kK/StxHuLO0bTf5mI6JxuOxE2 X-Received: by 10.36.4.212 with SMTP id 203mr1050500itb.10.1508159067820; Mon, 16 Oct 2017 06:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159067; cv=none; d=google.com; s=arc-20160816; b=iRl/k6acCb8BG+JtJkfGYbwXMHM5BLOUxJCSBXlnQ4h1dbJGMnF0Bue8m7BcrWi/iu y4Js6ygFGIne6B3FfiXW27bHVigipvSW6tevd4MWhPVJI3pzI6PdBVnHUEBTyZuMSpk6 UrwgjGACm9d/bQQqUc3VQhUxwvvzlX2fs6yVdJevXHa9l7ahiBp8r19olmqgl1A/bkQ3 MIgDVe62AXS/BzddYhcULLaFEAhL2XqFLy8rfD57yaiMlGpHMBcfiYntjwNjdNzZD2cV oqhxyjrNdp0KtXVjZieNWEExyRowtL0N+Sk+AMjPPIgd1RU4XUxjYxUqlP1wfy5t70+f Zy2w== 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=hK8BY/b77WheFdtzxB/MWATcCjCNEXo5fGHs4klBHOw=; b=DZoIGpQuO4gXn8nAs0zlKh1O9Tpz1Pcz4XvucH6eEkje52WxcdfLj75eZQPO+FhZUg UjhySowGrq31IZXwfZeev4lAXcyD81dPfeaaO5kaMnit9LoIUBGbPVgu4DBkQ2yX/ASM m7v1J4nS5ODN9yfHn9OlTTytLmlIcd/n1nVMhHBTyVracgv5BsOn+Lqnyx7dxJYnaBlo 7j+m4NiQukp1yItwlrQ7VX5dDPgdZZIvh40oBCHqMrICcTYmDSqnPFPBSVsZXzHphDoo QHJ+/7oWFD9EUWkAv5rBFKZKuMsiaNnGq7Adlcyt+so7o+4OyNbZ0H2nPgd8pTzT/6Lf 5RKA== 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 184si5523899iou.324.2017.10.16.06.04.27; Mon, 16 Oct 2017 06:04:27 -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 F0B5460C90; Mon, 16 Oct 2017 13:04:26 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 9556260A81; Mon, 16 Oct 2017 13:00:47 +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 D43C660923; Mon, 16 Oct 2017 13:00:24 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 5EBEF6082D for ; Mon, 16 Oct 2017 13:00:18 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward103o.mail.yandex.net (Yandex) with ESMTP id C45CA588236D for ; Mon, 16 Oct 2017 16:00:14 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id m0GXTr4NEE-0EvOk6KI; Mon, 16 Oct 2017 16:00:14 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0EQis6PX; Mon, 16 Oct 2017 16:00:14 +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:01 +0300 Message-Id: <1508158805-5932-5-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 4/8] validation: pool: initialize params correctly 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 Use odp_pool_param_init() to initialize pool parameters. 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 **/ test/common_plat/validation/api/pool/pool.c | 87 ++++++++++++++--------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/test/common_plat/validation/api/pool/pool.c b/test/common_plat/validation/api/pool/pool.c index bffb6c2bb..b4c2917b1 100644 --- a/test/common_plat/validation/api/pool/pool.c +++ b/test/common_plat/validation/api/pool/pool.c @@ -16,11 +16,11 @@ static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; -static void pool_create_destroy(odp_pool_param_t *params) +static void pool_create_destroy(odp_pool_param_t *param) { odp_pool_t pool; - pool = odp_pool_create(NULL, params); + pool = odp_pool_create(NULL, param); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); CU_ASSERT(odp_pool_to_u64(pool) != odp_pool_to_u64(ODP_POOL_INVALID)); @@ -29,42 +29,41 @@ static void pool_create_destroy(odp_pool_param_t *params) void pool_test_create_destroy_buffer(void) { - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER, + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_packet(void) { - odp_pool_param_t params = { - .pkt = { - .seg_len = 0, - .len = default_buffer_size, - .num = default_buffer_num, - }, - .type = ODP_POOL_PACKET, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET; + param.pkt.len = default_buffer_size; + param.pkt.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_timeout(void) { - odp_pool_param_t params = { - .tmo = { - .num = default_buffer_num, - }, - .type = ODP_POOL_TIMEOUT, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_TIMEOUT; + param.tmo.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_lookup_info_print(void) @@ -72,16 +71,16 @@ void pool_test_lookup_info_print(void) odp_pool_t pool; const char pool_name[] = "pool_for_lookup_test"; odp_pool_info_t info; - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool = odp_pool_create(pool_name, ¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER; + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool = odp_pool_create(pool_name, ¶m); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); pool = odp_pool_lookup(pool_name); @@ -89,10 +88,10 @@ void pool_test_lookup_info_print(void) CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); - CU_ASSERT(params.buf.size <= info.params.buf.size); - CU_ASSERT(params.buf.align <= info.params.buf.align); - CU_ASSERT(params.buf.num <= info.params.buf.num); - CU_ASSERT(params.type == info.params.type); + CU_ASSERT(param.buf.size <= info.params.buf.size); + CU_ASSERT(param.buf.align <= info.params.buf.align); + CU_ASSERT(param.buf.num <= info.params.buf.num); + CU_ASSERT(param.type == info.params.type); odp_pool_print(pool); From patchwork Mon Oct 16 13:00:02 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: 115911 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3661160qgn; Mon, 16 Oct 2017 06:05:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TxdueERxY5XtemAMnx+YCBNdTVnVMY5hIAsEEvb4hw+HFtLkO5zR7tTkxE6q4JZL0kLooa X-Received: by 10.36.185.67 with SMTP id k3mr938734iti.112.1508159123603; Mon, 16 Oct 2017 06:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159123; cv=none; d=google.com; s=arc-20160816; b=CNFSX6Ota4tt4U3HJmgIdi+rlC/ZaaK4qhAuaIIrN+AGoSqf4ybRg6DkMCZjmrkWRM CP/BHR7pr0gDEzR/e3AxCg6R2hNkcbAN+VSFXSGC8zgWOelvTfB6F9mwnKQXjLyW4+ww uz8AcRA4joiP4HimQH8XmMC11GINz3c0YPWjesa2ccWaH0PcHamlHDvpPjEaJnhnA3ad 7h6553Nae0VrWXvnekcegDl6pwZHQd2kEfBbGA/I9UNdeHF59DRxUWIGjy7DgywfngJw XTE4bAJIvQJPMTBLRaWF/9oTnxDiP/uLie2MP1+cgtI4bp1ZY+SDeuKx7PCsLpFYQmq3 i4BA== 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=jZ1pXa3v1Uq+WjSEO5QAfMLiYbzs+fk6uFgLjabeyMQ=; b=C/zVOvVCFZ+yzfZLXBgpWJDIX+LUFC6CfFX+kV1A1Z45fa3vVhjkMRqaoza6rAQJ+n +uUcZWw9CJVBO1YR8fbZL3Pxrijs6An6wN9WulANfPKcDVcMBzKBJ+fCDIZVnOke89fP fTKtFYpEbpRFRG/HaJbPfI3zO1hNWzQYVLv2upFTzjT0zJ9I7d8CYj8tILVHNxucRRq6 JHNJMHv1l6lvINMeL1tyWi3rCLrA8wWXy/NyOfgvW7DL8mKs5Wsdb3i7tq7800P8jHMJ wQObH1ADfSZ5wNdjLpWZknCPY5+fe3WKLgIinVJ2WU5sdxr9XAr0mfeIOB5Kd0adhFSt iWJQ== 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 u7si5389991itd.45.2017.10.16.06.05.22; Mon, 16 Oct 2017 06:05:23 -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 A428F60CA0; Mon, 16 Oct 2017 13:05:22 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 F098360AC8; Mon, 16 Oct 2017 13:00:50 +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 8ECD76082D; Mon, 16 Oct 2017 13:00:25 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id BE49D60632 for ; Mon, 16 Oct 2017 13:00:17 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 4C2636A81412 for ; Mon, 16 Oct 2017 16:00:16 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nwqhgEX43j-0FOiFqUw; Mon, 16 Oct 2017 16:00:15 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0EQSLkZs; Mon, 16 Oct 2017 16:00:14 +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:02 +0300 Message-Id: <1508158805-5932-6-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 5/8] api: pool: remove union from params 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 Remove anonymous union from pool parameter structure. Union makes it impossible to initialize parameters per pool type (use other values than all zeros). This change is not visible to applications (union was anonymous). 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 | 215 ++++++++++++++++++++++---------------------- 1 file changed, 109 insertions(+), 106 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 7c9bee8ee..7b1e2d467 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -195,112 +195,115 @@ typedef struct odp_pool_param_t { /** Pool type */ int type; - /** Variant parameters for different pool types */ - union { - /** Parameters for buffer pools */ - struct { - /** Number of buffers in the pool */ - uint32_t num; - - /** Buffer size in bytes. The maximum number of bytes - application will store in each buffer. */ - uint32_t size; - - /** Minimum buffer alignment in bytes. Valid values are - powers of two. Use 0 for default alignment. - Default will always be a multiple of 8. */ - uint32_t align; - } buf; - - /** Parameters for packet pools */ - struct { - /** Minimum number of 'len' byte packets. - * - * The pool must contain at least this many packets - * that are 'len' bytes or smaller. An implementation - * may round up the value, as long as the 'max_num' - * parameter below is not violated. The maximum value - * for this field is defined by pool capability - * pkt.max_num. - */ - uint32_t num; - - /** Maximum number of packets. - * - * This is the maximum number of packets of any length - * that can be allocated from the pool. The maximum - * value is defined by pool capability pkt.max_num. - * Use 0 when there's no requirement for the maximum - * number of packets. The default value is 0. - */ - uint32_t max_num; - - /** Minimum length of 'num' packets. - * - * The pool must contain at least 'num' packets up to - * this packet length (1 ... 'len' bytes). The maximum - * value for this field is defined by pool capability - * pkt.max_len. Use 0 for default. - */ - uint32_t len; - - /** Maximum packet length that will be allocated from - the pool. The maximum value is defined by pool - capability pkt.max_len. Use 0 for default (the - pool maximum). */ - uint32_t max_len; - - /** Minimum number of packet data bytes that are stored - in the first segment of a packet. The maximum value - is defined by pool capability pkt.max_seg_len. - Use 0 for default. */ - uint32_t seg_len; - - /** User area size in bytes. The maximum value is - defined by pool capability pkt.max_uarea_size. - Specify as 0 if no user area is needed. */ - uint32_t uarea_size; - - /** Minimum Headroom size in bytes. Each newly allocated - packet from the pool must have at least this much - headroom. The maximum value is defined by pool - 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_sub. The default value is 0. - */ - uint8_t num_sub; - - /** 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 */ - struct { - /** Number of timeouts in the pool */ - uint32_t num; - } tmo; - }; + /** Parameters for buffer pools */ + struct { + /** Number of buffers in the pool */ + uint32_t num; + + /** Buffer size in bytes. The maximum number of bytes + * application will store in each buffer. + */ + uint32_t size; + + /** Minimum buffer alignment in bytes. Valid values are + * powers of two. Use 0 for default alignment. + * Default will always be a multiple of 8. + */ + uint32_t align; + } buf; + + /** Parameters for packet pools */ + struct { + /** Minimum number of 'len' byte packets. + * + * The pool must contain at least this many packets + * that are 'len' bytes or smaller. An implementation + * may round up the value, as long as the 'max_num' + * parameter below is not violated. The maximum value + * for this field is defined by pool capability + * pkt.max_num. + */ + uint32_t num; + + /** Maximum number of packets. + * + * This is the maximum number of packets of any length + * that can be allocated from the pool. The maximum + * value is defined by pool capability pkt.max_num. + * Use 0 when there's no requirement for the maximum + * number of packets. The default value is 0. + */ + uint32_t max_num; + + /** Minimum length of 'num' packets. + * + * The pool must contain at least 'num' packets up to + * this packet length (1 ... 'len' bytes). The maximum + * value for this field is defined by pool capability + * pkt.max_len. Use 0 for default. + */ + uint32_t len; + + /** Maximum packet length that will be allocated from + * the pool. The maximum value is defined by pool + * capability pkt.max_len. Use 0 for default (the + * pool maximum). + */ + uint32_t max_len; + + /** Minimum number of packet data bytes that are stored + * in the first segment of a packet. The maximum value + * is defined by pool capability pkt.max_seg_len. + * Use 0 for default. + */ + uint32_t seg_len; + + /** User area size in bytes. The maximum value is + * defined by pool capability pkt.max_uarea_size. + * Specify as 0 if no user area is needed. + */ + uint32_t uarea_size; + + /** Minimum Headroom size in bytes. Each newly allocated + * packet from the pool must have at least this much + * headroom. The maximum value is defined by pool + * 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_sub. The default value is 0. + */ + uint8_t num_sub; + + /** 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 */ + struct { + /** Number of timeouts in the pool */ + uint32_t num; + } tmo; } odp_pool_param_t; /** Packet pool*/ 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); /** From patchwork Mon Oct 16 13:00:04 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: 115914 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3665685qgn; Mon, 16 Oct 2017 06:09:19 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TZZkjsX8yrsNRuYReKzXFYmvSNkdLDnwYZWYdXfsYJhyBERb0L6Za6EI3VfALY2/mh+3RM X-Received: by 10.200.1.136 with SMTP id x8mr14837338qtf.259.1508159359222; Mon, 16 Oct 2017 06:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159359; cv=none; d=google.com; s=arc-20160816; b=fDWlD1qNFHlImeUTw6UAa27x4PX9T7OlTbZm/yYFNGf4+xZe9SOfdV/wHHisH3ZBBg tbY8JQ4G4YsXE8oGJwpj58zHOTjSVg3+v8i9xN7mPaAJHLxcRFiw1BndL0VZA5+ArZnC agjCXQkAas5ffW20uzWbskcNIx/OSZ6FoGc4fK68C0/pxEQ5agKqcIuJPJPaCGRZmzBO wLCKboSfp5AZZKaGVtL1BNVYSdYFF+Iqki/81YsF9qG/fK7AI2NpkDwvCLeg/ihGmFMH NQNyjCfD79OgVxpbN2lsjhoAx5nSzM4TrL0JNBWjemYW9viP+nN0u69TIo3uNeYMbGbQ KH2g== 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=3Fc/sQj9w+eQykcgPyBizT6BOCfRMCebVgH/22hpAlo=; b=GAtFYmIEje3G8G9Tr8GQKGboqKQu6WYMfa6Q59lbB2kODiNTg3vPSsd+7Ak4xPDYxz s1vkzKmA+fjgUrxfKk4BJscBnzz6bjCjt8BsRuuHP7vuTxqepo6sK3iw+OsNRFCluRRo nI9ilqQ3VSSXXR0UzvRmEqeyqNZUNhVtyRhInCvwTOYmffvBGUveA0RY1m5V18VCLqYa DfAb2ZaBV+2XCK8mM7MkHRZenxs6tIwleRMcgZvOeTl3liHYdfCi22SM17wYi3jMLmtZ pW8BPXHXIoZCYum2J4AbCBzgWnmzHHaw/zXnxvAVKMs0Jqguj3Cm/tDi3nux9kk8gThj IHVA== 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 d19si6281651qkg.484.2017.10.16.06.09.19; Mon, 16 Oct 2017 06:09:19 -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 DFAEC61009; Mon, 16 Oct 2017 13:09:18 +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 6BDC560B4A; Mon, 16 Oct 2017 13: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 3296F60AC0; Mon, 16 Oct 2017 13:01:21 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id AA44E6062F for ; Mon, 16 Oct 2017 13:00:21 +0000 (UTC) Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 2C2FB43016B2 for ; Mon, 16 Oct 2017 16:00:18 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ydatmui5wD-0IZqPAmU; Mon, 16 Oct 2017 16:00:18 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0HQWh7xx; Mon, 16 Oct 2017 16:00:17 +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:04 +0300 Message-Id: <1508158805-5932-8-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 7/8] linux-gen: pool: implement max_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 Implemented max_num info for packet pools. 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 **/ platform/linux-generic/odp_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index b0b1adafc..b8ab99d98 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -682,6 +682,9 @@ int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) info->name = pool->name; info->params = pool->params; + if (pool->params.type == ODP_POOL_PACKET) + info->pkt.max_num = pool->num; + return 0; } From patchwork Mon Oct 16 13:00:05 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: 115913 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3664163qgn; Mon, 16 Oct 2017 06:07:56 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R6DkMDskwZAOlNQrDNYcKK4vFQFJWkMf1R6QLTnRhInlzy+lrcVw6elFNTZCsTGGvGRRYW X-Received: by 10.107.150.199 with SMTP id y190mr12648253iod.132.1508159276403; Mon, 16 Oct 2017 06:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159276; cv=none; d=google.com; s=arc-20160816; b=mmjRQwY+s8F0h5IAsSSCXryWMxs60Vr4BEbp0t1WHrFt+2cGMx29h+bXBCr7oOqG4J QGWfflCaof+jCj7C3fod917aFd2FltDm1DEELkB+UbfvBpNL1l5VZET8RDOb7qPRao4G az/Jv7KH+VwAJwpsN2yE00gupiutxZdv+1Yln+LTvlFWduw2NlsIbP3rTIxCgIfPQ6XG 1wCzg+Px9FofyhbWIIoPq5LriJl2QVeYNd7I5aBlTinZU5f/aseFwKjHdA+Wki6+ZhCw 3H9d0Pg8UYuivI+4w+pX6CZz/m/ga8Cxt03xGZrSyqPah7fCkGrp4oN74aXvYuzlOzZw e+WQ== 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=O1pz5WoHX1zU9hsksjHABxzfj6yZSOFby8hrnToRHNk=; b=zQ2Zurfve2wP5XNK9Kua3LUTfQXFEKkPeyYWfVRQ5xWRY7KAbfJsWHwcWeUI5tkqSY qMpxe2t32reddLBUt6Ujo8higyJqiw1QF3XbsbhOJUBBDNe8Mi32r36J+ADBcODCh0Dg u3BZMWFrAXicIyVWa0Eefn8LlX/mT7G6TuWhzuBe0ZVjzuc3cYaVOxl1sg5rk+jmOzcB m2hC0OQf4WwA5vrkmeb/qH5ri6pxokgCJoCYMgvevxRdcJX2mO85T8irhCToZ9FOmFn9 dGHi9CGabjGqfOowsEPqBAczGVrrdtbvsEwvxhhi1DscqagsRiA+oMUcs6obEKO23KVh 8NvA== 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 y86si5167932ita.142.2017.10.16.06.07.56; Mon, 16 Oct 2017 06:07:56 -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 E3C0761002; Mon, 16 Oct 2017 13:07:55 +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 F0E0A60845; Mon, 16 Oct 2017 13:01:21 +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 D183D60B5A; Mon, 16 Oct 2017 13:01:16 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id B96D9608E8 for ; Mon, 16 Oct 2017 13:00:19 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward106j.mail.yandex.net (Yandex) with ESMTP id B84981802B60 for ; Mon, 16 Oct 2017 16:00:18 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4PybCRHn0D-0IoulL6x; Mon, 16 Oct 2017 16:00:18 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0IQSKovo; Mon, 16 Oct 2017 16:00:18 +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:05 +0300 Message-Id: <1508158805-5932-9-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 8/8] validation: pool: add packet info test 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 Added odp_pool_info() test for packet pools. 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 **/ test/common_plat/validation/api/pool/pool.c | 28 ++++++++++++++++++++++++++++ test/common_plat/validation/api/pool/pool.h | 1 + 2 files changed, 29 insertions(+) diff --git a/test/common_plat/validation/api/pool/pool.c b/test/common_plat/validation/api/pool/pool.c index b4c2917b1..2be4f80a1 100644 --- a/test/common_plat/validation/api/pool/pool.c +++ b/test/common_plat/validation/api/pool/pool.c @@ -191,12 +191,40 @@ void pool_test_alloc_packet_subparam(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +void pool_test_info_packet(void) +{ + odp_pool_t pool; + odp_pool_info_t info; + odp_pool_param_t param; + const char pool_name[] = "test_pool_name"; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET; + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + + pool = odp_pool_create(pool_name, ¶m); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); + + CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); + CU_ASSERT(info.params.type == ODP_POOL_PACKET); + CU_ASSERT(info.params.pkt.num == param.pkt.num); + CU_ASSERT(info.params.pkt.len == param.pkt.len); + CU_ASSERT(info.pkt.max_num >= param.pkt.num); + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + odp_testinfo_t pool_suite[] = { ODP_TEST_INFO(pool_test_create_destroy_buffer), ODP_TEST_INFO(pool_test_create_destroy_packet), ODP_TEST_INFO(pool_test_create_destroy_timeout), ODP_TEST_INFO(pool_test_alloc_packet), ODP_TEST_INFO(pool_test_alloc_packet_subparam), + ODP_TEST_INFO(pool_test_info_packet), ODP_TEST_INFO(pool_test_lookup_info_print), ODP_TEST_INFO_NULL, }; diff --git a/test/common_plat/validation/api/pool/pool.h b/test/common_plat/validation/api/pool/pool.h index 3f8f5ebce..b284524e4 100644 --- a/test/common_plat/validation/api/pool/pool.h +++ b/test/common_plat/validation/api/pool/pool.h @@ -16,6 +16,7 @@ void pool_test_create_destroy_timeout(void); void pool_test_lookup_info_print(void); void pool_test_alloc_packet(void); void pool_test_alloc_packet_subparam(void); +void pool_test_info_packet(void); /* test arrays: */ extern odp_testinfo_t pool_suite[];