From patchwork Mon Nov 13 14:00:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 118779 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1852661qgn; Mon, 13 Nov 2017 06:21:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMb6cjn2LIhUMqG+REtNrrhvYM7Sx8l8T2pk6g5QM6/lINGmLJ2i9/ax3LQCa2naGaVx076Z X-Received: by 10.200.4.37 with SMTP id v37mr14215228qtg.313.1510582894883; Mon, 13 Nov 2017 06:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510582894; cv=none; d=google.com; s=arc-20160816; b=vJVfGzFJP2pKC0Zv6ZBTzP8bMJJ/ABcG4AmAjY1hdAWXt5ixu6og29juyJ0ZThgj/2 Qi3Iv5La6CVdJsYUazPUswpZGI66YTGknyye3VEGZhhEEqAqhSj4igDFq8oicn8LH/kZ UAF+MlqUyKWgTd1Bod7Z/KYKA8D6O3W1hplYmDk44gc4+ebIzKHyM3pKho9B6Bq6F8Hc 8Vt4mRnfy9n222rmkQ7inUCj9cZCO4lUu639HY/bQwmgeRxpFqjqy3Fq/AiKK8VzEl7z 3orydis1f7r+aG5E0tYe+kFHkAoqChQxuZeT/tq6MqxtPh4rwE+VsAIyhfwoG5NBtYQP WHTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=AkOZvbmaogyf+zXxBYq09xpzSU7gXZH+778posPn0Eo=; b=mzcsGfpIdcx0arS1Kn0MAQ7T9acKFabxXIsPmXsFM8SioJE4DaWNp8xy+gD7xSalNn ikism1Q9KjgVoYYT9R2Ba3x2jZ7HoEvS5oxf0zYi/gu+MI8/0739lCyrzJD7a02BiGNZ nFvjuzcCyAK4p4wy6Ac1nJzK/oNwjtTXpugd2MWCoYpiWoTDBoSP/qY389kqJMCd0Wkx Yu6CJGPK9Ckd+breMqg8MiPQmyKWvzg2LZaH2Q+BL/kWCtk/Ns5/HbZjm/m7d+wZjeTj Nqo+b9lXt25glIc2lNfqo+zFEp6UcWhMiUVA7RCyNG+huBU9FfZF/y45yScPMlUZtwVU 1EIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id o11si2832852qto.480.2017.11.13.06.21.34; Mon, 13 Nov 2017 06:21:34 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 91EC760C61; Mon, 13 Nov 2017 14:21:34 +0000 (UTC) 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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 115DD6162F; Mon, 13 Nov 2017 14:03:43 +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 76D4761020; Mon, 13 Nov 2017 14:03:29 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id C6D276100E for ; Mon, 13 Nov 2017 14:00:44 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 575474442D57 for ; Mon, 13 Nov 2017 17:00:43 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Z4M3C42xFt-0hmaT8MG; Mon, 13 Nov 2017 17:00:43 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 955rfAmciQ-0bkKJDlE; Mon, 13 Nov 2017 17:00:37 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 13 Nov 2017 17:00:27 +0300 Message-Id: <1510581630-13993-14-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510581630-13993-1-git-send-email-odpbot@yandex.ru> References: <1510581630-13993-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v16 13/16] linux-gen: ipsec: correct frag_offset for tunneled packets 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Generated outer header should have frag_offset = 0, MF = 0. Change code accordingly. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 243 (lumag:ipsec-packet-impl-3) ** https://github.com/Linaro/odp/pull/243 ** Patch: https://github.com/Linaro/odp/pull/243.patch ** Base sha: a908a4dead95321e84d6a8a23de060051dcd8969 ** Merge commit sha: 845914564f2d99792452ac22a524279f44496a1d **/ platform/linux-generic/odp_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index aadc671f9..4c032b9c0 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -663,10 +663,10 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, out_ip.id = odp_atomic_fetch_add_u32(&ipsec_sa->out.tun_hdr_id, 1); if (ipsec_sa->copy_df) - out_ip.frag_offset = ip->frag_offset; + out_ip.frag_offset = ip->frag_offset & 0x4000; else - out_ip.frag_offset = (ip->frag_offset & ~0x4000) | - (ipsec_sa->out.tun_df << 14); + out_ip.frag_offset = + ((uint16_t)ipsec_sa->out.tun_df) << 14; out_ip.ttl = ipsec_sa->out.tun_ttl; out_ip.proto = _ODP_IPV4; /* Will be filled later by packet checksum update */