From patchwork Fri Sep 15 08:00:12 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: 112685 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp335524qgf; Fri, 15 Sep 2017 01:02:44 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD+lfpm6isKXe8yDiFJpzAwXQ4BHQ6VvGJ5w1pKdBnpe2Nmi1TCuy1v70ak4vy1CW+F2zKy X-Received: by 10.55.20.16 with SMTP id e16mr6739491qkh.97.1505462564540; Fri, 15 Sep 2017 01:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505462564; cv=none; d=google.com; s=arc-20160816; b=FqkkcXAsfwH3OJR3cr/fetS4Qp/Hl2TRKSaUS5mJK+OmrkcUy/ZtWWQQWHxtzBG1Jd +EjGPpcLwt7DFdj7Q7WD7tujAK5hTtEpwix33+lJ3azO+Q+D7OGHBeM5/nlrSfRsg0oS KUdp6qFbfYmGH/ry718MARvKSgHeXq7h5FMDwVzSYgd2k0RkCZM01SFGSDFfZCWMbcMd 8G9IwSDfgIpAfauTUDUiNWyLKfvInQiWjd8YEIBDDqVh892Meaghudw8joEppK5dJ4uf X5jHQ61Ao/aOtyxKwEEy9oDjPYYySJjwyJARUr5fVbq16JsiJbHq3oZVgYzWGfAsGFov 7+Vg== 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=pxEw41OuYoVChr+9sESAOOOlGZ8E19YwZ2I8y7JN18Y=; b=yH/0NkX8uAtMdlH4iuiWp4EFbhK9uaPiip4tMuWmpvMzs4O/+rGVxecvWV4QEHPmZs 7B1XAhDK+QkSmBHlwAiTfh9qpSjTeXB4nP6hN+iw8hCoCWjM9Z7SRpvQD9Bwpohh/OhZ wre3SbR63w5SaYjo7H33Zzb076jC5r0e+nHXbDoYvFUma2cDJ9/Y+na+lVHCrGFEjJju wBu4rZJbU8zA/Ftw9s+SbGdfi9AP4wgX7F5IRJLLPOOSPIYpfhH9uJ91EXrZDbni3ki1 xRrSqAso99fvOyuPYoxgENu07zQCKmc6gIbgA2rOIZT3y+dr3OrQMxO8vwrE8rv7Uo3G LPAA== 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 x25si390527qth.251.2017.09.15.01.02.44; Fri, 15 Sep 2017 01:02:44 -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 322D36097C; Fri, 15 Sep 2017 08:02:44 +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 CE74A6097D; Fri, 15 Sep 2017 08:01:11 +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 71B0A60915; Fri, 15 Sep 2017 08:01:00 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id C637960948 for ; Fri, 15 Sep 2017 08:00:24 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 3DB4256050D3 for ; Fri, 15 Sep 2017 11:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9OXgQ2x7jI-0NcSocJC; Fri, 15 Sep 2017 11:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id c6IDcorNtS-0Mt4rVkV; Fri, 15 Sep 2017 11:00:22 +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: Fri, 15 Sep 2017 11:00:12 +0300 Message-Id: <1505462413-12117-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505462413-12117-1-git-send-email-odpbot@yandex.ru> References: <1505462413-12117-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v8 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: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: 588243e91beb902b34b89a79b78edd4d2e7bd23e **/ 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..e17bd5e05 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,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 min_headroom; } pkt; /** Parameters for timeout pools */ From patchwork Fri Sep 15 08:00:13 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: 112684 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp334973qgf; Fri, 15 Sep 2017 01:02:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAVSZk3kTff9dyj5iSqGWqpY348Qmkuz5232UaA0N5jngyuRY6eTbvJTYm0kbeO2ZDdl4zk X-Received: by 10.107.134.229 with SMTP id q98mr6264869ioi.262.1505462521329; Fri, 15 Sep 2017 01:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505462521; cv=none; d=google.com; s=arc-20160816; b=nNkyXGuuox1+iaZyAIcM7qCL8y8zsbdf846eWO0v2jlM3Na1UQoblD/1mLyNFpBzNq kA1tRiKH2UdzErI3Ydp0ktMqyBOkI2dp/lmp6nLSJq8pFazy7q90VHCkVDMcOzibPFva bV4Qkh+RtSBnF9sFgOBJm3pug99aH4xmI+6XnAmNQpqmIRBTJyNAonTRVZDTBkwXDqZo 2modWDwirgEG3Amh7OQs2D9+OZcEChz7AUNG52EV2yfoaYHPYouACgZycya7FpAvFGbR Nl9pUecXQXaTPGYrhAfRRiqp0jUetOW4z7b6Jx93Ub5UW2dpoazFyJ8v99YqBNQAkaoi LWIQ== 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=sklKVjXyehjeM1Sx4McNxCx0cw0dD38z0mNjiW11TjA=; b=xmeuIbYD2a80oMCBvarfee0535Rgzd0YWw4ER7ZeV5+yRxWqdcJ+Q5Cq81UytRVFKP ZMUE2hCpSNT3u8rps9xzwkrNNeFBb+BqtOvhK6bjyl2nQ0jM9+SKfjrbuXlboWVrZcBm IAQQpl1tZNVHGbUcGUhYA5HxMx5WFUoqY6BUKthNyNhf8ZBm2SpR2yLyIGzlB8OEj8qw 5/v0n2BNieIJoACkr0IsqKTx/Tk/htIDixNDfAj8m9QbW26JXLxHK6o8MAfZROQdJUjp gIehmIXZy5WiFMJJsufOgG41YNcqj5w5oqqdr0Iusbrf3L29Bnbwt7A0J0ORfNCC0Rgg CEsQ== 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 d197si297290ioe.185.2017.09.15.01.02.00; Fri, 15 Sep 2017 01:02:01 -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 B9676609C3; Fri, 15 Sep 2017 08:02:00 +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 A16E360948; Fri, 15 Sep 2017 08:01: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 DA27A60993; Fri, 15 Sep 2017 08:00:54 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 73EA160993 for ; Fri, 15 Sep 2017 08:00:25 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward102p.mail.yandex.net (Yandex) with ESMTP id A2C7843025CC for ; Fri, 15 Sep 2017 11:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 73WhOIaI1Z-0NVavRBf; Fri, 15 Sep 2017 11:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id c6IDcorNtS-0NtuCYZs; Fri, 15 Sep 2017 11:00:23 +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: Fri, 15 Sep 2017 11:00:13 +0300 Message-Id: <1505462413-12117-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505462413-12117-1-git-send-email-odpbot@yandex.ru> References: <1505462413-12117-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 152 Subject: [lng-odp] [PATCH API-NEXT v8 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: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: 588243e91beb902b34b89a79b78edd4d2e7bd23e **/ 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..0cf5e93b1 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; @@ -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.min_headroom = CONFIG_PACKET_HEADROOM; } uint64_t odp_pool_to_u64(odp_pool_t hdl)