From patchwork Fri Sep 15 14: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: 112737 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp652509qgf; Fri, 15 Sep 2017 07:02:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAYkCVWY3SLm61oa/ux1Vqo7lzWVw2yXnPMrGgyRCDdkYrh7C+CIA5QhV/iE7aKcegZBMS5 X-Received: by 10.200.23.215 with SMTP id r23mr33822321qtk.220.1505484143039; Fri, 15 Sep 2017 07:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505484143; cv=none; d=google.com; s=arc-20160816; b=HH11DumojY7/+zWOiQwTMaLEs0uWU1C4+Av6biwyNrFpr2CP7rNVTfkqLbJi1JhG6s 47zKPe/cJpVrHQaNAkEPkn2Tp99Qy8IzO2hfUynq5nyLqt7x0BNzozqYBfJlCCUxoUT+ sGJlJe+HXvboJWcfD6viJMDGu+pF/B8d2Cu0jVLGtSUcF8xsAEYA4TgPD4nOqEwvWh/5 J4baMwb2K4HhnapVZdEqKK6mZequ3W1Ja360+3ZZ/exTqGBXKLjJpbwBKFGDu9dCRC6s O79ayDUJoy8Y6l+BxTS9YRyfJdA4RB8UHIsibMW8hw9mLHpe1yZDOAwPrFtptRIWhSGR vhNA== 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=e/w0cu4Dky2oLVG+X6akwwQAB85Nlb6OtNVKnLuf1yk=; b=ysiYoWOGaZqlcgfAp7zuG47FoIc7XbqIWtR2OdJoVHLygR/hWJGHkcwxQfIfNETRfg rRwolQgxZW1RrFxbFVuZ9uPgZC6Tu5EJvhKgrp5/SaFOuAO7ACLel0IZT2I0K27Mx6dN b9eSuj1X1iux5bSuXv0ww975K88rLSGMjtYew/tqBd96Up0482mJpvpys93xQmoveVNC C8CjEQEdr8xhF0HK8giFMgmcnQWlUaiGz312NvIIl8uZTYHPsjlvT8LmGIKDgZYSfmvS czB+RfvKn907KAkDv3Fq0yFJxwQm1fE4Npb0pIAEnyYIKMquT7ZLjMoeXhLVXvXosN8I 03Lg== 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 b31si1018780qtc.120.2017.09.15.07.02.22; Fri, 15 Sep 2017 07:02:23 -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 6E44562C2D; Fri, 15 Sep 2017 14:02:22 +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 D23EA60C5E; Fri, 15 Sep 2017 14:00:45 +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 56DED60985; Fri, 15 Sep 2017 14:00:35 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 034F9609D5 for ; Fri, 15 Sep 2017 14:00:26 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward102j.mail.yandex.net (Yandex) with ESMTP id F214C5606C80 for ; Fri, 15 Sep 2017 17:00:23 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9SqiE8L7dl-0NIe9Vlr; Fri, 15 Sep 2017 17:00:23 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id reFCwmYfdb-0NTOdk40; Fri, 15 Sep 2017 17:00:23 +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, 15 Sep 2017 17:00:11 +0300 Message-Id: <1505484012-10046-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505484012-10046-1-git-send-email-odpbot@yandex.ru> References: <1505484012-10046-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v10 1/2] api: pool: add min and max headroom configuration in pool 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 configuration in pool 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: 8c5516bba62ee7250cbf64d1f4b89ee4f0b12824 ** Merge commit sha: 8b91795f63367f38712acfc55105fda736a91a0f **/ include/odp/api/spec/pool.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4a..221798ee8 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 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,13 @@ 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. 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; } pkt; /** Parameters for timeout pools */ From patchwork Fri Sep 15 14: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: 112736 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp651104qgf; Fri, 15 Sep 2017 07:01:26 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDmLge2jaCOfWzUtA0zLMSTOm1/SQ7TXc7YboOCgGOGlBSb3M7N167s/luIIbbtL0TOAVv0 X-Received: by 10.237.59.91 with SMTP id q27mr27172016qte.340.1505484086764; Fri, 15 Sep 2017 07:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505484086; cv=none; d=google.com; s=arc-20160816; b=nUM4lzoCKiO+t2DZGKz4wE56W+cpBl/UQx0yFzD3LdQCMJ1A3Q10jwk0Dg1dK04wzj vnl8+M2ylW+aFZZT5wz9slLGR97hoJRf4YuPaKPRHu0vqQ7Ajh54PDbdranKwzWWbfew KQWXWrbQtegTwlGhgUoT4p3KajrjgjIWSZTyUjpnEzbGAxS7x6XTlD7nYSQmAKJKWC2K l099Qjd8jpW9ykAFRHqr4XUplYDrDnc9yxNLiXiEqaOvl1nHa68NN0krmQoAH1Ei2U8m AB//xfWOWmGI5J7gkaAFbjwfMZ6Iy68hja8HF+sQKsX5HOr7Tb9mTvxfipkJVVfqf5zX tc3Q== 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=tKae8tjTMP5UkgeNhoYhpaFiN5CSZDz2HLOePoRr6zI=; b=wPaYNflbgS93r7VbIsbLsJwLABwJOLpMTOc6j9BwML9NOj1e1+2UXZOKqHMxHYIq6T 1w5v3ZL/Is65o5Zs5FfOaAK4DxtfBFexJlxaI9AdmOWbyIE19SS8/HbzBVReGUWIBYpF iHnYM/sSc7tOpEgvN5CYcr/0DU9YGZzs/yWTKG+bL/cSwfc2HukZ58zvCLDsX/EmdbY6 iHzCpxUQn2hOtSo73jOHKJk7LuL8bbCDXpxuMmJVB8t4ivKajirn5IBBEIor8Oaa13aD p1TXdF5vCs6LRD38Ruf9VRM0oyR58ItDatNHkoK8iZ4CcYvWXTqXJIWs+sKH4CwbmPIi anew== 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 e126si938081qkd.375.2017.09.15.07.01.26; Fri, 15 Sep 2017 07:01:26 -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 6833D609E8; Fri, 15 Sep 2017 14:01:26 +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 6C89460A01; Fri, 15 Sep 2017 14:00: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 2F55A609D6; Fri, 15 Sep 2017 14:00:35 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id EEB5260985 for ; Fri, 15 Sep 2017 14:00:25 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 924BF183BC2 for ; Fri, 15 Sep 2017 17:00:24 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eBFn9JfmjW-0O8usAZt; Fri, 15 Sep 2017 17:00:24 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id reFCwmYfdb-0OT4dtUm; Fri, 15 Sep 2017 17:00:24 +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, 15 Sep 2017 17:00:12 +0300 Message-Id: <1505484012-10046-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505484012-10046-1-git-send-email-odpbot@yandex.ru> References: <1505484012-10046-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v10 2/2] linux-generic: pool: implementation for min and max headroom configuration 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 Implements pool min and max headroom configuration 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: 8c5516bba62ee7250cbf64d1f4b89ee4f0b12824 ** Merge commit sha: 8b91795f63367f38712acfc55105fda736a91a0f **/ platform/linux-generic/odp_pool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e8ec6d85..0cf5e93b1 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; @@ -854,6 +858,7 @@ int odp_pool_capability(odp_pool_capability_t *capa) 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.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)