From patchwork Mon Aug 28 13:00:11 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: 111155 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp4798529ybm; Mon, 28 Aug 2017 06:02:29 -0700 (PDT) X-Received: by 10.200.27.77 with SMTP id p13mr641295qtk.330.1503925349610; Mon, 28 Aug 2017 06:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503925349; cv=none; d=google.com; s=arc-20160816; b=oG3lRgHG/JmeSi+CfeNzj0fh/yelV0XNMIsLv2VwrnKwcBCBxraORydCJLo+W94/Fd mH6fXoTo8Enp17IFmpMbHnlDrm5+I90NTkIv2FE7U7LlYuN4uE9ufzXV4CvehmaqrcZ3 CrtxEmNaZHGcF7Ce8W/EDH4ndMBzjgn0KsLZgJ2vQ39iG6F1tlX7VvH3IGOuepXSmwvC ky/ml6G6WAF9VY4+pVzPkNh9nkoUUtdYzInUkS/7gdgtPsb72si5jU7CQKoddfsjBjii Znwm0YXYpOQ2RDqbxGSmwVPNXn/U8wpZPWWDVeqos2o2+SKqvmNOcfEvIGsUu8HvRIGX qvTw== 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=GmgYi2XPBrRp7ht+XVycgz2j+ocbH7cwIPOnAGR97SM=; b=fVJ1/ZDryUIwu+hQphywqmBwpPNBDuSd6c0NrIyP+Oi1bpoDiHicqCLGzHUkin3/Fy hUx0wvcR4O2rlaSUxLdpF/RpLPJay29WDAwQrt1wDXxiYzZi5QRMK80d/Lji5EkNsSwn djGMS+g5uVS2Jkm2WZMrtwOmZphK9g3bkCjqGXxa22M6d5yW3j+1TqIrCZDPkncnwcy1 TRqS3qegzgZUIi8sd8Co+obFnPbSKPeQNZZ47jcJGyJLbU6q5Mic7SlNKHm7XzOXPcAH 4ENUorirsDPoYkRmpeMpkWtMlJuSO8A9s4O5uYULXhVtckBYQ5+hrpgmN4fJ2aLgiKYU LQPA== 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 s123si300978qkd.273.2017.08.28.06.02.29; Mon, 28 Aug 2017 06:02:29 -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 05B61609E0; Mon, 28 Aug 2017 13:02:29 +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 0778D608E2; Mon, 28 Aug 2017 13:01:37 +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 6A3E26096D; Mon, 28 Aug 2017 13:01:32 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 3EA0C608B6 for ; Mon, 28 Aug 2017 13:00:48 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 7F7B82D81CC0 for ; Mon, 28 Aug 2017 16:00:45 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id sV1YHLwWwh-0jYu8NP4; Mon, 28 Aug 2017 16:00:45 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gV19kLH5yc-0iu8lwqF; Mon, 28 Aug 2017 16:00:44 +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: Mon, 28 Aug 2017 16:00:11 +0300 Message-Id: <1503925211-13711-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503925211-13711-1-git-send-email-odpbot@yandex.ru> References: <1503925211-13711-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 148 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: pool: add packet headroom configuration 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 packet headroom configuration to pool parameters Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 148 (bala-manoharan:pool_headroom) ** https://github.com/Linaro/odp/pull/148 ** Patch: https://github.com/Linaro/odp/pull/148.patch ** Base sha: 859293ad9b3c862264bb0fbfe8e7037b5e04d084 ** Merge commit sha: ab1d3b5ca5cc5ad67dc6ac092a3a175a7b5ac208 **/ include/odp/api/spec/pool.h | 7 +++++++ platform/linux-generic/odp_pool.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b4..f173ab2f 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -214,6 +214,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; + + /** Headroom size in bytes. Number of bytes of + space preceding packet data to reserve for + use as headroom. + Must not exceed the implementation defined + ODP_PACKET_MAX_HEADROOM. */ + uint32_t headroom; } pkt; /** Parameters for timeout pools */ diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index d170782e..b552904a 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -346,7 +346,10 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, break; case ODP_POOL_PACKET: - headroom = CONFIG_PACKET_HEADROOM; + if (params->pkt.headroom < CONFIG_PACKET_HEADROOM) + headroom = params->pkt.headroom; + else + headroom = CONFIG_PACKET_HEADROOM; tailroom = CONFIG_PACKET_TAILROOM; num = params->pkt.num; uarea_size = params->pkt.uarea_size;