From patchwork Thu Dec 18 21:21:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 42473 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F3F426C6B for ; Thu, 18 Dec 2014 21:22:15 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf1373660wgh.2 for ; Thu, 18 Dec 2014 13:22:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=tWawX8l5oJZB30uN9NeLaUhXGwnghhpNGwUXvZpuNHM=; b=daBmpblKBIC7s1olU7I7vykQjquqo03tX2O31CbaK7+FOfJNldIG7ByOycOP55WC2E fLv3n4W+Jq+9rOykhJq95c15cUPApmbWWFAZfBiiTnpuub4jVFBoadVYdJvF3Y58g6vv bnPti2p7xmLLFMQj+tqqVceVrJKf2u4sAmTZH3UR5Ew8rbTYgIu6x5ajzIDa5NVA3Xtp E4v2IpRQiXkF1Jcxq9Kj0BXKevAhyNRJjO4rqeg4ZmmN9z9C89R8WDt0fL2w87VB3Sjb Rtw1NAJ8XvJ7czagjnCNObYIhJLxLiZHbZNzrBGCz2ancvQYt7BkeW5knvnARuY7sYcj JWuQ== X-Gm-Message-State: ALoCoQmhkZb5juNKUNp7oKgHn8Ktlc6bCZVRNxo6O3ToCVpwVBIcnB5DePNRDVL0t0XaaqLqqCyA X-Received: by 10.180.7.226 with SMTP id m2mr698944wia.5.1418937734243; Thu, 18 Dec 2014 13:22:14 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.205 with SMTP id ba13ls1107067lab.66.gmail; Thu, 18 Dec 2014 13:22:14 -0800 (PST) X-Received: by 10.112.167.228 with SMTP id zr4mr4455836lbb.20.1418937734081; Thu, 18 Dec 2014 13:22:14 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id uc2si8035463lac.80.2014.12.18.13.22.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 13:22:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so1653239lbi.38 for ; Thu, 18 Dec 2014 13:22:13 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr4389686lal.29.1418937733798; Thu, 18 Dec 2014 13:22:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp72217lbb; Thu, 18 Dec 2014 13:22:12 -0800 (PST) X-Received: by 10.224.56.3 with SMTP id w3mr7866983qag.51.1418937731869; Thu, 18 Dec 2014 13:22:11 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id n13si777885qab.15.2014.12.18.13.22.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 13:22:11 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1iWP-0006HN-2Q; Thu, 18 Dec 2014 21:22:09 +0000 Received: from mail-ob0-f176.google.com ([209.85.214.176]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1iWI-0006GO-IY for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 21:22:02 +0000 Received: by mail-ob0-f176.google.com with SMTP id vb8so5618607obc.7 for ; Thu, 18 Dec 2014 13:21:57 -0800 (PST) X-Received: by 10.60.57.10 with SMTP id e10mr2642402oeq.45.1418937716962; Thu, 18 Dec 2014 13:21:56 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id n8sm3752292obz.9.2014.12.18.13.21.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 13:21:56 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 18 Dec 2014 15:21:49 -0600 Message-Id: <1418937709-29434-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Topics: patch Subject: [lng-odp] [PATCHv2 2/2] linux-generic: packets enable segmented packet support X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Bill Fischofer --- v2 makes requests for packet pools of buf_size > ODP_CONFIG_PACKET_BUF_LEN_MAX unsegmented platform/linux-generic/odp_buffer_pool.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index 48be24f..9561c07 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -119,8 +119,8 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, if (params == NULL) return ODP_BUFFER_POOL_INVALID; - /* Restriction for v1.0: All buffers are unsegmented */ - const int unsegmented = 1; + /* Restriction for v1.0: All non-packet buffers are unsegmented */ + int unsegmented = 1; /* Restriction for v1.0: No zeroization support */ const int zeroized = 0; @@ -163,6 +163,8 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, case ODP_BUFFER_TYPE_ANY: headroom = ODP_CONFIG_PACKET_HEADROOM; tailroom = ODP_CONFIG_PACKET_TAILROOM; + unsegmented = params->buf_size > ODP_CONFIG_PACKET_BUF_LEN_MAX; + if (unsegmented) blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, @@ -171,6 +173,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, ODP_CONFIG_PACKET_BUF_LEN_MIN); + buf_stride = params->buf_type == ODP_BUFFER_TYPE_PACKET ? sizeof(odp_packet_hdr_stride) : sizeof(odp_any_hdr_stride);