From patchwork Wed Nov 8 18:00:36 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: 118324 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5620882qgn; Wed, 8 Nov 2017 10:23:50 -0800 (PST) X-Google-Smtp-Source: ABhQp+QFIr0O93yS+DmqpWNnsSgld2rC9fIvzUaMbedBPrCneFk6LGpeE6QQjjkT6QTNvXeNDSbT X-Received: by 10.200.53.111 with SMTP id z44mr2459577qtb.12.1510165430181; Wed, 08 Nov 2017 10:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510165430; cv=none; d=google.com; s=arc-20160816; b=WF14QHfc0fBxrtf8K46AGW9J6ziLHFZ226tohki999Gh+XhZ4gBNDLztmlITZgMtQB oU8hClIrrJSpYVbQoFnrEzSIxJcCPXFpwORcmbSljEcnC5n9un/+uGy6Q7oQ0w7gnrt3 nKCUBMSCjZIF43CIgJFmlW3gCKGv8iheWjSvGMGuo00hYOz5ktH7w5vWvcDlnZVbp2Mg HcFqys0Q5C5xVokcjdjn03jubQaZS2eaAlr5sLUEk81ZMcBRubw4BC+gmG0rAL+6sGR9 nrOLIw8ZKXANj7lnYx3hQ0kkST9IFbJj1r4h1fTYCUqv7FInjwqrBukh/+tWCVrIghCv MI0g== 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=sRs7k+FYVcWruYt/ain5sTkNlMMCWCx9Yx0R3U37h/c=; b=Ocja13RYSl54Ek6Bpv6deEbBA4XUl3jjB4rLJ4PnRGfj69p3mpqL7+ASylm1qvCLwu +Fzmk2cfdPOW+ne7eM4KuTsc1yCLHw7Jp9z8iF+b2mdNC6hx3n6Lsq8IPSa04gwJguw6 sCYvC8BOlMnCpxKEQlVVN7IojmkwbDtq7nuSyZ5yCyh7mm/j/ST7EI8P+ovYeW6h5lmF uT2bDdZxK0NhmyJTVcmyqUFekB5riTsofjsZfaBRXNsSTtKu/sriSDqDhd0CeDE2Y0jF WSmXXH/sSaaGC5FQrk6d1PSEXph9VFv6v69DAg7mHcQVlrTwT0lLHLkTfZO7ByfGByij dj+w== 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 a22si497335qth.432.2017.11.08.10.23.49; Wed, 08 Nov 2017 10:23:50 -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 C5C6660C2F; Wed, 8 Nov 2017 18:23:49 +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 5A0BA61057; Wed, 8 Nov 2017 18:04:04 +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 E346F61055; Wed, 8 Nov 2017 18:03:54 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 8488C60C9F for ; Wed, 8 Nov 2017 18:00:46 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 2CB6A4442D0C for ; Wed, 8 Nov 2017 21:00:45 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kkIddLoMEq-0jc4DfOe; Wed, 08 Nov 2017 21:00:45 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TTdbkiNdyn-0i18V52i; Wed, 08 Nov 2017 21:00:44 +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: Wed, 8 Nov 2017 21:00:36 +0300 Message-Id: <1510164037-14458-16-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510164037-14458-1-git-send-email-odpbot@yandex.ru> References: <1510164037-14458-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v7 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: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: b87a669d1d701c336b19a9dd4f07b920a87132ed **/ 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 */