From patchwork Wed Jan 6 11:33:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 59236 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6523406lbb; Wed, 6 Jan 2016 03:34:41 -0800 (PST) X-Received: by 10.140.81.112 with SMTP id e103mr124612295qgd.99.1452080081614; Wed, 06 Jan 2016 03:34:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a198si90274245qkb.68.2016.01.06.03.34.41; Wed, 06 Jan 2016 03:34:41 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2A3F5618D7; Wed, 6 Jan 2016 11:34:41 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=HRWSVNsa; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 219C1617DB; Wed, 6 Jan 2016 11:34:14 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CBAF9615E3; Wed, 6 Jan 2016 11:34:11 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by lists.linaro.org (Postfix) with ESMTPS id D7C47615E3 for ; Wed, 6 Jan 2016 11:34:10 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id l65so55938320wmf.1 for ; Wed, 06 Jan 2016 03:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=UINMbckBWFnkFyI18EGc/2D6cJ3QgcMN9+wU9lSNP7I=; b=HRWSVNsazdt9YQm00uNbRXsBu51WwPAnN/Cd1Jl8xak4WiYEJcG54BsrB51QfYQMud uTVyQTyPuRwlkQq86PVPS15N4amWjvYZWFxZ1E6ioQwGnew97Sscf/Gy1cqeDvBR2lYS 8wghbgsc1FU7VQS8IxHwlwPDW2vx/sUI7kszs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=UINMbckBWFnkFyI18EGc/2D6cJ3QgcMN9+wU9lSNP7I=; b=NtOiFYMRfyq2fijn7QC4L5/4IImodf+Ldimo+J+q2n/Ise7r44SZwY9Wvv7HlhN3cZ LKto92D2XOc0BZ5NXDt6AcHLe4nScgzC7ldBd1rWqBFBUMPasTNVm/PNJcxptEO4YkUh rAdu6WdDb0rumWZJTYiJvCDBrxOH/v/GcCOfFpPOj8kIx9KYo5BYdPk7vI9biQt0cbAw 3gAkrw0qfSPCHaPltIkE8z7sTdQ/xYhKn8XDFcqBEj90izrKnOVn1FCSx7OmsPGKhBop 088DhlkTGRqHttkumu+OU02e09gH5OzmeIAG08ukduIx/ZUo09WQG1dCUgbSQ64J/Yyb mo3A== X-Gm-Message-State: ALoCoQmykPNDnJqMs500WqHs5w7oS1BH6e6VYOKbKrAmTNbRJbi57uv2vhXcXzlk0mTK54hUp+SiLmmukqKkZtIXVfpo0je02Q== X-Received: by 10.194.204.232 with SMTP id lb8mr128123124wjc.112.1452080050077; Wed, 06 Jan 2016 03:34:10 -0800 (PST) Received: from e106441.emea.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id a126sm8261873wmh.0.2016.01.06.03.34.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jan 2016 03:34:09 -0800 (PST) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Wed, 6 Jan 2016 11:33:39 +0000 Message-Id: <1452080019-25124-2-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1452080019-25124-1-git-send-email-stuart.haslam@linaro.org> References: <1452080019-25124-1-git-send-email-stuart.haslam@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] example: ipsec: initialise packet length and tailroom correctly X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" The example scripts run_esp_out, run_ah_out and run_both_out are failing due to test packet meta data being initialised incorrectly. Signed-off-by: Stuart Haslam --- This is a minimal change to fix the bug, but I'm not convinced the way packets are created here is valid. It calls odp_packet_alloc() with a length of 0, then starts writing directly to the odp_packet_data() pointer. This works with linux-generic because allocating a packet of length 0 gets a packet with the data length initialised to the length specified in odp_pool_create(), but this behaviour isn't defined. example/ipsec/odp_ipsec_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index f750e18..4d908e4 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -356,7 +356,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, } /* Correct set packet length offsets */ - odp_packet_push_tail(pkt, data - base); + odp_packet_pull_tail(pkt, odp_packet_len(pkt) - (data - base)); odp_packet_l2_offset_set(pkt, (uint8_t *)eth - base); odp_packet_l3_offset_set(pkt, (uint8_t *)ip - base); odp_packet_l4_offset_set(pkt, ((uint8_t *)ip - base) + sizeof(*ip));