From patchwork Tue Dec 16 19:32:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 42348 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7223825E25 for ; Tue, 16 Dec 2014 19:33:32 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf9053093wgh.1 for ; Tue, 16 Dec 2014 11:33:31 -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=CfHyBr4I7zIKVMkeOPDowy3fgqBkq6I9zIdEMaOYKhc=; b=acjnYwzONW2juKg8MOQAEIpTxmFe3k8JZRRYGCsbzWbgZbcIX8sdYYgfjtEDkOhO3K H+OffBALZ2X/qhAJcVxXGtUitConx/0SmCvH+/UT8DiL5xx5URIYnCh9hs7RZ1dvu6Fp 1CnKFN/wdxzP6EvQHvS+dQnqZ/FdmmJzc8OxnjFDpx/xeSoenHqH7cBpmZWSGzKHIsy5 td6/hHWRPqzP4J7DZvzQzM5MyXjZq31Ex+S6tYErkpJ7CEpPOxQ5HV1bhrqg4JvdJN/R BKrmiU2SI024+nvfIJS2z4rMOnz14F/EFN13qt3sMHXjxlg4voxwK/3cgYMyVhNP7cVb AD4w== X-Gm-Message-State: ALoCoQkEDWNELU1YWdbt9A7EHptx6JrRDpqzWwKws6wNwe4Jw7KfzpSEFA9yo1ZHtlMXS5nWoCT7 X-Received: by 10.180.189.116 with SMTP id gh20mr725648wic.2.1418758411765; Tue, 16 Dec 2014 11:33:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.195 with SMTP id s3ls917119laj.63.gmail; Tue, 16 Dec 2014 11:33:31 -0800 (PST) X-Received: by 10.112.16.129 with SMTP id g1mr32748796lbd.30.1418758411408; Tue, 16 Dec 2014 11:33:31 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id 9si1739383lar.40.2014.12.16.11.33.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 11:33:31 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id b6so11054513lbj.8 for ; Tue, 16 Dec 2014 11:33:31 -0800 (PST) X-Received: by 10.112.135.197 with SMTP id pu5mr37001822lbb.22.1418758411323; Tue, 16 Dec 2014 11:33:31 -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 ru5csp1139526lbb; Tue, 16 Dec 2014 11:33:29 -0800 (PST) X-Received: by 10.140.83.8 with SMTP id i8mr64602657qgd.103.1418758409165; Tue, 16 Dec 2014 11:33:29 -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 m7si2003569qag.36.2014.12.16.11.33.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 11:33:29 -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 1Y0xs5-0001Pz-8X; Tue, 16 Dec 2014 19:33:25 +0000 Received: from mail-oi0-f49.google.com ([209.85.218.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0xro-0001NQ-LH for lng-odp@lists.linaro.org; Tue, 16 Dec 2014 19:33:08 +0000 Received: by mail-oi0-f49.google.com with SMTP id i138so10093168oig.22 for ; Tue, 16 Dec 2014 11:33:03 -0800 (PST) X-Received: by 10.182.58.81 with SMTP id o17mr4728425obq.82.1418758383313; Tue, 16 Dec 2014 11:33:03 -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 u10sm696032oeo.14.2014.12.16.11.33.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 11:33:02 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 16 Dec 2014 13:32:57 -0600 Message-Id: <1418758377-12357-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Topics: patch Subject: [lng-odp] [PATCH] Don't reparse on add/rem data for payload changes 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.177 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 Optimize odp_packet_add/rem_data() by not reparsing unless change is affecting packet headers. --- platform/linux-generic/odp_packet.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 65e6288..ac2708a 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -401,7 +401,8 @@ odp_packet_t odp_packet_add_data(odp_packet_t pkt, uint32_t offset, &new_hdr->buf_hdr.ref_count, odp_atomic_load_u32( &pkt_hdr->buf_hdr.ref_count)); - _odp_packet_parse(newpkt); + if (offset < pkt_hdr->payload_offset) + _odp_packet_parse(newpkt); odp_packet_free(pkt); } } @@ -436,7 +437,8 @@ odp_packet_t odp_packet_rem_data(odp_packet_t pkt, uint32_t offset, &new_hdr->buf_hdr.ref_count, odp_atomic_load_u32( &pkt_hdr->buf_hdr.ref_count)); - _odp_packet_parse(newpkt); + if (offset < pkt_hdr->payload_offset) + _odp_packet_parse(newpkt); odp_packet_free(pkt); } }