From patchwork Tue Aug 29 15: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: 111227 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1462030qge; Tue, 29 Aug 2017 08:00:28 -0700 (PDT) X-Google-Smtp-Source: ADKCNb69U/owuwU2Ql9YDs4FbqvPgKHTHcYw8LTnN8ONUbQQMzojVPZLu4CHcmPG/noXRX6f7bva X-Received: by 10.55.26.129 with SMTP id l1mr5779376qkh.195.1504018828820; Tue, 29 Aug 2017 08:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504018828; cv=none; d=google.com; s=arc-20160816; b=spm6m+phLKNDkQ0f/ZQQ4Jdnm5hL9cxbkHTqSVzNM2jC87wUaRsw3rB9egKD/kkxgX tveWzLkLPThb8e3lIFMwq84TLSBGHPwJO79RKvEE41KMeZRrOWVijMHa0MDvACGdvq76 GNSLrduBg7yzfQ58BbHMmwquuUegr52g058u/miihPmuyT8CSUQAh1DpzyaAHNYlf0ax otLh00YapWxldnW1wP8eD26mSsDBJPolimgtEa87n5pGbUynY1WotELwRGw7g3JcssnF fVUiX2gSbyFEGxyrmA1+5Jjuzwz14HPH/6RECOIhUo1JEYaAXY1oAmbNUsv7qqFpKmbt Fwjg== 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=DSewwBqtDcGpXO/jdyOQynM4BuIq2wnQ5PATn7ukXSY=; b=Qq/ACq11IT9hlmgfKfRHCEdEUMUJKs7vHbv0nMGd6LPEgzkoRgMcUKWyEOQYqOQEkC p/jXmxvwNVGyxeKFayJ2e1dv3eqMFuavAjU/OWcxN4kIO4ceW0TpKPauRVVNGJTDTerr SUXPHg2gIM0KPSKa40GLORi/ngpk8LrOLM+LjIKCQN8ROzxZS+koHf6VuaM9sjjwc03A 2MhVvBCxP1W8BlckhOiQS6lZcbhoZA8XBL0+Q7y2ORGsp1BTuSBFMyNsd+KxUXcwFgXJ a86isfV2u4TPEFKRXUWjlBdlfcckem0MrznngbKeg6Ib6UxJhS7fI23ddS976izNSey/ 16jQ== 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 r53si2994795qtr.111.2017.08.29.08.00.27; Tue, 29 Aug 2017 08:00:28 -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 B3B2C60CB2; Tue, 29 Aug 2017 15:00:27 +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 EF66B6092C; Tue, 29 Aug 2017 15:00: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 3377160C4F; Tue, 29 Aug 2017 15:00:16 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id EF1916092C for ; Tue, 29 Aug 2017 15:00:14 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 3239F1245290 for ; Tue, 29 Aug 2017 18:00:12 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eVudXMeJLT-0CFCHXDW; Tue, 29 Aug 2017 18:00:12 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id oOd82w4Xkf-0B10ko5x; Tue, 29 Aug 2017 18:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 29 Aug 2017 18:00:07 +0300 Message-Id: <1504018808-9612-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504018808-9612-1-git-send-email-odpbot@yandex.ru> References: <1504018808-9612-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v1 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: 91c0b58fc87ba0431241818758cea94438cd5498 ** Merge commit sha: c6ab16c8354a9a96ad8d4001badf3a206e95bed7 **/ include/odp/api/spec/pool.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..787ca522 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -93,10 +93,17 @@ typedef struct odp_pool_capability_t { /** Minimum packet level headroom length in bytes * * The minimum number of headroom bytes that newly created - * packets have by default. The default apply to both ODP + * packets can be configured. This value applies to both ODP * packet input and user allocated packets.*/ uint32_t min_headroom; + /** Maximum packet level headroom length in bytes + * + * The maximum number of headroom bytes that newly created + * packets 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. This value will be used as a hint + and implementation might configure a value of + headroom greater than this value. + Must not exceed the implementation defined + 'max_headroom' in odp_pool_capability(). + If the value is less than 'min_headroom' defined in + 'odp_pool_capability' then it will be ignored.*/ + uint32_t min_headroom; } pkt; /** Parameters for timeout pools */ From patchwork Tue Aug 29 15: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: 111228 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1464957qge; Tue, 29 Aug 2017 08:01:59 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6L100r8oY6rBiGAD7HJMPptduHPk4x2Y5q2I0J+ERAU/p7MLO2t9d8tH+4Fy4RCM3UEndi X-Received: by 10.55.169.66 with SMTP id s63mr856175qke.89.1504018918939; Tue, 29 Aug 2017 08:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504018918; cv=none; d=google.com; s=arc-20160816; b=zMz1PIJ0AEjRqJlDg07gzozW/6QHZes4QzSsBr6xehV6uxEkJGIRA3babXFb8lXTe1 saHdqEiTOVcbhOwfVcuZ+TCB8EDW/+uGpuh7AnPj/UfoUqIaMyTmaipXhrPhWwOW6Tmz ktbHUdRawy1vMwpxEIWCE26uofiCoBKZInttiz2j8Zvr2+WtYe7of+38ni4+rAQnlfAx 4/meo69GpZdGu7qnPOhX+5/Aus5XVsdJkG1uzJ6QDivcYZlapF9zi748TdsYFYSndtOo AXhHyeEArG18sCcdNYCTBYSp/H3dXyE2m6Dhr5+VeWsab4JI1dP4mdyS5Xzr2he4ff7q uUoQ== 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=+YtC3XpSwxqDoFod0xQmgjl74ui4enOqnrWRni0oWLQ=; b=qVrVOASE4Bon0DVD+rKvz5x8zkJuT8ygzufF41z/w/uRd72zfgqrFALh68uVMQnfJr IJ+GDpAvtsX/kRdp9a/zKqeLZcgOHblP53cullB7GcSMLTBKQNDO+AKy9/Bts2MYbEWz 6WktW95GW/whOujtj8LOgl4/Nd27xrlNyLx+Y3heenBQSuTqYCPfZ9TxawES7Nx1LH4/ qOkoaB7516bk3JOfFhD3VQnC50tgDyiO8MLfkMrAEj7HZ5K26U2YqwxSuKvhT8zPj84b G87qhyGDg86Q+jxwbPNdB+7/edFoE6IisclEXSNxiVmAB4ReojON7aQIIIjI07HXd0Di 38XA== 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 o65si3080774qkd.288.2017.08.29.08.01.58; Tue, 29 Aug 2017 08:01:58 -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 97DF560923; Tue, 29 Aug 2017 15:01:58 +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 ACCAE60CBD; Tue, 29 Aug 2017 15:00:28 +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 7DB546092C; Tue, 29 Aug 2017 15:00:22 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 081426095E for ; Tue, 29 Aug 2017 15:00:15 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward105o.mail.yandex.net (Yandex) with ESMTP id AA5DB4445267 for ; Tue, 29 Aug 2017 18:00:12 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id a5dSpujn0a-0CSiVJZJ; Tue, 29 Aug 2017 18:00:12 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id oOd82w4Xkf-0C1ehFmn; Tue, 29 Aug 2017 18:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 29 Aug 2017 18:00:08 +0300 Message-Id: <1504018808-9612-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504018808-9612-1-git-send-email-odpbot@yandex.ru> References: <1504018808-9612-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v1 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: 91c0b58fc87ba0431241818758cea94438cd5498 ** Merge commit sha: c6ab16c8354a9a96ad8d4001badf3a206e95bed7 **/ platform/linux-generic/include/odp_config_internal.h | 9 +++++++++ platform/linux-generic/odp_pool.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index e8d0acb4..e1bc622b 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -65,6 +65,15 @@ #define CONFIG_PACKET_HEADROOM 128 /* + * Maximum packet headroom + * + * This defines the maximum number of headroom bytes that newly created packets + * can be configured. This value applies to both ODP packet input and user + * allocated packets. + */ +#define CONFIG_PACKET_MAX_HEADROOM 258 + +/* * Default packet tailroom * * This defines the minimum number of tailroom bytes that newly created packets diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e8ec6d8..efd20e25 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -348,7 +348,10 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, break; case ODP_POOL_PACKET: - headroom = CONFIG_PACKET_HEADROOM; + if (params->pkt.min_headroom < CONFIG_PACKET_MAX_HEADROOM) + headroom = params->pkt.min_headroom; + else + headroom = CONFIG_PACKET_MAX_HEADROOM; tailroom = CONFIG_PACKET_TAILROOM; num = params->pkt.num; uarea_size = params->pkt.uarea_size; @@ -853,7 +856,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_MAX_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 +917,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)