From patchwork Wed Sep 6 13:00:28 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: 111774 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp846724qge; Wed, 6 Sep 2017 06:11:15 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4gEOPoGa7BJSVPZ+yOTuXgRAh6cG6vcPDG86kbrNmD+XTSGrK+3Ns87FkVtodLARc3vsq2 X-Received: by 10.200.2.72 with SMTP id o8mr3330329qtg.63.1504703475499; Wed, 06 Sep 2017 06:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504703475; cv=none; d=google.com; s=arc-20160816; b=zSL5OBv47A793ySw+PPs7hOvwYuIk1Pq0sVzm1ZFXpfqZ/OO0/Wp7AiuF3oNMfa2EV 31Kyl/a4wDvQKoHSB7Ommrp+JBuen97+4bEs9yRWQWCuSA9yUm0OLRp5VFAIxyUbV9HR G61zyr82+jwxgcnpKP0bIYUIGbLYgQHt4fcd2/MbkC5PxljLgs17iWWrtq3mthcdRk71 ML8SqgTIfl2Kgkr0evsN+9JQjjPGKRBpuMDawTG3GrgOUhZkOhhmQ7idKIsvdn0v4Q0E 2elIvq1diJnvcJG5wkNE7SqUQ5Gf4tLm2Zx1aHTZphdCHSV9tvHDxoN0/7UDs/jiRJLC gO3w== 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=NQUllh+ziEpcm3i8kVWUHHYKwLwpwE+L5Px/Nf6K4vE=; b=mptUjIqrnsFAZzkfmMGwnaG55jwyMHecVlo4wRav3mmMp7KwZHWpsQ0SCr5C4uinVF N3cnVFm3UQhSaVyEzoQO5TP5hBiHzpL3/PjebJ1KSqmHDmer8Au44XL8gnGNWSwfOQL+ up1o9zfrOlvL4zq92SU/M/G7bOJqAtJJfDL0kWkhla5+FpN20J9DhyAWNXIU5zQi72XP wTqWgtivQOnaFa0NeKdtMD83AYf+KglBqXzQEZpTuXJlbDy32XaJaCQqgg/l83PXOUnB tPmxXw3hC5xFSOguXF1787qR4cNOOGBScLMkQu9Et7d2bFDCP4mtuKyze516fSdQHT16 ji2A== 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 g4si2925268qti.519.2017.09.06.06.11.15; Wed, 06 Sep 2017 06:11:15 -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 08C966084C; Wed, 6 Sep 2017 13:11:15 +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 277B964496; Wed, 6 Sep 2017 13:03:12 +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 ABFD56445F; Wed, 6 Sep 2017 13:02:54 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 08C336445F for ; Wed, 6 Sep 2017 13:00:42 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward103o.mail.yandex.net (Yandex) with ESMTP id B5BD858862A2 for ; Wed, 6 Sep 2017 16:00:40 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zF9coEjt84-0eamP0Q0; Wed, 06 Sep 2017 16:00:40 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tTHWjTBMQQ-0eXS2rwc; Wed, 06 Sep 2017 16:00:40 +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: Wed, 6 Sep 2017 16:00:28 +0300 Message-Id: <1504702829-13921-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504702829-13921-1-git-send-email-odpbot@yandex.ru> References: <1504702829-13921-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v6 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: 4eae04e80a634c17ac276bb06bce468cbe28cde0 ** Merge commit sha: 998193a656d35d26c49f1c5b6254d75f5eab0974 **/ include/odp/api/spec/pool.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..164ae25e 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 'min_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,17 @@ 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 require headroom it + can configure 'min_headroom' as zero and + implementation may or may not allocate headroom. */ + uint32_t min_headroom; } pkt; /** Parameters for timeout pools */ From patchwork Wed Sep 6 13:00:29 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: 111775 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp848501qge; Wed, 6 Sep 2017 06:12:21 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDFOUQARMEqvl28WGQOQkd1e70F9O4+27IK8u2rAZTpJ9XaDERSiROszeCFtSnuLvscKvkT X-Received: by 10.200.20.132 with SMTP id l4mr2853847qtj.10.1504703541412; Wed, 06 Sep 2017 06:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504703541; cv=none; d=google.com; s=arc-20160816; b=Vf12Cq5KQdolNsLYXiJtFh0mz1Q1yzMnKZpJqLBk33xo2ruR4hAlpYL472tewHv/AR sIm9TNZQFrHKTf9Ay87oDk8BCCdEhP8RIjXn42xjotM0nmEp/gXayPTH/GpjacLWBHwC Hg/Gtf54eVllNhNVHRy+Fp4c7P4Ti/3ck4inCJRlUvjdNMvHP57eOKJoGEcZRSxwck97 uF3i+EiDx72qrMCJmsg8Qf+bk0VKviWJKMCgcN9YST/TsbYaqd6c8GzdR9i61DbGqw8a nNYHzLJlXTHVOxvbbQUEMHif3e9NrT/a6+iBSBzXd6Tf68XO1qYJFG2IBHwh86aGaWEz z1Lw== 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=wNhN6kd56oTVWWnu2VSRBuwTtpQnA0lgONNNsPYZtTc=; b=D7MmcBGllriSTh0NQC+nEH9d7U87ZyDvHdeL/K9CssZ0dRwlO4Bt9UUrmjSKJAXSgx Rd3QtnGBVGffWcnHvpkjsSFmq6NDPx00gfwFCBFbFaU95Z08ZblAsIWvtEHB92budFNE sJurFRKocvEdfNUr48ud+/5z4WokiosMjngcifCYZTEg26Fi/5KMRAUG9iiPX2sCWH0B /kgeABzG/IdH0kci0/TvMyCh9IvPwL9Ns72kiopvt3iV6TRCfpZVBfXLXrtOVeuXxhzc 4TXQjFBW9VpyMjt3z/RMwBu+BbKTgX6zxyrdACvSjANfBIKyA8gmOEWI4jAxfZHBMV3e 1n4A== 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 y88si2971355qtd.434.2017.09.06.06.12.21; Wed, 06 Sep 2017 06:12:21 -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 0B5BA64452; Wed, 6 Sep 2017 13:12:21 +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 7FA2F64467; Wed, 6 Sep 2017 13:03:18 +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 228E261E19; Wed, 6 Sep 2017 13:03:03 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 6B7B161E19 for ; Wed, 6 Sep 2017 13:00:42 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 5E8E658855C6 for ; Wed, 6 Sep 2017 16:00:41 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kwDbxCqtL3-0fkWivkU; Wed, 06 Sep 2017 16:00:41 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tTHWjTBMQQ-0eXaVLq8; Wed, 06 Sep 2017 16:00:40 +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: Wed, 6 Sep 2017 16:00:29 +0300 Message-Id: <1504702829-13921-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504702829-13921-1-git-send-email-odpbot@yandex.ru> References: <1504702829-13921-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v6 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: 4eae04e80a634c17ac276bb06bce468cbe28cde0 ** Merge commit sha: 998193a656d35d26c49f1c5b6254d75f5eab0974 **/ platform/linux-generic/odp_pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e8ec6d8..ebf09f7e 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; @@ -853,7 +857,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 +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)