From patchwork Fri Nov 3 12:00:15 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: 117894 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3237660edm; Fri, 3 Nov 2017 05:12:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SJO8dNq7935ZjkimsNwXgPP72N/TcdqCiV9BbwCUFZg2IyVXm5BM32JvbYp20rPy3Ga25w X-Received: by 10.55.52.148 with SMTP id b142mr9389637qka.116.1509711158896; Fri, 03 Nov 2017 05:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509711158; cv=none; d=google.com; s=arc-20160816; b=DC5U+HcwJVFWTlfDR8/WlTQejFxCp/xUAboqDLV7NayQNRE1xmUVSsZtJ+kLjlOa7N Cd6CYN5ClOjjGwNzA2hPMS1k1XncbtEyIZ+mRVh9f2T3zVfoepboYFktnGJGyJM6PwdZ hHO9fJCPsq8FWQSbhYZDYIOxxFMr2cGOrZ6oqoEK+nINhsf9sCdeC1rJHIfl1fTHlfeS A/N2jtqM4a9OTpGUbS37SnU4E1dBdC/P3Bmaa2KBZSMLrZcWfteLLShj3XSXNTIEhm08 gf37C1lg5vGqYDQb0ubdLYZLHmrela9e+OZtskcsVloC5q9I9zhIUZEYHKGny/ZUJRnG dzPg== 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=QQedn8UTJyDhIcuLL4/c7BZ0B9330lywXqGnwj3nVLI=; b=07hbysodMh9yp0pn8Q5vhcAVTTL3S6XpK/1lqmx6SF3KU602hD5adTFDzmjPIJgflw A8U4eqbRpR6FIh+YwHZVDmWy5A/GbAaEuLzKt4mpssVxkq/UpmucwkiCN4MbhKQEBCgg E44C3qRzD/gkOyrsVWMOPr3ZgE8e7O45fEC9VLNLrn1Io8j5QwVOQJlbJ0tJ89nOlPHq ZQZ5hIrLbl2MklcOnERt4uO56upYd/9sYviFl5Qd0cDscvCzBFszNtgEkrlhaHWSthKC xoqXUTKf8HG3qdcvPf2n1WeS3kKMNDL16DaL8LPociAJacsfP+EEIAcDd7iSZ8kS/U2O PKLg== 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 i8si3140714qke.299.2017.11.03.05.12.38; Fri, 03 Nov 2017 05:12:38 -0700 (PDT) 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 7CDD061008; Fri, 3 Nov 2017 12:12: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 5285C6156E; Fri, 3 Nov 2017 12:03:05 +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 665CC6162D; Fri, 3 Nov 2017 12:02:52 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 5E89761056 for ; Fri, 3 Nov 2017 12:00:35 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 079645602C44 for ; Fri, 3 Nov 2017 15:00:34 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ThQhJWZJqK-0Xv0280H; Fri, 03 Nov 2017 15:00:33 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 26Ifsfv15U-0XDe7DEx; Fri, 03 Nov 2017 15:00:33 +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: Fri, 3 Nov 2017 15:00:15 +0300 Message-Id: <1509710415-8980-16-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509710415-8980-1-git-send-email-odpbot@yandex.ru> References: <1509710415-8980-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v6 15/15] 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: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: c7cf7a3e9184b27986b3ddb459d86081b1fca033 **/ 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 */