From patchwork Fri Sep 1 14:00:09 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: 111489 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1073655qge; Fri, 1 Sep 2017 07:00:47 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7L5rVmz9agl65jojb70FeTJJxEt/Imc4iggeMEuiIbJzZ8tpMa6RBQRehHCZWWi4wTi/LD X-Received: by 10.200.51.3 with SMTP id t3mr2956583qta.67.1504274447616; Fri, 01 Sep 2017 07:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504274447; cv=none; d=google.com; s=arc-20160816; b=Td0lgoPmsniZ/hSl6vU9e4GVdJjpY37ySdqMd0Tm3mkszOicMGVk2vo39KkiD7V6+J 7y3ZI1dxg44e2PdIcvDwa0TiWb11sxXqZFkUaBANq2hG0ZBm1wiyJ3m925R54BSsffCa CsAPOWbQoeVdcze4j4YPA9EHyH3qcqxDlFzuwLGU4rbrc8zojLW+sgmroy9fHG1s82fI gHyv2fbo5aHi3mQKVjAHMz5ETESpyhgfSGObbEUdzSIdXo8b2YgF61XhaaYX59Ut8fXe vpZzvXdhZRbuaFIuLifLb5fUMlC2IGmxCefFzjl/HgTnCKYz2ExM3Hkrt60tCZT8+W83 kyWw== 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=W5jC8bq110/owcUPy3nZYy6i3Y6yBJHJt3LwboKgvts=; b=XR2gq4N2I5JpGAE0Nbi1cfm7rBE6dDcbKcQ5MMgOgYHJSVq+xdNyVsbgGgPm2/e1Rd qnG34YKJgaS8z4fpoGTcIwuyG4OBKgdx/KUnEsjOggyV6VBhrHh/IHwlGgzDon7hbvDZ AAwfOvc35qty/ZavjxGqFwjDSMA5vJFb7YI7uT5stn7a5CuchXq0UiVxT5qPVtSvQkn/ sBwyMXwYG57z5u92AR//n6iMrGnWl2Ssmvwto6CxqpdfvM7Ndxi/tM8fXRxj73o9KEoi lMGutWa4N4+6/3I3wdfz9WCKojJnuDLamkZ1rtCK6bHSHthE2O6H0d8i17RT3b13V7/0 BbDQ== 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 d81si10368520qka.440.2017.09.01.07.00.46; Fri, 01 Sep 2017 07:00:47 -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 C9F1064472; Fri, 1 Sep 2017 14:00:46 +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 1F97B64463; Fri, 1 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 46DE864463; Fri, 1 Sep 2017 14:00:33 +0000 (UTC) Received: from forward5j.cmail.yandex.net (forward5j.cmail.yandex.net [5.255.227.23]) by lists.linaro.org (Postfix) with ESMTPS id 1C6C86446B for ; Fri, 1 Sep 2017 14:00:21 +0000 (UTC) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [IPv6:2a02:6b8:0:1402::15:6]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id 191292077F for ; Fri, 1 Sep 2017 17:00:19 +0300 (MSK) Received: from smtp4p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4p.mail.yandex.net (Yandex) with ESMTP id 5DCC465011C1 for ; Fri, 1 Sep 2017 17:00:14 +0300 (MSK) Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BHck602UYB-0DU0tqmH; Fri, 01 Sep 2017 17:00:14 +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: Fri, 1 Sep 2017 17:00:09 +0300 Message-Id: <1504274410-17066-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504274410-17066-1-git-send-email-odpbot@yandex.ru> References: <1504274410-17066-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v3 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: e1cfa6dc01b3df727f04073619b8e50b03efe4d2 **/ include/odp/api/spec/pool.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..ea8491a3 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,15 @@ 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 atleast this much headroom. + Must not exceed the implementation defined + 'max_headroom' in odp_pool_capability(). + Implementation may round up to a higher value. */ + uint32_t min_headroom; } pkt; /** Parameters for timeout pools */ From patchwork Fri Sep 1 14:00:10 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: 111490 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1075479qge; Fri, 1 Sep 2017 07:01:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6lzV9jO+CecgNj428zDn5qo1LoB+Hv6AZ3zd7nvNeFJRxUWU14qzOE2rgGdp8xsLvhSnrI X-Received: by 10.55.73.202 with SMTP id w193mr2801831qka.228.1504274516819; Fri, 01 Sep 2017 07:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504274516; cv=none; d=google.com; s=arc-20160816; b=Eb9oKFtRCIxZr2SBEP59bdbxgbL7yqLx0cRtx8TBIpbz4IuzsroSx/69+NqkkfoB7g hNLAicKiHuGG6qxRLoGjVORuaJu1KSA1z35xX21hOWekX6TD4yQfvWfy4qiSDEXV530u AXLJ83n2pYGletQgWl13zqPrDk3ORHdJ0Lxa8dB/b/Stee95JmLt6XoUsgQhjZ+vtSeF PtYKWrLCqVlfCRhZJ5dvQT4Rb4RriZQFwzPcTi3uLLtjs97lL1QvdmsAk3sc8R9/bTHJ fT6JCt1Wdks8KnaAj55v1Com4IHUFuM+vkWFBA50Rb19JxQiUREorWWeP6iwE0YUYLWs n6Eg== 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=oJ2qfODkr+5BNMaECUOjRMmcybJIg8Q5C2KaSovJgtw=; b=o9oFF2vloOsD175QdVww4oAo8VaxPmH22tflOFJz8gGWXDGf0ZVA/0SRXFEj6RzRFp MMTyVqPzOZh72fvp42are6kkbDBZT9BId6lySRPAPD/eI/YNsUtdmcVia3wOdlpWidKn u260pZ+OUBk0PAfVcqIOU4YqZdudaEV8yVavpRzgBwYFYmh0XPegtp6IlZWMq4fQijx7 WuPuu718H6a1Ilguy+gqEM/Fof6Rif+2fhGLOF/FwQi8JA4AFuT6n6ABkavlfugMkh6k ZT30F/djGsHJOXG/Zt0EPOVczdfLGlNIzQJ4hRNzC9AoUOpXKzyLtUBOi7tAcxRoy1Xd LGrg== 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 n8si198231qtf.238.2017.09.01.07.01.52; Fri, 01 Sep 2017 07:01:56 -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 6C8D06447C; Fri, 1 Sep 2017 14:01: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 7DBF664472; Fri, 1 Sep 2017 14:00:50 +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 78DBD64463; Fri, 1 Sep 2017 14:00:33 +0000 (UTC) Received: from forward3o.cmail.yandex.net (forward3o.cmail.yandex.net [37.9.109.247]) by lists.linaro.org (Postfix) with ESMTPS id DB4436446D for ; Fri, 1 Sep 2017 14:00:21 +0000 (UTC) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [IPv6:2a02:6b8:0:1402::15:6]) by forward3o.cmail.yandex.net (Yandex) with ESMTP id 1556720F57 for ; Fri, 1 Sep 2017 17:00:20 +0300 (MSK) Received: from smtp4p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4p.mail.yandex.net (Yandex) with ESMTP id BBADA65011D2 for ; Fri, 1 Sep 2017 17:00:15 +0300 (MSK) Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BHck602UYB-0FUOf9sJ; Fri, 01 Sep 2017 17:00:15 +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: Fri, 1 Sep 2017 17:00:10 +0300 Message-Id: <1504274410-17066-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504274410-17066-1-git-send-email-odpbot@yandex.ru> References: <1504274410-17066-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v3 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: e1cfa6dc01b3df727f04073619b8e50b03efe4d2 **/ 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)