From patchwork Sun Nov 12 00:00:14 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: 118634 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp257922qgn; Sat, 11 Nov 2017 16:11:39 -0800 (PST) X-Google-Smtp-Source: AGs4zMbmuPULgMBuuF80oxxiqrXu09c8zeWXKEoIyx5M5ZbYlxUsDdFX+V7ppddGTeXl1qXOE2Ou X-Received: by 10.36.90.81 with SMTP id v78mr5828650ita.114.1510445499293; Sat, 11 Nov 2017 16:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510445499; cv=none; d=google.com; s=arc-20160816; b=iUwS7eAVdPS8QGqZ9ERogQva+mf/+Z+swlOujNSQbTvmfxChUf4GvL4kB5jdNB0B6B 01UmVxeFSNEkjm/oqYHDNZ0nGMl1qHa7iQ3hG6NHUjXsqKdhU8x+FaNRhOlTQLuMIh1b ZFffVGCbpxjNE25OIxbtn3P7GnDPDmwCXXIYtPZo4yXn8eGXxrSGAp+RM7c2PaIiGC6a 54yHJn9t3FokYoVpAQnmmYo2VSofnM6g/OHbZbT7WK/M7y/VxfKbKzwneyRFWhqsH8sN izzoKpN08Q/bPgpEPIbWcEFK9zP0T5ukoPMQWSIZQUBcR1yO5FEhpFCOqXxqRJo4z6Td +Yfg== 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=j34cnlkurnvqLDmJJlNGGvKUJSn2Abq1TbxzZ71/bGM=; b=TRkkj/P4nHaJYV9qRXaR3ZP3az55emirO4+dbyy0AcZ/wqd09YvGkvQ+W9v2QuFIhO W4fPFLOqGEL1oiMoo1WukRWX1Y1PTFlrlsAS0exKGh7rq1ipbl8eKhwasOg02FxWG3sO sLeXHSNkGPyyQfAn0aqOpU1y8NS5oDQY08qSBCH8mv6ZI3vwMoGtTr2rSESSu6jG2WGR Xg9zi78lf0Tmcx8Flx/VKR73XwsaNg0LU5W2qfntgIqJLthpQM72RaJ7kvzeQcBOBWZi IqUkJ6ko14RFSGOImF0pn/9Dn8MmYfMiFbRe4BGzHfd38R/yTH5QQRG7IJTvMSqTozxx BiHg== 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 p125si4146865itb.70.2017.11.11.16.11.38; Sat, 11 Nov 2017 16:11:39 -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 CD12C60999; Sun, 12 Nov 2017 00:11:38 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 EF9BD60BE0; Sun, 12 Nov 2017 00:01:34 +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 6CC0560804; Sun, 12 Nov 2017 00:01:18 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 72F4E609C2 for ; Sun, 12 Nov 2017 00:00:26 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward103j.mail.yandex.net (Yandex) with ESMTP id E08B734C3A59 for ; Sun, 12 Nov 2017 03:00:24 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id G1YS2a067S-0ONKwcFg; Sun, 12 Nov 2017 03:00:24 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id VxCtJulSk2-0OWSLxX6; Sun, 12 Nov 2017 03:00:24 +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: Sun, 12 Nov 2017 03:00:14 +0300 Message-Id: <1510444815-25058-16-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510444815-25058-1-git-send-email-odpbot@yandex.ru> References: <1510444815-25058-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v8 15/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: 9ff682c8d0315f3f1921d5b9fe13d62897c78710 ** Merge commit sha: 38c770f1444aeb3ede5313b7304a1161277ae0b5 **/ 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 e6fb276a6..107b54917 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -677,10 +677,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 */