From patchwork Mon Aug 20 11:00:07 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: 144602 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3829695ljj; Mon, 20 Aug 2018 04:05:15 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzQOsgnYQYlp4XESU3NG/i3VfWdrOwyWLl/TIkqLILWDo75eOPQAU6W9Q3MzYojeTw2s/UH X-Received: by 2002:a37:3891:: with SMTP id f139-v6mr41775318qka.177.1534763115815; Mon, 20 Aug 2018 04:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534763115; cv=none; d=google.com; s=arc-20160816; b=bucizQGiQKzptzb8DBEo2d751rV9jsFBqeAXmAKuJ5ILyB6c87Vm8OVjHqH4bQEnzZ ZLz9yweVZ17F1umoNegCo1we2nbPwrD71VqfRnWuUKIGHyOo0Gm629B95FNkiu1LnpUj KMJ/5oU1ySMIcKSjiQTSW8C9Rp8ydF6lazprplahrGYhH+0rhmcN79Oj//UMwmoinsVQ Lz+r2GYtQE8zTYxaXC2P2WWyp9gfvOMXskK/rApKbAABqC9sTrpNLLfsG7snI5hPoaIx mCTwX9i0iXtHXQhc1tbS3mWeUGqTAmrtrVwrjmuJ7/E5nZr+33fdHtvtl6VmP/Mb1qin g+TQ== 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=GSMJBriITdH/DR5Z3EN/U8GTN+unVKHvjxprNLsdh98=; b=UohV9DiQZijliw0qFxaLv/0F24srMOqFiEvmH4wF7reOr/bgUIwpXg2+C1Eo21lzf0 nwHz3ldp/OQoMf7QZcabFUmvQztHWwSXC+ybxtIW7B0qlWgjqU0RyamBhFExjgtwqkZw 9rde03LkPBwo2GYjl34IB9ncEsgXkF4d4zhT2HrBJFIbCT9uwOEq3r5GQV5DCkbAUuPa t8yf6Mg3HR9Ygi1X7XkUyyoplLT+JaY6ACN1Gk6PxBvmoiSEAXJmr7YGjwzCSAB0mXDM tO/x+K8Q9uEmhd+d+2amLZnLx8RWcKHjzthV0yHivca38jSU1UXG1GJOlkzcQpiJTANG fZqA== 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 h4-v6si9353030qva.66.2018.08.20.04.05.15; Mon, 20 Aug 2018 04:05:15 -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 6D01A608AC; Mon, 20 Aug 2018 11:05:15 +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 16D3B6860C; Mon, 20 Aug 2018 11: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 9BDF06860C; Mon, 20 Aug 2018 11:01:29 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id AE3A46860C for ; Mon, 20 Aug 2018 11:00:24 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 4B85E5D821BF for ; Mon, 20 Aug 2018 14:00:23 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4I9K4k6hzO-0HlWmXkH; Mon, 20 Aug 2018 14:00:17 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id x8w3cLDY5J-0GtKmJGO; Mon, 20 Aug 2018 14:00:16 +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, 20 Aug 2018 11:00:07 +0000 Message-Id: <1534762808-15588-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> References: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v3 10/11] 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: dc28824415ea510e3ef62e47f7640bf4a8420fde ** Merge commit sha: b482f9618a6edb2a2f2491ee5a7af757eab93b24 **/ 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 5b739cc1a..6ad7d5dd7 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1305,7 +1305,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; @@ -1324,6 +1325,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); @@ -1332,6 +1339,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,