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)