From patchwork Thu Sep 14 09:01: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: 112524 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp524744qgf; Thu, 14 Sep 2017 02:19:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBDPlT3qz9gopBVoWiymkhQTkgOAN2ERuMK7Cbx6k2X98SFhGI1iAdiQ4sfzKmaPTflUhvA X-Received: by 10.55.101.77 with SMTP id z74mr1677010qkb.52.1505380746568; Thu, 14 Sep 2017 02:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505380746; cv=none; d=google.com; s=arc-20160816; b=yA9BPoZg4v2shbW8fjuo8yon1WCGpsxD9OzHJlxrt+ag9qdbUGHPdgch2TezOzNTyF 4WVf0CpAp4xKUf46DvF0PqSW6aIO0FWmZdleVWFokFlY5uKsuzlpH5HQOpNwJDbsw1zj U9k8n+vCVN2950CG3wtUUC6bfZ4U6cHfzpP/hpPpbhI289OkpwYodaOClSZDECgtyb3N yZEZktM3KWcjKsKV/SkrDSE/BxKm4YXP/fD5cPDjXPgujWZdTOrqlK4VDjKm0Yjuf2Nc t+E/KFtwQAe3s6S32yP0MWjjBga+ZJcVwrSQRlQ+z/e97R9ZahJBI2xda4KWsK+A5Qhv xZPw== 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=jzGh6Hxou7R9OuD/XM6SWh5GZRYYNxP0lZdEBjZrY6c=; b=yqsn8wBaDxcTZcsYCoYIRQ2TYAUSjsX8hE+KLPuN14rPQYlKEzQRkHpn9aVJsoR68R mBdQAqQ3zojF4W/TnAMmNTaghjKG4m83h5TxDgw+CIUH6eHMXitCsjDT08/mdqXy7eiB fhsJqZ5r97+c6XFbngahCxu7CZ13NiS78wjD6je2r8tlQYcScA3CnfbkP0Ehu1uMFtY/ Dr6gnBHEFoVsITQf5nJlOVVoT0YCcVToWDwE78tm5U2mm9KUjeh6InUbpImKbWbdtPsN yitw3mLl7DIqnLiYSfwz4RPm5BXLEkxK0g8u4pR+AulGMaqdrXah8wf9wo01cYLAQLkB rCRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u67si16419078qkd.263.2017.09.14.02.19.06; Thu, 14 Sep 2017 02:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 3869A62DF5; Thu, 14 Sep 2017 09:19:06 +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 86FFC609D5; Thu, 14 Sep 2017 09:10:16 +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 CDBB7609D5; Thu, 14 Sep 2017 09:10:12 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 3789262D0E for ; Thu, 14 Sep 2017 09:03:47 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward105p.mail.yandex.net (Yandex) with ESMTP id DE42A4086483 for ; Thu, 14 Sep 2017 12:01:16 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vX8xsmSy6R-1Gxq6Q35; Thu, 14 Sep 2017 12:01:16 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id uryY4Hna7R-1FwqCR85; Thu, 14 Sep 2017 12:01:15 +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: Thu, 14 Sep 2017 12:01:10 +0300 Message-Id: <1505379671-1232-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505379671-1232-1-git-send-email-odpbot@yandex.ru> References: <1505379671-1232-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v7 1/2] api: pool: add min and max headroom in capability 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: Balasubramanian Manoharan Adds pool minimum and maximum headroom in pool capability Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 152 (bala-manoharan:pool_headroom) ** https://github.com/Linaro/odp/pull/152 ** Patch: https://github.com/Linaro/odp/pull/152.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: d6a181de1ce2c8a062ab6738c54fe61d88202434 **/ include/odp/api/spec/pool.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..164ae25e 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -97,6 +97,13 @@ typedef struct odp_pool_capability_t { * packet input and user allocated packets.*/ uint32_t min_headroom; + /** Maximum packet level headroom length in bytes + * + * The maximum value of packet pool 'min_headroom' parameter + * that can be configured. This value applies to both ODP + * packet input and user allocated packets.*/ + uint32_t max_headroom; + /** Minimum packet level tailroom length in bytes * * The minimum number of tailroom bytes that newly created @@ -214,6 +221,17 @@ typedef struct odp_pool_param_t { 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. Minimum number of + bytes of space preceding packet data to reserve for + use as headroom. Each newly allocated packet from + the pool must have at least this much headroom. + Must not exceed the implementation defined + 'max_headroom' in odp_pool_capability(). + @note If application does not require headroom it + can configure 'min_headroom' as zero and + implementation may or may not allocate headroom. */ + uint32_t min_headroom; } pkt; /** Parameters for timeout pools */ From patchwork Thu Sep 14 09:01: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: 112521 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp437790edb; Thu, 14 Sep 2017 02:16:45 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAGdluQNgkAUpqdDppRmoKUXN6lgY9JCy2E+hIUGYxhthv48ZC5eLfL0lOW9o4fkLCWd/0P X-Received: by 10.55.23.205 with SMTP id 74mr1674741qkx.134.1505380605563; Thu, 14 Sep 2017 02:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505380605; cv=none; d=google.com; s=arc-20160816; b=Hg5AuOeigvlobpZe+SsK7CXM7+sf+9dLMrLQY2iwXe3KvQidz8pIlTJ4Ec5megwtdA yAia9s1LgfLqWm/99U6Obx4rtchDowPhQe2HTj4cWRPJCBkrzfv9gpE+T9xNrd608pgb 9bx+3+HhvyluLdIw6rwIvoay91dwK10IMAh6+/9KK9YwSIyTyaqPkTUEhCF0wqizsfI2 dYUaYVoGqtdoCoaWf3X90b7sWaOaYFBNTwJRm6QXhjCAnZguBPn4AW7+xtLSwR3yJgib H6Iy0/hH88mgM3QbMzNZLX/wggifs2K0qD+j8eDIdn0GzCHDHobnQ21AO/cUrQKeLaCI x5tA== 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=esR2tn0QbpixNKm0dNofYQS/E4LH4eIXqsEGxh0WIjo=; b=vN3Q2Caw7/JK/6xKWNM/HG9ZnY7/1QsyZVz9weiIA4PatoV7ZHudswhijGF/qKeRgl kKOsDpzGJ/NPyDh8Xb9RHIKK1dn4SRT+fV3DYLtJKlsZU4ODFcTQFNYInBPh2Eq5EFKK P4bJaqQWJr3JQiEwFvRXsTsCo9sQkr+5Q8Crn9nd0pD3cBlsdtZTG0F9EINpxtOfUapt SDZMpze49RhnAEtcQpHe/HW0eHy+MJLMqlKLfiNw6aOyXT/+ATBBnbK/+b2lh5q9NJSv lkFAbMaehPxxKWggiCI+mcXJJbRTgqodn8eW7DO4Td8GaLM2dbkfLDQZG7GYu3pC1q1U SDIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 53si4349958qty.157.2017.09.14.02.16.45; Thu, 14 Sep 2017 02:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 2E0646098D; Thu, 14 Sep 2017 09:16:45 +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 F19BD63CB2; Thu, 14 Sep 2017 09:05:08 +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 AF30B63574; Thu, 14 Sep 2017 09:05:03 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 1002360674 for ; Thu, 14 Sep 2017 09:01:19 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 056634442B4C for ; Thu, 14 Sep 2017 12:01:18 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LssLIoyXXh-1HcqxqvS; Thu, 14 Sep 2017 12:01:17 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id uryY4Hna7R-1HwSNMJH; Thu, 14 Sep 2017 12:01:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 14 Sep 2017 12:01:11 +0300 Message-Id: <1505379671-1232-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505379671-1232-1-git-send-email-odpbot@yandex.ru> References: <1505379671-1232-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v7 2/2] linux-generic: pool: implementation for min and max headroom 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: Balasubramanian Manoharan Adds minimum and maximum headroom in pool capability Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 152 (bala-manoharan:pool_headroom) ** https://github.com/Linaro/odp/pull/152 ** Patch: https://github.com/Linaro/odp/pull/152.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: d6a181de1ce2c8a062ab6738c54fe61d88202434 **/ platform/linux-generic/odp_pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e8ec6d8..ebf09f7e 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -348,6 +348,10 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, break; case ODP_POOL_PACKET: + if (params->pkt.min_headroom > CONFIG_PACKET_HEADROOM) { + ODP_ERR("Packet headroom size not supported."); + return ODP_POOL_INVALID; + } headroom = CONFIG_PACKET_HEADROOM; tailroom = CONFIG_PACKET_TAILROOM; num = params->pkt.num; @@ -853,7 +857,8 @@ int odp_pool_capability(odp_pool_capability_t *capa) capa->pkt.max_pools = ODP_CONFIG_POOLS; capa->pkt.max_len = CONFIG_PACKET_MAX_SEGS * max_seg_len; capa->pkt.max_num = CONFIG_POOL_MAX_NUM; - capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM; + capa->pkt.min_headroom = 0; + capa->pkt.max_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM; capa->pkt.max_segs_per_pkt = CONFIG_PACKET_MAX_SEGS; capa->pkt.min_seg_len = max_seg_len; @@ -913,6 +918,7 @@ odp_pool_t odp_buffer_pool(odp_buffer_t buf) void odp_pool_param_init(odp_pool_param_t *params) { memset(params, 0, sizeof(odp_pool_param_t)); + params->pkt.min_headroom = CONFIG_PACKET_HEADROOM; } uint64_t odp_pool_to_u64(odp_pool_t hdl)