From patchwork Fri Jan 23 13:41:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 43637 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 A20A5218DB for ; Fri, 23 Jan 2015 13:42:03 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf4241486wgh.1 for ; Fri, 23 Jan 2015 05:42:02 -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=iKIcIai7lO5/IQB/NDAl8uQQIEK7IMZUck4DVfEGHg0=; b=F4XQe26/NDfimI0JkPhZiTKujE+k15ZREjrabtMnDbivHmRQ9B1Z3pyLGO5DCAmLgN cEhWDU0NW113o4kTNv02y0r6ASqepb1iiaXKH60N4hJvWBtsEhJKhGjmveWFgKaFRbTg v7LqsZyWM4lqQD+X9bHeeXSXWs9br2HzfU3b6xFJpZJZDpE5giapRk3jneWLO12NKFXb ckCBTHaSp/bpREAomcyTbTsjPAHBTlx1Z7rxxIiQ8YqOmsg3WnwslFtYoPp6VGXGIIZI ChOkuTskEQcBmopskhDlhpxK3HpZLWEex2Evb10RkmYplr0Wpi+2uf07E01EHvFE8BhM rPGA== X-Gm-Message-State: ALoCoQn+zuR9pTfBIJXAi9SfWxIjMiEA87pNY4PN7S6QLsJir3Xz5+5D02Q07xRePfGV285arVe2 X-Received: by 10.180.87.72 with SMTP id v8mr300288wiz.3.1422020522134; Fri, 23 Jan 2015 05:42:02 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.133 with SMTP id o5ls243146lal.78.gmail; Fri, 23 Jan 2015 05:42:01 -0800 (PST) X-Received: by 10.112.57.226 with SMTP id l2mr7363184lbq.27.1422020521971; Fri, 23 Jan 2015 05:42:01 -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 r3si1440288lbo.9.2015.01.23.05.42.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 05:42:01 -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 gd6so7320664lab.4 for ; Fri, 23 Jan 2015 05:42:01 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr7467668lac.70.1422020521884; Fri, 23 Jan 2015 05:42:01 -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.9.200 with SMTP id c8csp256996lbb; Fri, 23 Jan 2015 05:42:01 -0800 (PST) X-Received: by 10.170.86.5 with SMTP id d5mr2104843yka.86.1422020520377; Fri, 23 Jan 2015 05:42:00 -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 fn7si2019665qcb.27.2015.01.23.05.41.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 05:42:00 -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 1YEeUj-00012H-2Z; Fri, 23 Jan 2015 13:41:53 +0000 Received: from mail-ob0-f178.google.com ([209.85.214.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YEeUe-000127-0x for lng-odp@lists.linaro.org; Fri, 23 Jan 2015 13:41:48 +0000 Received: by mail-ob0-f178.google.com with SMTP id nt9so7115983obb.9 for ; Fri, 23 Jan 2015 05:41:42 -0800 (PST) X-Received: by 10.202.187.10 with SMTP id l10mr4218364oif.86.1422020502682; Fri, 23 Jan 2015 05:41:42 -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 l3sm726340obx.14.2015.01.23.05.41.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jan 2015 05:41:42 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 23 Jan 2015 07:41:35 -0600 Message-Id: <1422020496-4484-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] linux-generic: packets: allow offsets to be set to invalid 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 Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_packet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 257abec..ca1fe63 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -244,7 +244,8 @@ int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - if (offset >= pkt_hdr->frame_len) + if (offset >= pkt_hdr->frame_len && + offset != ODP_PACKET_OFFSET_INVALID) return -1; pkt_hdr->l2_offset = offset; @@ -266,7 +267,8 @@ int odp_packet_l3_offset_set(odp_packet_t pkt, uint32_t offset) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - if (offset >= pkt_hdr->frame_len) + if (offset >= pkt_hdr->frame_len && + offset != ODP_PACKET_OFFSET_INVALID) return -1; pkt_hdr->l3_offset = offset; @@ -288,7 +290,8 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - if (offset >= pkt_hdr->frame_len) + if (offset >= pkt_hdr->frame_len && + offset != ODP_PACKET_OFFSET_INVALID) return -1; pkt_hdr->l4_offset = offset;