From patchwork Tue Oct 17 13:00:21 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: 116096 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4880313qgn; Tue, 17 Oct 2017 06:14:55 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QY0lIg8a9sFdHuMKtezoO7ahqm2fmQPtuca5FgNNBKoBCITDZ/om53WHUC/AT+z2LJdbs4 X-Received: by 10.36.120.142 with SMTP id p136mr5417749itc.87.1508246095198; Tue, 17 Oct 2017 06:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246095; cv=none; d=google.com; s=arc-20160816; b=DiuJrrTuaOHwtoyLd6wSIarJbEVKvCmOwfiRk3eqz86q2FbR3rDpVZpGMHe+XpO4SK 0PYrpTBzYbn0gwlGq3HcCtQARZez84v59AD3oRiVPfkuiDGnNTXqpfgHDaJ1y+XXwTMg 9nFwAo/m6fBB6mVTi+38a0aRHXbtYdTfP51J5Q+d/YXDOzVwadcci+qVFrZ1qfm4bba1 /2JZF5NfoeKttVaOJj7Vt7hg/QpCPdU1YXGyBeLrwWMsK9IxHRCAridnsd6k4Zhdi0b5 EwFtnc3Q5ndG40HWTrNYt3Hko2tshuWdeCWuxundEx9QtrU85dp1cVzQ/qua1LX8mORo 1ZhQ== 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=lHiaOXeiRHdMSBM7bslnWLpk0Wj2AvCbSq6YkRJfkyE=; b=nKW4tonSFftWSP2h0jTZR1L9MQxyrlVzm+gNu4hjiXQC4QMLUXjXn5R52NOMCzWfVc +9CtXeGUxDLMez0Mse8UddZMxUMaUGij1xudAQFlTzrCP4csHFUr+TM2+7zS9dVGK+f3 2fKBTvGIUpKyGAh/uovmQlE3waNm+QlTdjpraCRzuYKwzJ/cqAC27A3+ZCy6ou8xHUDg Hy+t/g9DkwJNOjjMdpDnUH2auyg3bnhw0dz87IcO+Pb1J9nPJDTZ4/6UAf5OiyVZvYCj 9JmccrcXTUT+nfc53S65bySLddtxOwuLiimn8Llp7tXtMG/p/wbD+Ic0FZz1RU8USPpS obFA== 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 v22si6022521ioi.128.2017.10.17.06.14.54; Tue, 17 Oct 2017 06:14:55 -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 AE2C262931; Tue, 17 Oct 2017 13:14:54 +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 EAF0162937; Tue, 17 Oct 2017 13:03:07 +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 8457A62931; Tue, 17 Oct 2017 13:02:56 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 73B3B60B2A for ; Tue, 17 Oct 2017 13:00:34 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 5BBFC7025C9 for ; Tue, 17 Oct 2017 16:00:33 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eoEps9iBpL-0XnSjSxX; Tue, 17 Oct 2017 16:00:33 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0W4OeTC9; Tue, 17 Oct 2017 16:00:32 +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 16:00:21 +0300 Message-Id: <1508245228-16824-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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 Tue Oct 17 13:00:22 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: 116097 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4881580qgn; Tue, 17 Oct 2017 06:15:53 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RkDoypbDHW3dG25qlV2G5VFLbg9R578Fgv7zn2a3v62b7kIbecDbpNOqpPBHWdiaQfK9V1 X-Received: by 10.36.245.76 with SMTP id k73mr5076031ith.126.1508246153406; Tue, 17 Oct 2017 06:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246153; cv=none; d=google.com; s=arc-20160816; b=sltFMVQh7pR2QZcJNxNvt3Ucy0IxQOuFdNB5+QgJtddmE2el0fIMFSm/khh+lWMgH/ NVANK142v6iOD/1jJtW+nh/xoBUHLXs9QN5MsF3MtWVeNktPMJhYUQkRB2qZ/aFNN6En WkDc+lXsgc9OrL4mBG7EyXS8j9VNtlWEMB4M0+e0KaDdgwEsoqMJhx/We+77fMqulzXg uLrzIFIc//4areLDr0Nzs1KcBfAoqB5dR9lKn9b47FYpBttOnBIPrlJ9lQut7TbvRycA o3QQJc9oOGBCz+AyIPP5CMDp2K4XjfZIrZm9UHziY+osHni2qtugos5bzLPzPQAy4tjL Ts4A== 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=mU1bzgJsHvenhmg83jG7w3fqSaIO53KqQNMD+4hPi90=; b=LUUxu71pcO5EsMjQakzXGXYGGqD8hen0wXuIDwCujGG6azKSjrvO+pRqWWYy75Vmd0 050oVXISNbIi1psC3FRxWat1HBeqpoVQ8qYMkuZQDx65XDxEaNMIRy38fmSad34Ep1tE JaBu6VAuNqROVJ+QA0wpRtMi/GTAKlOQWRLInED+yRWyhGaZc2Q1tC+hB7vTG/HV6VB3 Nfm8rVlx388Bw476FKWq356h64XvG4z2xrFSN9z6jGvB5VR490a73QgE0JGItDWjHCS6 5vTMmp7HUIjsazWRwDwJSNDl6J3eRSwXCF3QI2ZfksJ0Z2ALupr3fLUgOX++Q4O+gYC+ gbhA== 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 7si6932135ioa.289.2017.10.17.06.15.52; Tue, 17 Oct 2017 06:15:53 -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 B542C6297C; Tue, 17 Oct 2017 13:15:52 +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 6DE6262940; Tue, 17 Oct 2017 13:03:22 +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 120B86293C; Tue, 17 Oct 2017 13:03:09 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id E832B60C48 for ; Tue, 17 Oct 2017 13:00:34 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward104o.mail.yandex.net (Yandex) with ESMTP id E130C702689 for ; Tue, 17 Oct 2017 16:00:33 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id v8iQPMsXEN-0Xf4pede; Tue, 17 Oct 2017 16:00:33 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0X4m57aA; Tue, 17 Oct 2017 16:00:33 +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 16:00:22 +0300 Message-Id: <1508245228-16824-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ include/odp/api/spec/pool.h | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index f1c8b1158..61be2f974 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_subparam; } 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,33 @@ 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_subparam. The default value + * is 0. + */ + uint8_t num_subparam; + + /** 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 Tue Oct 17 13:00:23 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: 116098 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4882901qgn; Tue, 17 Oct 2017 06:16:56 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q2p6/URONVMRbcOZW8MAO/4PHV64QkrOGARMN2ffMfv8lRkKzAkvXGeOXUPxau86/KO16Z X-Received: by 10.107.70.7 with SMTP id t7mr15987821ioa.178.1508246216280; Tue, 17 Oct 2017 06:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246216; cv=none; d=google.com; s=arc-20160816; b=Ecfq+5BDHnHxmkACM/LB+tdhaaNPgHLiVEmTR1JuvsFOWnYcARM5TpatHlmiYMfWOm U8Ign07o4YcrgXQnWdFq6Xk+qDi87s+8JnBbY2eu7ZWuThxYas3e6gN2kb9pAQ6G/iUw uMshizPrSV+e7ROALcGXXaeLukuTUSBeEmYjBf5CzuP9O3mtLK+x5UvUyUBJqZXEsUBM qYunUOgmxo0YZzsePPJ5Nxle7OLLP/VCLo9NEDNFac02o8ON/a/Og0zVtdvtNP1qknXm XnfT13RB+mH+TmTf0XiaVrJK8z5nshlZvJJYOhaK0ArDnKYfV6/eeAbYSKdK9YKsmoJ1 rrCw== 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=WQZOqf56qugEAZWd/aE8shOlG2Z7Dtt+FXB9aUDnhjI=; b=yS7t1EaFXsg/no5TXaDq+X30znTkKISSITC/K9ST3X8lvclCF1ztcv6kKmZwEo2h2C s+5HyWD1gjjNgYpo0HPO8rTiC9WDTkjh0/OM3pNuLT7sI0f4a+JzUHxM2h+1+o4UiQcu jrNyNGmvLGWWCbCw2WJ17ucJqBVsEW0ciprFYQyUwpV89cGSDa9+v7tY24YmGOJcwv/W LuE22uwJZfNynhuHpRtA/IUZSuDWkWMfyxnVlOH659odTG9LiYRsZZgnFlrsymkYvhzM C+c+DBo7wlOImZYubgFneo17P7OEUyndFT/f72oRtWweY8YcLUndiRyTteHS3sHoiHo0 jCqQ== 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 y124si6991331itb.78.2017.10.17.06.16.56; Tue, 17 Oct 2017 06:16: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 D4E4862998; Tue, 17 Oct 2017 13:16: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,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 B74CF62946; Tue, 17 Oct 2017 13:03:27 +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 EA46562940; Tue, 17 Oct 2017 13:03:12 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id C677A610AC for ; Tue, 17 Oct 2017 13:00:35 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 6942156031F0 for ; Tue, 17 Oct 2017 16:00:34 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eOr2vK82l3-0YfaLIn6; Tue, 17 Oct 2017 16:00:34 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0X4Kr8jH; Tue, 17 Oct 2017 16:00:33 +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 16:00:23 +0300 Message-Id: <1508245228-16824-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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..c38a336ce 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_subparam; + + 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_subparam = 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 Tue Oct 17 13:00:24 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: 116099 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4883968qgn; Tue, 17 Oct 2017 06:17:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RC/vIYXniBNqLwGoTBLHgC87uaK3a7PLeqUcUssemyJl/MkYioC+xaRt3Urn/D0RBRghbO X-Received: by 10.107.47.147 with SMTP id v19mr16265984iov.280.1508246270596; Tue, 17 Oct 2017 06:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246270; cv=none; d=google.com; s=arc-20160816; b=wchnQ0aXd3ocsARStVV/ZnbWUNY5kyxY7p0LcziIQhT1D4olmXl5nDtjwd93SOackA 2iYYhqHxGWQHM2YAegLAXUyIseObrQfNy1JvwoG0jEQSfQoycFZ5bYiCLbrZBgHXUOOx s0BbvYrDLJo0dvokypy/SqG+bht+BzV/GYrVudNs9R/dCbn6KfjLoLDmPhd4Fr0lcGwj MnTszddA3+q/Wi9XQxgC8mr1YhYYio4vELGmIOOBeJkzjknm4n9/MDFudNxlj6KQobJx qSX/HE5xlkX/fn+5j2ByvsmFvnQSMFhXZ02WhUwjAcE9H1Lk8uhoJMvL/28Una3GSF2r XJlA== 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=DLrGlUcJL9rvaEtWL6BUru1K8BmJCMdTK3xDmHhWAg8=; b=SHy3vF0/HIK4tOCKG4WweP7cp/u0c3xKKag6C/0H6zvgVvQDtVFYni2NZKKj0i0TS9 3Y8bCUBy6qPdVNVwnQfUAedCecfBZMTCI6Tn07D/N7apSEs5fySnxBmE7XxOrutFmrl6 pDoTAsKX7CziZyKoEV0Zlg7uED6WzFz1DGmyBIlwBD36hBj9+vW05t1yjqhlS5WJZ8yq ln4kRW8AC2o93mDf+dMvpq48VT24abpIf3LV2Sn+FFm5lMJxFbsK+jlnBbEn8Kty/H7W lsdbET9veODcZtqH8wDtUnBJ/E6zhITBLbKFUfVzczCJn2UlDfsBJqr2EZrWO/7Z+JEv Rynw== 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 a134si7152442ioa.197.2017.10.17.06.17.50; Tue, 17 Oct 2017 06: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 220E462926; Tue, 17 Oct 2017 13: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,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 24CED6294F; Tue, 17 Oct 2017 13:03:36 +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 BE28462948; Tue, 17 Oct 2017 13:03:27 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 84B506162D for ; Tue, 17 Oct 2017 13:00:36 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 80B48701672 for ; Tue, 17 Oct 2017 16:00:35 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cWe2h6x43a-0ZSKApvT; Tue, 17 Oct 2017 16:00:35 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0Z4uUAYO; Tue, 17 Oct 2017 16:00:35 +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 16:00:24 +0300 Message-Id: <1508245228-16824-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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 c38a336ce..461715cc9 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 Tue Oct 17 13:00:25 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: 116100 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4884895qgn; Tue, 17 Oct 2017 06:18:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sk/XtTmdzx24O2EHm9QEF+uPbZfUl8ZpiFNbkVnNEDi75VRGHAeyfbA5xo9k6xU/kd3m00 X-Received: by 10.107.24.129 with SMTP id 123mr7874874ioy.115.1508246321049; Tue, 17 Oct 2017 06:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246321; cv=none; d=google.com; s=arc-20160816; b=nFYDnT4L/Ekg95gYdf1xpMpqcjgaYD65dpFz2yyP6vg8XwroMuTHpHwdIPXA1wnDg3 PcdAazhYAQoARQWV6T9blI+VlY9ColVNJSBtBK27mTiATxA+rLs9GJEHeK2mGYNSWfAh x7Y3b3EIw7uXzBefKnkeHMdItBDgwltZh+ZscshX+XPlVUnvaYBxElY6FOmmId4HxXrw lx5rLInW3ih0lOQFhGAZ4MEGbvYNo8b1CDdAlmBypETr5dSZcYxDkpqfn7NZ9+Bn6i6E 7MVVjB+3EasYQzKv8PP/2JgpgO+4AkNuYJJz9SgEYTyiQinznjYbDCbbzBBoc0B6cykm GYkQ== 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=FARC9dCTEiZ4Rs2zcxFM08w8NeqDV1LhveTwCgRN1yZK025kLIR5uMJD+X7tIngwnj JyaspHIBoDkdgFzk+c+pfP7IgII7Wekio9PeRMQX0NRkYSYxsDS7gR12Sz7mQEWEJOv/ zruTrjnfktCuGTQvn2FA732nhOqMSAFeqCxuxNvvw44KIdWDkUKyp7Ri//sO6nx48jMQ pP9kf4DnKvq74+kwTYV08hM/RAKXGTn/l62/5l/xOvLWNWqzDnOrqvkbZp8+9JXDct/1 SJ0JoaSJZyWCkQ8XD/j474pF9u6RIYYd7oF45B7ZmK5ox1lCf6nIGYoFcr2Wbcm5AdiT dgKg== 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 v125si7035696ith.155.2017.10.17.06.18.40; Tue, 17 Oct 2017 06:18:41 -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 93898629C4; Tue, 17 Oct 2017 13:18:40 +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 801A162952; Tue, 17 Oct 2017 13:03:44 +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 87B5662953; Tue, 17 Oct 2017 13:03:36 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 1BECD61635 for ; Tue, 17 Oct 2017 13:00:37 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 0CBF158840F9 for ; Tue, 17 Oct 2017 16:00:36 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id r99q921xyd-0ZoSuJpJ; Tue, 17 Oct 2017 16:00:35 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0Z4C0EQn; Tue, 17 Oct 2017 16:00:35 +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 16:00:25 +0300 Message-Id: <1508245228-16824-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-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); /** From patchwork Tue Oct 17 13:00:26 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: 116101 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4885501qgn; Tue, 17 Oct 2017 06:19:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TJmiVxH3Ka+th+XMpomoXwXCTE3BsMUAPeE26muhpFIr1eq6rhrqOoHNrJWVKxOCMtf4jP X-Received: by 10.36.175.11 with SMTP id t11mr5615152ite.85.1508246358473; Tue, 17 Oct 2017 06:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246358; cv=none; d=google.com; s=arc-20160816; b=rz8zYkfJHdfcuoCVH9AKxIv7UzGaX7u61T6Tw47CdVrCBrcyYxPh77aaTFfCvk/XKn vDt9BDDH+bF5wiSYHJ7KsTK9W74qQqgESNB3frnZ0MNBllW/kxQwtxZt0XFuP2zUv1DL T5H/ITlr9ZqnLyeSMV69l0LKdF1FTHae81mRtSVn+O+VBs4lan+HwHN/9A6/LGlPsav0 jmfSQkOD5oMly/jZbMrMxA9Qj/zto2XTStHMR5n8fFKYP6k7EbHWFZPfMjw5gRzUDMoq lVQwi9Radd+ErfssfpxhfqtjRCqprWV7KU4OBDyyL9JfQxEtKEB4ZR2kIc/oxF8nzsBI pQkg== 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=n4Tf9gjo9bGjceXYNbAhx4ngDU+NEeWgZ9OouZptaHM=; b=O8E8mpYJRnnZqxH7ARzpnqFFeL9IG1cjVpkshKWW4hY9unQBPtfY6wSFT+ARkule5k 1+jjoxjMIV+3XfnELio/G0rE1pRCnE254QfMy+VfSdrB2rkwnYJcg/yIu+XfqU7cc/1J hfVJc6+nCK+hK3ehtMEZQNbHRsEPNJF0kplKFBs+sFPd4GNfzpzxpewqIv9EAtSmrh5L I0NThRvF6ttethz5duknFs6A4jDTHLpyNjY4KUO+o5ehMKPwnz/HyX9dcW10pHL736Oo xQwzvHv7z75wAI2qdtR2BgviMnZ5GBJPHWx6rLkICRLlSTBVICV75K7QIVTtxvWRs4fu /tyg== 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 v15si7226290ioi.41.2017.10.17.06.19.18; Tue, 17 Oct 2017 06:19: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 09A58629D6; Tue, 17 Oct 2017 13:19: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 A979062945; Tue, 17 Oct 2017 13:03:56 +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 46DFF62954; Tue, 17 Oct 2017 13:03:41 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 7C8B861DE2 for ; Tue, 17 Oct 2017 13:00:37 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 7586E701565 for ; Tue, 17 Oct 2017 16:00:36 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uQ86vvl3DW-0aiKi7NO; Tue, 17 Oct 2017 16:00:36 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0a40fr6U; Tue, 17 Oct 2017 16:00:36 +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 16:00:26 +0300 Message-Id: <1508245228-16824-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 6/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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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 Tue Oct 17 13:00:27 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: 116102 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4886965qgn; Tue, 17 Oct 2017 06:20:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAOZrPV6VlCeS3x0MrJX7th+9voWWxo655GYSqT5Ho+51kFFZRwcoL28wkryZTbWBHL1BOQ X-Received: by 10.107.114.5 with SMTP id n5mr17978584ioc.291.1508246442689; Tue, 17 Oct 2017 06:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246442; cv=none; d=google.com; s=arc-20160816; b=hYE+2w+pJ82WjnljOBZI4Nb05qOFz+z4jvxIQyXSuH3GBK8VtGp1XV+cb6Zi1MlOSg zY2DLHUQ/323ZvWszN97KAGWzLXmkkNMI3kggomI+hxqvykpIq5DfPo7nX0eLKvQupEr rhBYIY/ywOpZV1pbyHoM7vqNKB7wSyTB/blIKaPyf0abSX/p/dDRW/lrPGEbIi6pILcs fDWDTZU41/cZfqk5OroyIr0b8Frld1Kvk6YArmU2Xgc+4jLLgcsj1q169wdMMjPQI2vS H7MaN8CwtNtbgiZ7BRx+8/Ar19EwqwirQYK9Xqm/2OM/9/nN8vmBjotxZgUso1pnTmtk nqPA== 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=/6cXRvVxERbM2ES2jlamEC0e9Zeb/XkgXv43JDi3tvU=; b=zIPzoridABEtlBTEk+GCgdMzC08w7VfpLo7vTB6k/TNz7YQbDGGE3QnKPxmdm/Z/Sl ONJ7M5PuIQ85+EJi/axKRVmqhdFJkjjjto5qUsUPJTa1Oiu2NLwSP5NVfKKagzlbgptN UtpT7ImABLvsUiVquZ7xvA6YgNL9SrdDBXD/GYYV/RcmpcGhYH4o5b4iERDhWf+HHfNy CdMs5EpDAZgPfmwrYc2Y/hCVp+zEHiU/vAGXJxnc9TIJKvChxhsUD2DIVyS2psIWVD8m G9RCHC7sQ6h+Yi5yIcwriMxbDo2utOTIphbNe4g6s9jfEtFh1BSIW62higC81uSPEtIF vhzw== 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 e10si7102288itf.116.2017.10.17.06.20.42; Tue, 17 Oct 2017 06:20:42 -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 3E97162923; Tue, 17 Oct 2017 13:20:42 +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 57F616295F; Tue, 17 Oct 2017 13:04: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 3689E6295B; Tue, 17 Oct 2017 13:04:06 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id AD07B61203 for ; Tue, 17 Oct 2017 13:00:38 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 9818F44588 for ; Tue, 17 Oct 2017 16:00:37 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tEnut6NzYG-0bNmZcVO; Tue, 17 Oct 2017 16:00:37 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0b4WFJn1; Tue, 17 Oct 2017 16:00:37 +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 16:00:27 +0300 Message-Id: <1508245228-16824-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 7/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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ 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 461715cc9..84c17720d 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[]; From patchwork Tue Oct 17 13:00:28 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: 116103 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4887905qgn; Tue, 17 Oct 2017 06:21:34 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TFcQnXhH9D3wAjNhlteGPDbgumvOn8aW2pt/4B+4t30BpIRdVFIr77Xxu59YV3JhHvRjVB X-Received: by 10.36.54.195 with SMTP id l186mr5088038itl.37.1508246494846; Tue, 17 Oct 2017 06:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246494; cv=none; d=google.com; s=arc-20160816; b=wdUtCVHzEH7cI8YQ+be9Y2tT5kVQVHHBON4O9DjooZ3kR0XIDkjsjEST4u2l5yDtp9 TZcMW5QUJwEfnFRK0lrvx9OU967xNJrlSH0R5KrCvEoT50TKKWY2aq1aUrxk/uCGUD+B VH7AwEDWm4fPrzKeAyz+9IebTQYybmgBQwrxI5P+QA2yG8cc4Xk2WbFo20/Oc5LeDVP9 RfpHvghTpH4r+b/e7LEqhyXmIynX0PByj0F6wiIobK1HGUZIBymGw1QmTzEjLelYUImN 53LU1ay6vXFC2Bl1EECyGRGhP7cL6AfGFGC9XXAbu9T8ZM7xD8jcgTCeDFNCqr6YnMZi iOoQ== 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=PjRxgpv0IjLGkQl0EEgpPxRNZNJUOBbdDGHjVaMy7iw=; b=tNwmcaXApnDpqLpElEXNm+337KTA7WWtxY18ud9pnh4QE0uIABEG/mU7GsW1dz4l2F JFKomQKvraw6qsmIQo4acUdSPvUXsZzQxl15k9akKxzKCHOIMYEvqHIQQqmZx0J7N43M f2ED6gExWKhMmSyovv4TsIWXX2kctWS4+b47LqvH+a0juNA3tgxLXHd9LvKvrfpKw9vu N4cUuERSMez3TWXwZDq9ccodbddFliQJFhWh8ECHatxVrluH0+nVVC7vrqIVYPB6hc8c Y83MmoFyfCrVzpcwPG6cpQD2tUNsHn4l2f1eedZFoaSZA0ezzDHUA+XXssJT2GN2BUhH 98Yg== 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 u7si7202652itd.45.2017.10.17.06.21.34; Tue, 17 Oct 2017 06:21:34 -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 59FD06295D; Tue, 17 Oct 2017 13:21:34 +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,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 AA8B462960; Tue, 17 Oct 2017 13:04:23 +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 2405A62956; Tue, 17 Oct 2017 13:04:14 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 72EBF622AD for ; Tue, 17 Oct 2017 13:00:39 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 7953A5603AD8 for ; Tue, 17 Oct 2017 16:00:38 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id sUyxtBVsLB-0cC0A1ON; Tue, 17 Oct 2017 16:00:38 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0b4u30vr; Tue, 17 Oct 2017 16:00:37 +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 16:00:28 +0300 Message-Id: <1508245228-16824-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 8/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: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ include/odp/api/spec/pool.h | 211 ++++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 107 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 63e063bef..b615831cf 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -195,113 +195,110 @@ 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_subparam. The default value - * is 0. - */ - uint8_t num_subparam; - - /** 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_subparam. + * The default value is 0. + */ + uint8_t num_subparam; + + /** 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*/