From patchwork Wed Dec 17 11:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 42375 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1725226C76 for ; Wed, 17 Dec 2014 11:16:00 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf9930771lab.4 for ; Wed, 17 Dec 2014 03:15:59 -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=2MZ6PEkxWXFVgNv0BYCsIW102xCfdRnGrHchgpiQXz8=; b=Qf2bLWPkV/ugVESWjB7CBO5la0zwA4yrDOPEQkKaaAdSD3edib6hAU5WbOxZWQR9tc CuDmwZIwXY+oYP7/GS3EoXibFGgWZ1NYgJwGZKH7pZO8aNyHh7SCOBGHscvp6NYL+ViR +lTR7QJX47k1B5pLqz+n8Ma5bj3P6SANKi87MGo44l6Gj9rBWG5nCULYFbakCW4/blzF q6RQp+i27gqliIUcTFHVrsG1UJj005Gq5Uv3ad+odxo7zlZyrOjsT3icE8jknoFYP3By EE6qbalMylvp/yzluR6WcVTT32GLXPuwgrcjemRK3hqrqbNdDOctsqx7yRdYFIBMAvSh HFGg== X-Gm-Message-State: ALoCoQmDSOpLRKazCP1r3J7o793Cms+8+vvbCkNmmdnvHX6rDCUntM49w8IvbG87IhfhkF/6Bk9p X-Received: by 10.112.169.101 with SMTP id ad5mr6353420lbc.1.1418814959069; Wed, 17 Dec 2014 03:15:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.41 with SMTP id k9ls466798lae.104.gmail; Wed, 17 Dec 2014 03:15:58 -0800 (PST) X-Received: by 10.112.164.240 with SMTP id yt16mr23635267lbb.34.1418814958830; Wed, 17 Dec 2014 03:15:58 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id v7si3469788lag.130.2014.12.17.03.15.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 03:15:58 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so12482271lab.8 for ; Wed, 17 Dec 2014 03:15:58 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr40697770laz.71.1418814958498; Wed, 17 Dec 2014 03:15:58 -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 ru5csp1327060lbb; Wed, 17 Dec 2014 03:15:57 -0800 (PST) X-Received: by 10.224.30.74 with SMTP id t10mr11504009qac.8.1418814957063; Wed, 17 Dec 2014 03:15:57 -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 c5si4125979qag.117.2014.12.17.03.15.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Dec 2014 03:15:57 -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 1Y1Ca7-0000WT-Ox; Wed, 17 Dec 2014 11:15:51 +0000 Received: from mail-qa0-f46.google.com ([209.85.216.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1Ca1-0000WO-77 for lng-odp@lists.linaro.org; Wed, 17 Dec 2014 11:15:45 +0000 Received: by mail-qa0-f46.google.com with SMTP id n8so10851953qaq.5 for ; Wed, 17 Dec 2014 03:15:40 -0800 (PST) X-Received: by 10.224.93.6 with SMTP id t6mr74202955qam.93.1418814940048; Wed, 17 Dec 2014 03:15:40 -0800 (PST) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id t67sm3565199qgt.11.2014.12.17.03.15.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 03:15:38 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 17 Dec 2014 13:14:56 +0200 Message-Id: <1418814896-18189-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] linux-generic: packet: Remove packet l2/l3/l4 offset adjustments 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: petri.savolainen@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.49 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 Packet head push/pull calls do not automatically adjust metadata offsets, only data pointer and headroom. Signed-off-by: Petri Savolainen --- platform/linux-generic/include/odp_packet_internal.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index a0eff30..18e69b3 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -192,24 +192,16 @@ static inline void *packet_map(odp_packet_hdr_t *pkt_hdr, pkt_hdr->headroom + pkt_hdr->frame_len); } -#define pull_offset(x, len) (x = x < len ? 0 : x - len) - static inline void push_head(odp_packet_hdr_t *pkt_hdr, size_t len) { pkt_hdr->headroom -= len; pkt_hdr->frame_len += len; - pkt_hdr->l2_offset += len; - pkt_hdr->l3_offset += len; - pkt_hdr->l4_offset += len; } static inline void pull_head(odp_packet_hdr_t *pkt_hdr, size_t len) { pkt_hdr->headroom += len; pkt_hdr->frame_len -= len; - pull_offset(pkt_hdr->l2_offset, len); - pull_offset(pkt_hdr->l3_offset, len); - pull_offset(pkt_hdr->l4_offset, len); } static inline void push_tail(odp_packet_hdr_t *pkt_hdr, size_t len)