From patchwork Mon Sep 4 13:00:18 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: 111595 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1512926qge; Mon, 4 Sep 2017 06:11:43 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6MOYD/olutHcBcEST0iwUn9cawjeVbw4V6r4suNK+D0cKg5Rx/KHFnatzQE0DnwsQJoK9S X-Received: by 10.55.100.210 with SMTP id y201mr685614qkb.242.1504530703893; Mon, 04 Sep 2017 06:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504530703; cv=none; d=google.com; s=arc-20160816; b=Ttccn7xWxWLGHQHHoBEmryxVg+ieOgwBQ5xWOSRZM4z9gpyrJbZ/ySna83rtHgU7b/ 9/SxL2RdgbclOCZISEw7NhaB+oH1oSrj4g2OBRaldXzvTg6QRuFVi2GxlcPmuVLrh4WC JwpDHw3YG5q6AlLzqmrL9HItxwOIH0FHtv9mCKiKI8AH4QaOXraz+KVfhStlRRAnNABy yYrlRyOKfKdkOvlllRTTEiMn+Y5XE1rbZO1k22oZ5TaQxLB00Zm8bgWXDxk6RW6qiyLp GYT9QJcyVmsmd5VSdU40MWJri+TIPq38BluyNi4aqTzjoL6zhy4fVyUIRvWAMxltQdhl Z4qQ== 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=/ILf3ch4syOUYLLlMcBKKR0pO1KNQ9p4wc8DUkbZ9KY=; b=yZUR27dqUtaV/K55aZ9JnUXw8Tc7tdf+VEEayVoNzc4rEJAjWZYAqoCN/KMhmfF3Xb ZK4oKenheKFTfcaFsXc6BjT9FuUU5bT7BstouxU3lt+frvWgNucD9e1PO18pf8BHYNrb T8wbZ4FDsC3E6OTIEDgGuOj8D6FWsnyF5HMZeA0jRpU9GoH0m0Z94ffA29xBe8IcVhyf T4hOMGKrRMYu4EiPOW9XMHh1qkkQlfT6K+a+q0T4/c8YIm0AT2RkCfxjjCnqKrVa2aJN P/J5KXwad1Tl97swiUfSmMWTJQItBlMTghrP/Iyecqr47fphCcec/uqdFmzNhNUBWRyZ 85Jg== 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 v62si5428311qkh.131.2017.09.04.06.11.43; Mon, 04 Sep 2017 06:11:43 -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 7C3FB60C31; Mon, 4 Sep 2017 13:11:43 +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 B4A25606D0; Mon, 4 Sep 2017 13:05:57 +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 62CDE60C90; Mon, 4 Sep 2017 13:05:42 +0000 (UTC) Received: from forward1j.cmail.yandex.net (forward1j.cmail.yandex.net [5.255.227.19]) by lists.linaro.org (Postfix) with ESMTPS id D4E1B60CD7 for ; Mon, 4 Sep 2017 13:00:24 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::26]) by forward1j.cmail.yandex.net (Yandex) with ESMTP id 2CA0D2065E for ; Mon, 4 Sep 2017 16:00:23 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id D237C5081165 for ; Mon, 4 Sep 2017 16:00:22 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id f8326gO6zI-0MFOdMl0; Mon, 04 Sep 2017 16:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 4 Sep 2017 16:00:18 +0300 Message-Id: <1504530018-8522-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504530018-8522-1-git-send-email-odpbot@yandex.ru> References: <1504530018-8522-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v4 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: e06c8842c41c8550928bb58c658116fb7c2f338b **/ platform/linux-generic/odp_pool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e8ec6d8..6e079cb4 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -348,6 +348,11 @@ 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("Headroom size not supported"); + return ODP_POOL_INVALID; + } + headroom = CONFIG_PACKET_HEADROOM; tailroom = CONFIG_PACKET_TAILROOM; num = params->pkt.num; @@ -853,7 +858,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 +919,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)