From patchwork Tue Aug 21 17:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 144757 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5520534ljj; Tue, 21 Aug 2018 10:05:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw3+kuGIYBCSLsIhglAcEgLbkSkRHQUjmErFsUQlWLh7jWWHeGGhxc6tyO9RtbN+FOWmFE9 X-Received: by 2002:a37:7946:: with SMTP id u67-v6mr45184651qkc.283.1534871122773; Tue, 21 Aug 2018 10:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871122; cv=none; d=google.com; s=arc-20160816; b=rSeNM9/7hMI0wGKwIBDqBNlu/DjmRREaqjJUuwXzDNE1BETvj1nv8mOW+FFwlwvdw0 +cc9s+w0HZEOmE7YURKWNUDWsvEo81jHpPNHJrPrPo9wuflHkqNUKRbK7vzHKtJeup9S EytYVeEc4S08JJe1XYtRssXuSIUEzzIsNeZi/tEpIC5imwy776edz2+KMfd9fW0StZnq bRcFWAjmGgP204ubDuSUDqk1tuDs9hMQ49L/PhY/tLlEnP6v1Ktvl1ehWP5rJOdDuOU7 ZFC+v2mglvEJ90bhpIXYmIbmXkAtSJh7ClLzBbptTI1BfNKA9mXzb/V4t+C+SQ4hZKJQ m6OQ== 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=zFXswguYLBSH6QiO3iYRrk1GxMbac9K6/SnTp64MKoU=; b=fZAVrcXtm9IgRgD1UHOnbfQsYPEvdisbOdEOL4leqhEqGqt7gdf3/KVIc4+xOW2D/B AVvNxMNNqtvWxrUP022WC5ui4OrYajokebfNoHXGmIEh2YN7ZQ5XcJc0qlas8JyusNzG IflSSDJ0bevNdi4qXw/yPPenBk7ElmxPIE0Kt/N9EvI0H/eljMAslmXJxB/N/tjrfNGD Wp+VkMbJkbhtK+Mfl9TdlBAuwFTUVBTKrLKa8IaKnh99mCK/MSQIJ3gcLD9908LunbEd oq5WxLCvYgqPqtecl6XtIDrqxCPeIS33FzPjvJIOdo3IMMuHbQQVYs+hYncXz8co0p6y njjw== 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 r38-v6si1374880qta.244.2018.08.21.10.05.22; Tue, 21 Aug 2018 10:05:22 -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 4656F6104F; Tue, 21 Aug 2018 17:05:22 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 ED445608B7; Tue, 21 Aug 2018 17:02:26 +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 CBB9261706; Tue, 21 Aug 2018 17:02:23 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id A9DB5685E3 for ; Tue, 21 Aug 2018 17:00:39 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 3D5A251038A7 for ; Tue, 21 Aug 2018 20:00:38 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZlsYadcPM4-0coqVcZT; Tue, 21 Aug 2018 20:00:38 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PfJmBMqdLe-0bVOAx5b; Tue, 21 Aug 2018 20: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: Tue, 21 Aug 2018 17:00:06 +0000 Message-Id: <1534870807-18456-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> References: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v6 11/12] linux-gen: ipsec: insert checksum into SCTP packets if required 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 Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 674 (lumag:sctp-checksum) ** https://github.com/Linaro/odp/pull/674 ** Patch: https://github.com/Linaro/odp/pull/674.patch ** Base sha: f6c423a7d29e2c7d6d890cbc098a398d0d7e1288 ** Merge commit sha: d4f772b36da26684194cb0452a01b8da1ba7e3e1 **/ platform/linux-generic/odp_ipsec.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index d10100f53..1bc549c22 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1306,7 +1306,8 @@ static void ipsec_out_ah_post(ipsec_state_t *state, odp_packet_t pkt) static void ipsec_out_checksums(odp_packet_t pkt, ipsec_state_t *state) { - odp_bool_t ipv4_chksum_pkt, udp_chksum_pkt, tcp_chksum_pkt; + odp_bool_t ipv4_chksum_pkt, udp_chksum_pkt, tcp_chksum_pkt, + sctp_chksum_pkt; odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); odp_ipsec_outbound_config_t outbound = ipsec_config.outbound; @@ -1325,6 +1326,12 @@ static void ipsec_out_checksums(odp_packet_t pkt, pkt_hdr->p.flags.l4_chksum_set, pkt_hdr->p.flags.l4_chksum); + sctp_chksum_pkt = OL_TX_CHKSUM_PKT(outbound.chksum.inner_sctp, + state->ip_next_hdr == + _ODP_IPPROTO_SCTP, + pkt_hdr->p.flags.l4_chksum_set, + pkt_hdr->p.flags.l4_chksum); + if (ipv4_chksum_pkt) _odp_packet_ipv4_chksum_insert(pkt); @@ -1333,6 +1340,9 @@ static void ipsec_out_checksums(odp_packet_t pkt, if (udp_chksum_pkt) _odp_packet_udp_chksum_insert(pkt); + + if (sctp_chksum_pkt) + _odp_packet_sctp_chksum_insert(pkt); } static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt,