From patchwork Tue Aug 21 10:00:05 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: 144705 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5066209ljj; Tue, 21 Aug 2018 03:06:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwrRWO1giFudLtPak9FRFo755Q+OkTep2g5DhiSrnHcDvbJmToa0zIhnxJPR774BakAWADK X-Received: by 2002:a37:6e82:: with SMTP id j124-v6mr46392958qkc.179.1534846002638; Tue, 21 Aug 2018 03:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534846002; cv=none; d=google.com; s=arc-20160816; b=g2Glotbszet4pqhIrcVkxoGib65fBzsOrsz+/U7OVpQtfAY5wxbdFF+1jjGXQ84buF Uzp2mqlBIMBvFWTEESaw4tRl9Ch3P4FAKi3LpYyulrq2ffb9ReRnBOdO9k4ib1eX0hRu Lp2jwCpF8fjNPKFZhkwmEJCi87aokQfkcAeLs8uRJW6j8oBj/7n61cLe/RPvz1QAcZq8 2eUkAFjMvAVRIaWzq9dHWNBWsg+q6bBmQ2+AsDFdlJE2ch0YImwfE3gh/PDNKZMIyFfO pOjLLvRANr7iqbC670yRvI/MMzjIta6VghjKAsaDPSekNZwPIrkBa2bwtFji9G5fEpdt Cmlg== 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=NKkXo+nxNrHa4ghf4B3CGbwy32w/xxHbLr+gA2pbH5U=; b=PtHFIG0bVRAxanEkpnmMWKUDEdslNuyfipzYcBuf0oE3E89XTCETJhrXcPflJD8WP0 Ccb+XJB0vLMi54Ia0+Dv4kkmQ3sD9XCfqk0IuVP54S/e0DTQiSPXpLmUOuVCQhrOs//z DUqdR5I5nzLus+Gi42qWfHtYiTc69Om1WiymNZFDdNR6lu3hes57bo6UE4yhQMjaRbZ2 J5sM8cMX3tqjhdcPxD5vQ9yA38i5ymgylYt0BdOccNFGOZxaYTdxvJeN6UcRZFNJKSGi 9HBPI7oDhN7YMwOb/NUPu02CnLMjZroujVGq3iSaA8pCMcEAzvTcdZf/i8oUuhp2uDkv 3p1A== 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 o4-v6si3259484qkb.21.2018.08.21.03.06.42; Tue, 21 Aug 2018 03:06:42 -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 4EA4668620; Tue, 21 Aug 2018 10:06:42 +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 9F221618F6; Tue, 21 Aug 2018 10:01:59 +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 AB42768618; Tue, 21 Aug 2018 10:01:55 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 7036268621 for ; Tue, 21 Aug 2018 10:00:32 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 6EE9112446AA for ; Tue, 21 Aug 2018 13:00:31 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DbryOfv9Jk-0VJC5Wo5; Tue, 21 Aug 2018 13:00:31 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eJZOyRH8Gd-0UoO20Aq; Tue, 21 Aug 2018 13:00:30 +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 10:00:05 +0000 Message-Id: <1534845606-17334-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> References: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v5 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: 912e026c108d7a496ac7467e953dea77dadaaa57 ** Merge commit sha: 9ab290c4f721a97e8c289b8a7992e6cc6614e7c3 **/ 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,