From patchwork Fri Oct 27 08: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: 117298 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp475273qgn; Fri, 27 Oct 2017 01:03:29 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QC7C0khC/0hAFpfQE+X57afKKuH36dlT2xCtSHsx3/1vR/4Y0QbdYesBpPR8ZSVZG+rnle X-Received: by 10.55.159.133 with SMTP id i127mr12328044qke.157.1509091408994; Fri, 27 Oct 2017 01:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091408; cv=none; d=google.com; s=arc-20160816; b=rWoz4YxRQQlEWKAcZKko+MFKuZxCwiOPd9/e34ykC8yfC3MLgpLSaRsq/8iuZwout2 FMcPYTBQMN1SMWq6zDAyVyyDsXeaENMgbR+a0NzfEjEw5d0MS6tx2uSM5KOiYKvNQ1ru 1c9hYkZHUfGgHfhnSms6VFwPDUkuM5A41lublVKpaoiya2GNVStEcs4eFcgijN3m5vKX 5OtJPTkt2s96xCSwgOEIsqTl8MqNi3lSMqQQOvkVvZlp8LjQltmLFwcERo/NKhAvaRsX iK/GfwAZRXNMKam+dPTtrksa59WIRiFhYYDH4KIsOtTMi93Bn7py18tlWQD8zNmTzOBz M6iQ== 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=tTAXykhv1jIzlpUsMsM5RN9ryw+gAFCnkqlPR4LCQYo=; b=q0noOD184HKR1JTriV30vxhAIAXwuchcmlQ+AwRdL6AWfYZ1KoMZI2mkn186sGtCXy 4X8h4gcDqvM98j63GU7CAiQgig6iNQHpO6bSOOszdC2Icikj1+dmRddBwmH9NvLvXM4s lshLxyzSmEDeFlnVsSAk00aLHDut6QUCFGoL0Y47bJH+s163BzkZchda6gJyQIlcTJ86 Ib6E3LOHD+0dFxCTxkY34n2uVsKygNo68qmeKQrlH83OcgzKWl3cmr7l/FVl0MSS3kvd lHQFHUeVi0DadOTEPT5ktRT0ZWQeuMVFT5qaQ3I0O/nyL9qk02bNGFwK3VIuwoaoVH1V wVeA== 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 s5si1548119qkb.412.2017.10.27.01.03.28; Fri, 27 Oct 2017 01:03:28 -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 AEF00628FE; Fri, 27 Oct 2017 08:03:28 +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=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 6A5B2628FD; Fri, 27 Oct 2017 08:01:15 +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 A7C27609AC; Fri, 27 Oct 2017 08:00:54 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 6F49D60750 for ; Fri, 27 Oct 2017 08:00:48 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 2A79656070E5 for ; Fri, 27 Oct 2017 11:00:47 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gvpjEKkVvL-0krG7BKF; Fri, 27 Oct 2017 11:00:47 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0kJ4cAqm; Fri, 27 Oct 2017 11:00:46 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:05 +0300 Message-Id: <1509091212-14398-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ 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 35f783775..dc07851c4 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 Fri Oct 27 08:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 117300 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp476864qgn; Fri, 27 Oct 2017 01:05:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QaZDLhnrWGph3pC1H/BpEiBlAjgoBJpiFeBWWdcHuIPDwClOQ8zTn28MprG9CswqN2ufJa X-Received: by 10.36.141.65 with SMTP id w62mr2243075itd.152.1509091502698; Fri, 27 Oct 2017 01:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091502; cv=none; d=google.com; s=arc-20160816; b=KPCHRTiFfEiGo9HJrkndLx9NE9xhPObEn65O/3rPawsroKaS14ghKqcZ8Pa1PAfX7/ ffVjd9r7aprbphVvxa6L7Gh/X+Ied7iZj37FJw4w9UD1bmalAZ51lqzFBNKSw944uXvw Bcy9FXtz/pW0P1Jwvokm1EkmSqfxaSgJNOuPCJrM2BA/p8sW41tfH8TWmqNiADhhoUvl s6L9fBw9Zw0qlfp3fOtjm0orMIqrXXKZ80FpjfwJmmQltaeO16sre9bjtHaty+UEajiy ildnEIbukyp6C3DO9XVUaXTrMDpBkiTxHW0h5hZ2TeaCArwii/ILXjskIaAUtdnlCrwB qCyA== 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=hXPLmHqYEOqLtfpu/cT6y/EPjWkn4WOn0Jn1AEocSSE=; b=LfmhCCOfJsih6eXieSjUujBWhYdCaHO/AGGzRPOnntWxRaTQIkm9ROXiQaozbKsb2N gMPJYaP/ZIDbUz+fWWRdmaxQfcMIlma7wGjo85MFESmOY1lkbXlmPjCLNANkSktWWq28 AAMhwXhYtWiTfb2sV643MYdRIqFBRnmiNKHOcumaSbgV4aFheacOhOKVbKapxZWXDmHG GlBq9dSSLnh+JTNQKALp8AAjyyhzaHD/4l9p5QLam34bzHGLVFR+ilAZQganZ/1t2iGI sULHHuLw2aab8Fa5xRv0r4xcZO1+mTm1MaeUplrHP6hn81S46qu8kDrlFpMFx9avBaYm H2UQ== 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 g4si922093ite.1.2017.10.27.01.05.02; Fri, 27 Oct 2017 01:05:02 -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 37A32609D2; Fri, 27 Oct 2017 08:05:02 +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 DC4E46295C; Fri, 27 Oct 2017 08:01:29 +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 36BF5608BD; Fri, 27 Oct 2017 08:00:56 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id BEFE06098C for ; Fri, 27 Oct 2017 08:00:49 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward103p.mail.yandex.net (Yandex) with ESMTP id BAB162186C7A for ; Fri, 27 Oct 2017 11:00:48 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ENOQJeeALx-0msaHPwZ; Fri, 27 Oct 2017 11:00:48 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0lJenemx; Fri, 27 Oct 2017 11:00:47 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:06 +0300 Message-Id: <1509091212-14398-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ 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 dc07851c4..2900fc469 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 Fri Oct 27 08:00:07 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: 117296 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp472972qgn; Fri, 27 Oct 2017 01:01:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RIhsGe1jLyT6stTPFwSfLXE/QBgOxL5uskn+XFI7XgDdl7LP2xi0RJE3YoJ80DcMvA5i2r X-Received: by 10.55.3.130 with SMTP id 124mr12555837qkd.42.1509091268124; Fri, 27 Oct 2017 01:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091268; cv=none; d=google.com; s=arc-20160816; b=ADM7U0UDvSTyP7VfCBttm2Ptc3usXHuW6x7o4trXlzpAa4CEOZDtTRMlQ5YcYycMND oBuhvulktyR+y5hTrQPlAWVux7S43sYOAKjrOG6rAwzXhMi7aYyVrQ7qbxdJGkLNosbt /WEyCrT54V2iw9bRiSPtUci9iujxV42waIvSuMG8v3zYzAgD3WCKoHFsLrBX30ukK3wT lLAs/u4eLjTL8A90czO3GhODl+LH9o5OPt79d0fFw8sqhYDmnKq+HbNivImdG8Xyo+qd /VXESjSvFiezs3p+CCZbG4GUIei4EaT5lf7+ooYAzWhz+Dc01qPjAm0SfbZEOgqHirRZ 80vQ== 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=AnhVqdd5WphAdKb/PJTcJa68c92liFReGrKa2XCH9i0=; b=hli6C5qqlm436ENaCa0joH3avFurlBFZ13zBMi7rXN6ui9WecFhIopTXdxYcV6ZfeL 7GPIDm95ETJJwLVMhI2E5QwJXiY2AgbQ5mHsTHSwi86tOM1fxFJK4WRCfhHOZ8NC6xcL 9q2tu21mibpb/h/6yQqnJkmr0cYTIzAhzG1VXVg6Hbng/IC4sGEb6dOWMa92QZmv+r6J kHUq8Hb5habLInTHX8mx9sy2Jnjj8M1cwunACEPDpZenFzW6F6zKXnnDp3EWwGUMJLLc VedswyS9NsNiQCqXhkI3aGCaOvrBs4CU47YQaCnlzE1N9DAM6Hi+bLDUvzl7a2ttfTgW twmw== 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 r74si3489744qka.105.2017.10.27.01.01.07; Fri, 27 Oct 2017 01:01:08 -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 C65C76227A; Fri, 27 Oct 2017 08:01:07 +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 558DB608BE; Fri, 27 Oct 2017 08:00:57 +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 42438618C8; Fri, 27 Oct 2017 08:00:52 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id C6CDF60996 for ; Fri, 27 Oct 2017 08:00:50 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 570895A04168 for ; Fri, 27 Oct 2017 11:00:49 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id f9Xvm1KOUE-0n4aVIhO; Fri, 27 Oct 2017 11:00:49 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0mJuYTxB; Fri, 27 Oct 2017 11:00:48 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:07 +0300 Message-Id: <1509091212-14398-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ test/validation/api/pool/pool.c | 98 +++++++++++++++++++++++++++++++++++++++++ test/validation/api/pool/pool.h | 3 +- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index e633137ab..c38a336ce 100644 --- a/test/validation/api/pool/pool.c +++ b/test/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/validation/api/pool/pool.h b/test/validation/api/pool/pool.h index 29e517633..3f8f5ebce 100644 --- a/test/validation/api/pool/pool.h +++ b/test/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 Fri Oct 27 08:00:08 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: 117297 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp474676qgn; Fri, 27 Oct 2017 01:02:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TQ+qIzF+KffcvlFTJlceeK20qLuxpz/bINa4jJEuNSu/Il/gb8vU7+1MWztLoGN70oBzki X-Received: by 10.200.9.43 with SMTP id t40mr40534477qth.257.1509091372286; Fri, 27 Oct 2017 01:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091372; cv=none; d=google.com; s=arc-20160816; b=jTVjltsHkagnuX2OVvcFDYfVvt0W4yPYknhx3zoqM2StfY3ghcpQkg1ZvYAXUQCkZ5 IM+mvY0f6DFBH09GadusCHzRvsslNmWuCq94NMZJKN5Y9ujYpVpVzqy2VPC93py2WEla UlLMHmKBrW/gJB6qULd0ZyB2cTSe4/s9gMw4t77SCGnqIyP/AJ3yJ/oq0TAQ10GHQOYn NkdnTT8Vc/IUSviH5yfDwp9iblL/Vv7DspHlUj4KS8Aia55sk4eUrTzo6MdASvNeyQR6 ZrGRevcACbdnsh25tCGfkWe8TSSJoLIEn0S6i47FaAJGyQIv657TAKuqmZwdnpR0syV+ NpMQ== 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=uje9oVRMEmA5zxGhXidimRIHm8BwZJJS19tcCIyi9TA=; b=pO8AyRMd9l636QcCAoViv021N2KmS6fAY3v1kjGHyNKnih+4CAW0AyTJeiN51/THNs Oyyi90Jpf9G4h1e5I1B9S2gLwmuoMF/XZu8wpid3cWFvlRKfZ7wbfthMNY9NDo/SRFIQ TLFxEHlcaRidffsN+qQyG8rVReKIRxbtt5N4t0YYaL1z7ghwXB6OqI0BG0aZFIwgLfLH 16zQbxwiDUhxsl+UyCRat+WAXRjvmqTMk+n0SH7slSp0WfIeM9I9p9JgBf3SEVcCBZaT pXuCSvqcavdq1hvNQc7TNvVH51ouCnyw7b8nBivinw3Bqk6BkruO1y1+yEsgY26ZuEAo dkPA== 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 b126si3733358qkf.346.2017.10.27.01.02.52; Fri, 27 Oct 2017 01:02:52 -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 0272662972; Fri, 27 Oct 2017 08:02: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=-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 30EC960996; Fri, 27 Oct 2017 08:01:09 +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 E2C98618C8; Fri, 27 Oct 2017 08:00:53 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 5D81E609AC for ; Fri, 27 Oct 2017 08:00:51 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward100p.mail.yandex.net (Yandex) with ESMTP id E6F795104076 for ; Fri, 27 Oct 2017 11:00:49 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UobO3TiZUD-0nJ8G55E; Fri, 27 Oct 2017 11:00:49 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0nJebYLa; Fri, 27 Oct 2017 11:00:49 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:08 +0300 Message-Id: <1509091212-14398-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ test/validation/api/pool/pool.c | 87 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index c38a336ce..461715cc9 100644 --- a/test/validation/api/pool/pool.c +++ b/test/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 Fri Oct 27 08:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 117299 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp476127qgn; Fri, 27 Oct 2017 01:04:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RXHCogWXQCJMpeRq45SwVwLLpcer0ItB32sH0uMbaNDwDWkWk6J3/lgayhWc1wfsmoKW0l X-Received: by 10.200.47.169 with SMTP id l38mr36834082qta.272.1509091458367; Fri, 27 Oct 2017 01:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091458; cv=none; d=google.com; s=arc-20160816; b=CYiMkCjyTiFrSYX7qnwjH1WRzNTRAwaRDDkCqEwehfFjidQRkXURu5qRfWCqCNw+8G 4uVda1HAjGyukW8M8qwRT/F+jKcl6NGDnz8CggnxmnOazjyJWvEOM5NVpVKdFZS+ep7/ tSdwFj2D4BPxBufqmmLm/hSYi3oV4aa2+Yokvt/TS/i5cyJugEGOmYf0MlR945dZgXwp xS68DLlq8sNO0ShVZWa/6SnOohOIWN71+vES5tZn2x34XodNtPT6qaQIoyHKnl+Vpiw7 WVXBBh2gjwaiyDQDmd5cHFbqJpVfwywbuE6qlPGFNcqedKoLz/RjSIST7HAdPDgeQnMf es6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=suFKe2PGpqz4LD2Q+8rayV67Hyfx4DoMybsg/0/zjAA=; b=N4huevQJVQn1LYaH2ZQ8RMKG1Ib1xEAOFT6LbHJkMPFuQRokXkuLcUJlFDEeSMybgs lLIjT9xqasyD5EUyBOIzr68HqU1dmpL+OJOwh2EH0TfM2G6ZcrHYiG9g3ncPj3JRvGJ6 3buaLPDABTDrg5shIbDmW5l3K5gxTfTzChEgw0P/uujQTnZIQDsPTzwjyrlCHE8Dz6xW SfqM6a9C829S65LABPxbYj/JRmAl5bsAn0E5O2V+saf38Tcypr0BvhbTyPlqzaxmeq5d jwyOuCZLICnnhAejpSBuNXFPGQP9MRm3Rl3yCChB+HMMStqubgOFqrkdOEqHetwtWty2 qnTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id b2si67362qke.152.2017.10.27.01.04.18; Fri, 27 Oct 2017 01:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 00C44628FD; Fri, 27 Oct 2017 08:04:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 9912B6295A; Fri, 27 Oct 2017 08:01:25 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 398A3608BD; Fri, 27 Oct 2017 08:00:55 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id C3F3861044 for ; Fri, 27 Oct 2017 08:00:51 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward103p.mail.yandex.net (Yandex) with ESMTP id ACE442186BEA for ; Fri, 27 Oct 2017 11:00:50 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nc8VugHSS5-0o5ST1cT; Fri, 27 Oct 2017 11:00:50 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0nJ47lGo; Fri, 27 Oct 2017 11:00:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:09 +0300 Message-Id: <1509091212-14398-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 5/8] api: pool: add max packet num info X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Packet pool parameters does not require application to specify the maximum number of packet. Application is more portable, if it does not restrict max_num, but instead uses this info field after pool creation. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ include/odp/api/spec/pool.h | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 2900fc469..11feb1bc6 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -358,24 +358,42 @@ odp_pool_t odp_pool_lookup(const char *name); * Used to get information about a pool. */ typedef struct odp_pool_info_t { - const char *name; /**< pool name */ - odp_pool_param_t params; /**< pool parameters */ + /** Pool name */ + const char *name; + + /** Copy of pool parameters */ + odp_pool_param_t params; + + /** Additional info for packet pools */ + struct { + /** Maximum number of packets of any length + * + * This is the maximum number of packets that can be allocated + * from the pool at anytime. Application can use this e.g. + * to prepare enough per packet contexts. + */ + uint32_t max_num; + + } pkt; /** Minimum data address. - * This is the minimum address that application accessible - * data of any object (event) allocated from the pool may - * locate. When there's no application accessible data - * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. + * + * This is the minimum address that application accessible + * data of any object (event) allocated from the pool may + * locate. When there's no application accessible data + * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. */ uintptr_t min_data_addr; /** Maximum data address. - * This is the maximum address that application accessible - * data of any object (event) allocated from the pool may - * locate. When there's no application accessible data - * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. + * + * This is the maximum address that application accessible + * data of any object (event) allocated from the pool may + * locate. When there's no application accessible data + * (e.g. ODP_POOL_TIMEOUT pools), the value may be zero. */ uintptr_t max_data_addr; + } odp_pool_info_t; /** @@ -389,7 +407,6 @@ typedef struct odp_pool_info_t { * @retval 0 Success * @retval -1 Failure. Info could not be retrieved. */ - int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info); /** From patchwork Fri Oct 27 08:00:10 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: 117302 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp477706qgn; Fri, 27 Oct 2017 01:05:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TcIBdIRG6Ikpc3GFm9T3t3sCWXm2wPEmjPRJ7uyXfrrpolu74dT5mT1eSpDBtyVy2HTxlz X-Received: by 10.36.207.87 with SMTP id y84mr1890467itf.21.1509091551887; Fri, 27 Oct 2017 01:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091551; cv=none; d=google.com; s=arc-20160816; b=Pw1fkHEutAbRT7D3oWIRQz57ZbYgVKMgt5FedZCej7nlp68zUgA9d8vP0AvyWtJqR0 RvCYdSut+kQIxToTp4hebJ46urQLTQHhMWGqytGJ/K8cZuIgfm7QQJuNg8Ri6rROtZRJ aodgEAOZhwZezdFWeYmx6YbjYu1CvzA9/vSL2daFSuouq76wRBP11j4Xys1+enawStOV oeD4OBUAi9g7FvsrqY5+D+fffiKojpgheMp9QqyfCOUlKR3bcTME2rICYZSCoJO0ljKV 41Y0VDHfmnc6+/c8TnqLDV/6+3oD5mwLicM1FZm8jjBl23X7Vkhlp2xwI/QGDWswOvGT pmkg== 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=otoIBSAtBvjZq2gNjcLcmqiMcVpUgbWCxpSBA7TxPfU=; b=UFLjnZ2g/L8KqCwljF1lsiH6cO4EgRwfT+tpWA00mN+VLZvmgJuhTK3HATc2RrUqd2 NL1dsm7AQvqxJXNRSrbUTNRtH+/Lt/10iuLhsBRsc3Bb1ziTwUWyjzvx49cyLqzX1Vc7 IxqRHdnLorRj02zcg/wicyt2PZuIDCsPJEu03FfBAi0G6wgssVOBkrF2Hh0ztITK8geV CT+vd+h9YnYjqCJ2o/JAFKpO1LkobmPLztDw83goTPk5D1mTK8sZt0GPD3LVwZw1A63y AoNyc+cu0h/c8L43LYpjf4vGD493doTvz0FQyyHfNfnP6rzV4kDlqbQ/SOxviyOgHpYn /hUQ== 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 p2si3470760iof.271.2017.10.27.01.05.51; Fri, 27 Oct 2017 01:05:51 -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 76C3162975; Fri, 27 Oct 2017 08:05:51 +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=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 A1FD662966; Fri, 27 Oct 2017 08:01: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 91D3561044; Fri, 27 Oct 2017 08:01:01 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id AB98460996 for ; Fri, 27 Oct 2017 08:00:52 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 36F5334C6113 for ; Fri, 27 Oct 2017 11:00:51 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tuFTzitDHp-0pDC9djB; Fri, 27 Oct 2017 11:00:51 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0oJui8dh; Fri, 27 Oct 2017 11:00:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:10 +0300 Message-Id: <1509091212-14398-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ 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 40114093a..326cc82a0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -701,6 +701,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 Fri Oct 27 08:00:11 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: 117301 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp477523qgn; Fri, 27 Oct 2017 01:05:42 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TKIeTqpL/9q6hh1YbqY+cvIkHRgyml5pCTrOJVo5cnfaBmqVJrXOmzahADknL2GZFlCFsM X-Received: by 10.107.147.86 with SMTP id v83mr35400934iod.82.1509091542846; Fri, 27 Oct 2017 01:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091542; cv=none; d=google.com; s=arc-20160816; b=nn2Hi+ipX4WQgU49WC6afL+jRS+Fq0isQeqEyrGH9Dqk5uRw9LTKZ9UuN2WJpCC1i9 7g+myc6Pcm0gIUXB3aU3nQ2ivBz3H3/PZjsW+QXFQLbo9h/9UmrCGtnrEqFfkYDwNzfw x08ailG1JedpVozU8O54XldIZf0UmtC6D3nV7unEfwDo9r9QCqcVxe1e7TJiwNIMvmuX ahyfhAAWkcJtqsCXtemnEoD86znNcvvg4+lvtRHoLxxFfdZYctuMQsoCNBDsV+dU0RV/ kTtl7vi8X/kolrHjmzU7wsmEYV3N6Qp7wyvR8+S5DQbPXpJ+LCyxBUApL2rV4cmcP9mV Vohw== 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=A9Hl4dJshFqjgMggFaNdgMBt/0ixPJvraz6Coa99aVE=; b=mZDz08e7qBZTIbDpDZCOCVBsKHyulRCw4Ka+hJ6ybEg68+3KmrCaNiPyV/QClzvqOL Qpfy1OW7jPb3cCeo6142dlXYPNtt3NllhpyvyoUR3JgqkCLk1SbIL04VgVUtQeMw+pfX yF1wpFWOBDdJHRMgEIZ/RbSr12Wdi92+wRPV8S2wF92NQnP8GzPeM85cjWzTC90BpOis w46753hNAm2cJSF0LYQYl0FO5hZWYeIN2jZ6biDs/4V3/iwMO3fusHFop4Vo3A2sGOcu nsJKbP7GJIqtM2TJz+tvxHVQ6nnyr8UkMske6ihpahG3bGHW8A6CT6/Kzh3o09lH7G6u 8+mg== 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 b76si4718935iob.116.2017.10.27.01.05.42; Fri, 27 Oct 2017 01:05: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 6776C6295D; Fri, 27 Oct 2017 08:05: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=-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 3AEA362961; Fri, 27 Oct 2017 08:01: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 1DC2A608BD; Fri, 27 Oct 2017 08:00:57 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 7D458608BE for ; Fri, 27 Oct 2017 08:00:53 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward104o.mail.yandex.net (Yandex) with ESMTP id DB5C870691B for ; Fri, 27 Oct 2017 11:00:51 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mGl8dPn1fP-0pHGnohJ; Fri, 27 Oct 2017 11:00:51 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0pJKV2aO; Fri, 27 Oct 2017 11:00:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:11 +0300 Message-Id: <1509091212-14398-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ test/validation/api/pool/pool.c | 28 ++++++++++++++++++++++++++++ test/validation/api/pool/pool.h | 1 + 2 files changed, 29 insertions(+) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 461715cc9..84c17720d 100644 --- a/test/validation/api/pool/pool.c +++ b/test/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/validation/api/pool/pool.h b/test/validation/api/pool/pool.h index 3f8f5ebce..b284524e4 100644 --- a/test/validation/api/pool/pool.h +++ b/test/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 Fri Oct 27 08:00:12 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: 117303 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp478492qgn; Fri, 27 Oct 2017 01:06:37 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sqg4nPURRZa4psuOcXvw5xOaXr0VjIhuqVmsfzYwM0JVPdScByaJLsVbJn/AvioDyc1EsU X-Received: by 10.36.215.67 with SMTP id y64mr2037137itg.145.1509091597122; Fri, 27 Oct 2017 01:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091597; cv=none; d=google.com; s=arc-20160816; b=SjFErpgJqfSeG5jKVBK1OftFFNEwkghZB/NcINYBSV446c3PkRuGJF/HKcRklz4aCo 2r6k/MXE/tcyeOwrqdNdGACL3k2XUgYDmw/U2imVgC84QxwCjPZ6dtlE8yb54K8fg9Fr vU13tBOO8cZD58w73bZl5oF1Z1tW0jvWV6Q/8DCxcgBBoMjcnF5fV5YRzaG99v6tm6ob ub2M0DwWpQVlrGgQbK++ks4dAwwMX2sQY0UktbAC/KQOLvruXx9AInQ8llisKvKCDjBu nUT8WCP1FHN8HTJ8JkEl1Txkv8CTodP/L8kRL5MfUT6kuL7Ztw2nu9CEtRWFqf5Raodg uTKQ== 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=gwPbx8S9hYvOr4Wey78mRJu7oRC7KwUGFbEySU9ddAQ=; b=u3YlP5+Vol4ekvPkAgJQ8SErFVoDeXx209xP0WWX2V741Qi3UBN8N1/Xhryru4edHg mD6DQ1muMOeW5CjojQhWkoXv4JD6rnnxggNI+lQO46UOIzq4Tie1Apza8XLopHadyNfq miUc5ECW0qA2TUZbWhSxifIuLyeUXiBAeAWDHBTZ23IGD7L7EvizqyREc3feTi/5HTPu DlXB+I5D+D4mnd6w/20U4MhoqQRPiWbTSEIAkL7s26oOiXlMTJyIYyxqrVb4XN6+7C5J 6FpcHdlStzGwz8Tud5yqAodWxCU6H0DEhwaqO8j7pYu8p8mTEAHV17I1hJ9Duq0nTsJp pbhg== 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 g99si4847953ioj.26.2017.10.27.01.06.36; Fri, 27 Oct 2017 01:06:37 -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 A59D062965; Fri, 27 Oct 2017 08:06: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=-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 E5E1E62963; Fri, 27 Oct 2017 08:01: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 BEF54609AC; Fri, 27 Oct 2017 08:01:03 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id A019361667 for ; Fri, 27 Oct 2017 08:00:53 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 8E980706D10 for ; Fri, 27 Oct 2017 11:00:52 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zLpwfvHk9L-0q4meMBH; Fri, 27 Oct 2017 11:00:52 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0pJ8uQtr; Fri, 27 Oct 2017 11:00:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 11:00:12 +0300 Message-Id: <1509091212-14398-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ 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 11feb1bc6..05f019f3d 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*/