From patchwork Wed Dec 17 23:16:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 42401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 072EF26C76 for ; Wed, 17 Dec 2014 23:16:58 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf153807wiv.5 for ; Wed, 17 Dec 2014 15:16:57 -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:in-reply-to :references: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=3fbBVEJFRP7bJP8/O2XJKDOlip2vXyNuv5dOg3PK08I=; b=chUfxrQrw50k3d2rhzs6it3eMaLDtQl0zT5q/xUe59L7ZjFGo6i5bNRTtZH4J6d/l8 nAXlXDZcS0xZsd25YtY1HCl3hsVeAm2ccT915Y7s2wMyZg9wpQVZESfs2uv8eM3UNEca IUDT3/TjXAJ+a6FbvNeTjeKzSYN3ju9Q1DZW8piD+jqR+kaY2TxFzQYK2T62Hdlg1CFP RsiMYFpRJaz4loHVZ0jjf0aDJGOn2NiMj9iC6tapS7zolrd/wfpmbftzkXJD1xsM2l+H +fTT4QOenZsEcLw0JwN8IyjqErmbl2Om4t8k9e0fj74Gd7e1W7+0zKEcheRtx+wfZAtX bGOg== X-Gm-Message-State: ALoCoQmxEyXPPV4Ut5HLVMKTDEkXfKNY0AUZ+UqWVDG7iX1YbqtaUGf1wwxXzIsqvKMkkmHOGCW5 X-Received: by 10.180.89.211 with SMTP id bq19mr1712953wib.4.1418858217276; Wed, 17 Dec 2014 15:16:57 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.34 with SMTP id cr2ls1093107lad.30.gmail; Wed, 17 Dec 2014 15:16:57 -0800 (PST) X-Received: by 10.112.41.168 with SMTP id g8mr43231415lbl.59.1418858217088; Wed, 17 Dec 2014 15:16:57 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id l2si5210014lbc.48.2014.12.17.15.16.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 15:16:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so68372lab.4 for ; Wed, 17 Dec 2014 15:16:57 -0800 (PST) X-Received: by 10.112.141.42 with SMTP id rl10mr43416107lbb.98.1418858216996; Wed, 17 Dec 2014 15:16:56 -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 ru5csp1521426lbb; Wed, 17 Dec 2014 15:16:56 -0800 (PST) X-Received: by 10.140.104.169 with SMTP id a38mr76696383qgf.35.1418858214700; Wed, 17 Dec 2014 15:16:54 -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 z20si6345963qax.23.2014.12.17.15.16.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Dec 2014 15:16:54 -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 1Y1Npr-0003UJ-Ja; Wed, 17 Dec 2014 23:16:51 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1Npg-0003OS-SP for lng-odp@lists.linaro.org; Wed, 17 Dec 2014 23:16:40 +0000 Received: by mail-ob0-f177.google.com with SMTP id va2so6700094obc.8 for ; Wed, 17 Dec 2014 15:16:35 -0800 (PST) X-Received: by 10.202.68.10 with SMTP id r10mr6576330oia.49.1418858195580; Wed, 17 Dec 2014 15:16:35 -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 v73sm2394860oie.19.2014.12.17.15.16.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 15:16:35 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 17 Dec 2014 17:16:26 -0600 Message-Id: <1418858186-25251-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418858186-25251-1-git-send-email-bill.fischofer@linaro.org> References: <1418858186-25251-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.215.45 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 Enable segmentation in packet buffer pools by default Signed-off-by: Bill Fischofer Reviewed-by: Taras Kondratiuk --- platform/linux-generic/odp_buffer_pool.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index 48be24f..6b0e34b 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,14 +163,18 @@ 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; - if (unsegmented) + unsegmented = 0; /* Packets are segmented by default */ + if (unsegmented) { blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, buf_align); - else + } else { blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, ODP_CONFIG_PACKET_BUF_LEN_MIN); + if (blk_size > ODP_CONFIG_PACKET_BUF_LEN_MAX) + return ODP_BUFFER_POOL_INVALID; + } buf_stride = params->buf_type == ODP_BUFFER_TYPE_PACKET ? sizeof(odp_packet_hdr_stride) : sizeof(odp_any_hdr_stride);