From patchwork Mon Sep 18 15:00:25 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: 112931 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp3465756edb; Mon, 18 Sep 2017 08:04:40 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDXvzpkdOJArPAqZB2n8jiOtworc6Ojia96owMwZ3ZhRZm7p2BLHNc1i5OBYZDoXKz8PQgD X-Received: by 10.237.36.61 with SMTP id r58mr22258682qtc.10.1505747080294; Mon, 18 Sep 2017 08:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505747080; cv=none; d=google.com; s=arc-20160816; b=cOB98bk1Nwdbubzq5vgHgqdT+hiNnFZDAlEHwzOpAGVkRYYhsVVkF/xucYUnDOpRPy IXTbA3MiprdSoczPToNZ1wf8bOiu9IPqhFBLOWmOhILpqUhN6pTYefBXFDknD020CQaD c74o2OVF9EuPFAnZXCezJL3Dw56VzZ8AFjjjF7m60D0JG8IxeU2b/x77pErE9WB9FX/B NGHbc/PaqxYwRHJj0So9TGTcBhUEX6uMjUeNHu4WitBqHddkTegaTNo61oXNZF9+jZxL rXIdGFXAUxhKIecNcBOdNegpWS48XdFOt6A4S2Mlq5LBcn0VBqTNe1G6T8utn9MvKUBC 11Ng== 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=4JjxgyY+serHSR9hXYmbhgDeIWquGEFeSq3O/UMbwZM=; b=mt2/FYELF2y89fFITCnLLQndbPNnZ36RNyUP6lZl9p6VA4xvQ5MSlTMykRMEZBs+oR Nx452yhbvhiQ9j9T49Txb+YQVim0AlwP4s2nD0IFGfrxiCoE0p1WGkWc8WFmyCfIlVVn oPE3a8RdFqTdg4Z8OipCITmuYS4dPvPo9GzmgX7qCOAZG5lizVCmkkomg7XyJISzejVA 1//ZJ8aXlLrnKqb9bOQYcDR/9/1KlqTdW69jwkZ9Mw6+2/6Tp7jgjcEVE0UfUtGcmaNo 9LpG8OFO4gepcdyhWOrNnUVQEnZ64Dh3H2YGwMz9QeP24XVWYyR5fML18dukKZueQTwz Hhdg== 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 r18si989402qtr.513.2017.09.18.08.04.39; Mon, 18 Sep 2017 08:04:40 -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 8739060EA7; Mon, 18 Sep 2017 15:04:39 +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,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 530F960F34; Mon, 18 Sep 2017 15:02: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 D676460C76; Mon, 18 Sep 2017 15:01:57 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 4C53760D95 for ; Mon, 18 Sep 2017 15:00:33 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward106p.mail.yandex.net (Yandex) with ESMTP id ABD102D812BF for ; Mon, 18 Sep 2017 18:00:31 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gCfPgYtgl0-0Vcq47nS; Mon, 18 Sep 2017 18:00:31 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id CO0nIcJMFi-0VUqLV2s; Mon, 18 Sep 2017 18:00:31 +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: Mon, 18 Sep 2017 18:00:25 +0300 Message-Id: <1505746826-26407-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505746826-26407-1-git-send-email-odpbot@yandex.ru> References: <1505746826-26407-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v11 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: e344e4364f771f32b86d822d0c447770588fe65d ** Merge commit sha: cc1bd108cea5cbf012cdde50c1ec6fb86368562e **/ 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 Mon Sep 18 15:00:26 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: 112930 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3768679qgf; Mon, 18 Sep 2017 08:03:55 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCO/sg00RO+JSDdOLV4Y+2ihsg9chZzpv5WqDibnLOyFHRzhLBikD95rk9WMen63U6Vtp2e X-Received: by 10.200.40.117 with SMTP id 50mr5410800qtr.167.1505747035055; Mon, 18 Sep 2017 08:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505747035; cv=none; d=google.com; s=arc-20160816; b=XYF3TORgzzwQdYDGWi6BnCuQ0Yzt5iLXxQo2UkPRsKKzdG5Vj1UMUx9fn3mGTyS/lW +2Vq3RwB4ITSDmVYlPvwrLeV6nREzTLczJhNkjmNl+TA/8/vH/krvxdSh76XFiErF/g8 rj3YPsVEFo935oHT4Tc2WM8Ui0ez67Ndxv3nTFib2qp29ysxNFMAe71+TStjK1cxyW8i e2cTF4wuachvsESCZsnCEQ3CGbKPVR0WDKInge8yOpTDbDJvfEUz7AlXxZlUlUXKxhL0 XPULYyHxgePMu7aSRL9n6bt+nbgdJDunyggYOyie0Z9Sn7WyCA/0WG91H6+hWYE39jQq SmiA== 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=jQr9moRrwa3TXxIKYQC+ubo5TTmiEj4vz7nXkTDkHfQ=; b=N7M7M/Iq6naRnFDhJ3LIBECCLR1lZ1e8F++4F8ETQFuJGT/ZWzuPsarpcy2QHyngvG 1w/FFJnJmcE6I1zO8UoKBYA7EJsZILOmXkoNxXt+51RhXc7+QHM0LwuQfSsPpCCKK7/S xKiUFabdu9iURk7IGugdSJVShDV/HefHSE0yM0+8c6Hw3fiCHBROxfqB91rdvmVVmAZi JOvbK5DCFFBeb0rYFEkcbyQPbFBGeJt7+0c8C+DsSLZ1gP3xCJVITjG1G8qwPATjLqYh I+K8a0Wa5cTwJPhZ/GLpM/fVF/XAX7Be0M0+I1XsfkWvAFzadmgX2WdgFcuttaK/jmjV C62w== 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 31si7301004qkt.244.2017.09.18.08.03.52; Mon, 18 Sep 2017 08:03:55 -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 7651760D88; Mon, 18 Sep 2017 15:03: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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 0A54960D9E; Mon, 18 Sep 2017 15:02:06 +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 314B160C76; Mon, 18 Sep 2017 15:01:57 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 5BB8F60D9E for ; Mon, 18 Sep 2017 15:00:33 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 523076A821D7 for ; Mon, 18 Sep 2017 18:00:32 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id R2hscfbnT8-0W4a0oqY; Mon, 18 Sep 2017 18:00:32 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id CO0nIcJMFi-0VUq053P; Mon, 18 Sep 2017 18:00:31 +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: Mon, 18 Sep 2017 18:00:26 +0300 Message-Id: <1505746826-26407-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505746826-26407-1-git-send-email-odpbot@yandex.ru> References: <1505746826-26407-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v11 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: e344e4364f771f32b86d822d0c447770588fe65d ** Merge commit sha: cc1bd108cea5cbf012cdde50c1ec6fb86368562e **/ 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..51e8a6189 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.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.headroom = CONFIG_PACKET_HEADROOM; } uint64_t odp_pool_to_u64(odp_pool_t hdl)