From patchwork Thu Aug 16 10: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: 144344 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1872879ljj; Thu, 16 Aug 2018 03:05:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxd+CyWjJ2auIe0Ju0nyFRVSzCH9Gqo7k6W4Tq8s1nxHWSxfcuvGsna2jOXUs/ZvVH0+xw6 X-Received: by 2002:ac8:3525:: with SMTP id y34-v6mr27516845qtb.241.1534413949064; Thu, 16 Aug 2018 03:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534413949; cv=none; d=google.com; s=arc-20160816; b=IcWRWRBITBZ3t/7pj727GXs6k0BSmXEsXTzCsYySBlNi+ZRfm1rFMGZcQwcKAlpIKV 3S4UQWfARJT7lCXX6Q3Z8Ukk3LVKB2vQA9bYC8++jAVDJZBebdmvSGISvXIeeqR/wxP9 V4UW6O8Fa7WTZTD4zNYQc7gOK11cgGSFuZnomgU1XgICmsjB8ayZ3DH6TEBfOdwoUdsq 0g+5XghLJBFpvKfhxysEKf2vqLtWFXAC9aaqyBkmLkyWR1cNbalc0YhzL58dChhaJuBB 08IZBukRWEuiIy3+kVsyOYQYlYcsqAfveCbZKpDQQGVyIvroj7O7JiOQKVPyKyigox25 wifg== 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=+GcuR6IIRtBC5Hnj9HX5Wrfs3YylukHywdjdHv2U5sM=; b=OHraLe+e6PNy5QROy+wl7uTef05QugZ4wz5OTA0D5ez2MlIJcxeaW/wmgaV6JQhKxW 9Hk5f92QNIlccJRyL3iqyIGSgKHHtHB4MDsY0z0ILUiVm1zA0UYYHMo6Bs//cQf3djQv PllFXTqO9r9ixBJ7+HOlt6pCiM+8rHvNygXbXdVoK82PBwmJvAfjTKEHAPRMxz3YBqFQ 00+BKBG0Vmj95uWcXuWebi+P69DWXjA6pjGBULpk0lACM28hT8AG2UtlxiaCbyGuzw/e QwegDBlCz6+ENz8Q34lmaA3ARzijBNcY8tbDczA5H79mHtBVlVTJ6O7anP/A01KT7Cyj C3fA== 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 l16-v6si446997qta.53.2018.08.16.03.05.48; Thu, 16 Aug 2018 03:05:49 -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 BAF6A6862E; Thu, 16 Aug 2018 10:05:48 +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 D47CB6861A; Thu, 16 Aug 2018 10:02:11 +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 06DC468624; Thu, 16 Aug 2018 10:02:01 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id CE4996862E for ; Thu, 16 Aug 2018 10:00:29 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 699A61343DA4 for ; Thu, 16 Aug 2018 13:00:28 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5CrKokRgVL-0SVmbhBB; Thu, 16 Aug 2018 13:00:28 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LpjbZWHmdB-0RrSrqhN; Thu, 16 Aug 2018 13:00:27 +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: Thu, 16 Aug 2018 10:00:06 +0000 Message-Id: <1534413607-8630-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534413607-8630-1-git-send-email-odpbot@yandex.ru> References: <1534413607-8630-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v2 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: 44d3d4f3c02fc6f3ee9811bc4dc5f01561e519a4 **/ 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,