From patchwork Mon Sep 4 13:00:17 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: 111594 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1511360qge; Mon, 4 Sep 2017 06:10:30 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4iLnUyjXBvWTyuOtpkg4a4X160VQfayYcMwKgRAI7hXCquy5gu4qrOyWJGBf/oq79iHmyS X-Received: by 10.55.161.85 with SMTP id k82mr753454qke.156.1504530630592; Mon, 04 Sep 2017 06:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504530630; cv=none; d=google.com; s=arc-20160816; b=SqKqua5w2JCuihEkYpPOYU9eS8oSt1XMjgJfAt2sUKnOMLHVQR2TJYlJ9neD1PfqbE 5w2JCaNqo2tCHA1xSNzIbC/XHxh23RgbOpGsAQnqys6IyTPPN2KJ9/z0TUo9UpcNqIff sameZsk+pPNnXkfHQU3AQGnQI9HLBcnreoWBHpJN21v5aK5Cidi0ubtX3RKHxBWsA8M2 UDztfgzr+ePq3HTJBU7CUXNj2N27n9CED0lXcdaZyVF68rdiV9pWVnQsX3KQaTs1BW5y iDYGeX3KIQ5es1Q45TwQRCj1c2WcHVhG6C4YikCcFG0w7DOE7JlA4d0/1XnoyaBuqsTb 8qvA== 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=AstvaVMw7fOPZDHWhdN/CL4WNxdQpfC56Fn6qjzVR/Q=; b=y6LNwDsmTiKQbh1/gCn9yvSo+P8Z72lgq6DvefI8ZHOyXxNE5hZMJli+trCIfticHW hbM+wPmRt4/txRc/Z9NpGMiiC+eHKh09SupQ7zKIm/TonTtAeWIK1t5D28ZsUn9b1JIn zU8IQsm34HxKbSb8NnLT9n/wBkZMc4SUrKEFGsnoUhkZu08Y+naNB14FLyo7Iu1HedbJ sMI3vtu8I7q/Ft3dUrBna3LPq2jwygG6sQYD3woUT4yuISPqdOjiiA6g9diS+9EEyfr7 Y9E/UGchRb66Sy+wO8OHA9N+u5QuU84VX5kPdFZ1YvQMz5XRjfoSe1rN2esnxLPTpOyU F93w== 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 h83si6185752qkh.311.2017.09.04.06.10.30; Mon, 04 Sep 2017 06:10:30 -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 3393260C2C; Mon, 4 Sep 2017 13:10:30 +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 91C0760C56; Mon, 4 Sep 2017 13:05:51 +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 50F1160D4B; Mon, 4 Sep 2017 13:05:40 +0000 (UTC) Received: from forward2j.cmail.yandex.net (forward2j.cmail.yandex.net [5.255.227.20]) by lists.linaro.org (Postfix) with ESMTPS id 7B5C860C8B for ; Mon, 4 Sep 2017 13:00:23 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [37.140.190.27]) by forward2j.cmail.yandex.net (Yandex) with ESMTP id 1F14821066 for ; Mon, 4 Sep 2017 16:00:22 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id D75125080F18 for ; Mon, 4 Sep 2017 16:00:21 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id f8326gO6zI-0KFOBTOU; Mon, 04 Sep 2017 16:00:20 +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:17 +0300 Message-Id: <1504530018-8522-2-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 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: e06c8842c41c8550928bb58c658116fb7c2f338b **/ include/odp/api/spec/pool.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..6fe50620 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -97,6 +97,14 @@ typedef struct odp_pool_capability_t { * packet input and user allocated packets.*/ uint32_t min_headroom; + /** Maximum packet level headroom length in bytes + * + * This is the maximum value for packet pool headroom that + * can be configured. This value could be rounded up by the + * implimenation and it 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 +222,18 @@ 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. Each newly allocated packet from + the pool must have at least this much headroom. + Must not exceed the implementation defined + 'max_headroom' in odp_pool_capability(). + @note if application does not required headroom it + may set min_headroom to zero and implementation may + set headroom as zero or roundup to minimum headroom + possible in the platform. */ + uint32_t min_headroom; } pkt; /** Parameters for timeout pools */ 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)