From patchwork Thu Aug 16 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: 144346 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1873797ljj; Thu, 16 Aug 2018 03:06:38 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxtP1v7kHjFltt+iFaHNO5Bw8sPv+Nn9LixTmAHO3hBEIp+vJHEKsbFWV6vw9s1pIR5oPil X-Received: by 2002:a37:14e7:: with SMTP id 100-v6mr2584936qku.221.1534413998121; Thu, 16 Aug 2018 03:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534413998; cv=none; d=google.com; s=arc-20160816; b=INaeHzkJLAr6QC2U9aIkoumLouCp0NbY2imCttsDkpN2jAP9aIcNap1mbbIEtlLYhy Nd1OOcr2yh0FSVX9lJVIxlPy4BKgPVcuEf3AMmju2MK34Rel2dVacKlCyRarSk8RxkK6 Pj1dhHRc//n1jgf7IzPiTFRvYabu1HV7U5icPCXYM9X4z5rxGsDdxkaWfeTJ9kBWPRPk uh0iO0XTjp2lmgqHIlywxnZUs4X+ONLCNOfD+6sEkkpF2D9dSvw0LOt8ErPXLQMDXixy cqzMPW92F0AOBzFIKX1yvDqgKBzmawavxX5S39HzccCORYHnD8qmWNRsW1XGXeNhQvek Rcqw== 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=+mZ1VcvqOdap/CHX/CREQTDu3d+XZ9lPSvi4ZDJr7NE=; b=hOB0yxlYtKDyDDPXWF1nBZru7DKhfA0/4yMvINRoDWX8VYi4lT4IDjBaMidVqVCuPX ntO7Buzmh3kUC5WfUPodpYlxmk7dcvHM4zHihyDVE7NHjUyzYsokkOmJpRtYqra1G4+V 1AnMIbq4Bcgnmquw0kSBmWjmTkdZbxYkCIVP/dr6K0FGnRFw5NPemUVCR+YlhZxmXMUO VmxdqvmBTDeORAqo5mwNTAb4E/BoqspCj+eRM3tfBk0ZGwIl6VrgQQcZcupFZBkkZzDZ J8tpcEXxMNQCRzWYkuga0+dZBwuUGnu9iZEl4SCeuqwrCg6DAK2u+kmz54x196PYT4HM i/Nw== 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 c16-v6si2536843qvi.75.2018.08.16.03.06.37; Thu, 16 Aug 2018 03:06:38 -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 C53BA6861D; Thu, 16 Aug 2018 10:06:37 +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 88A3168627; Thu, 16 Aug 2018 10:02:21 +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 7AB7768624; Thu, 16 Aug 2018 10:02:05 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 7F3BE68627 for ; Thu, 16 Aug 2018 10:00:32 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward105j.mail.yandex.net (Yandex) with ESMTP id A661618417F for ; Thu, 16 Aug 2018 13:00:27 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9p2A7oxFYr-0Lgq3I1N; Thu, 16 Aug 2018 13:00:21 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LpjbZWHmdB-0LraSJMv; Thu, 16 Aug 2018 13:00:21 +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:05 +0000 Message-Id: <1534413607-8630-10-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 9/11] linux-gen: pktio: loop: handle SCTP checksums 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 Add code to emulate hardware SCTP checksumming support over loop device (as it is done for IPv4/TCP/UDP). 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/pktio/loop.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index faaef3ab5..388a00494 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -235,7 +235,8 @@ static inline void loopback_fix_checksums(odp_packet_t pkt, uint8_t l4_proto; void *l3_hdr; uint32_t l3_len; - 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); l3_hdr = odp_packet_l3_ptr(pkt, &l3_len); @@ -259,6 +260,11 @@ static inline void loopback_fix_checksums(odp_packet_t pkt, l4_proto == _ODP_IPPROTO_TCP, pkt_hdr->p.flags.l4_chksum_set, pkt_hdr->p.flags.l4_chksum); + sctp_chksum_pkt = OL_TX_CHKSUM_PKT(pktout_cfg->bit.sctp_chksum, + pktout_capa->bit.sctp_chksum, + l4_proto == _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); @@ -268,6 +274,9 @@ static inline void loopback_fix_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 int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, @@ -375,9 +384,11 @@ static int loopback_init_capability(pktio_entry_t *pktio_entry) capa->config.pktin.bit.ipv4_chksum = 1; capa->config.pktin.bit.tcp_chksum = 1; capa->config.pktin.bit.udp_chksum = 1; + capa->config.pktin.bit.sctp_chksum = 1; capa->config.pktout.bit.ipv4_chksum = 1; capa->config.pktout.bit.tcp_chksum = 1; capa->config.pktout.bit.udp_chksum = 1; + capa->config.pktout.bit.sctp_chksum = 1; capa->config.inbound_ipsec = 1; capa->config.outbound_ipsec = 1; @@ -387,6 +398,8 @@ static int loopback_init_capability(pktio_entry_t *pktio_entry) capa->config.pktout.bit.udp_chksum; capa->config.pktout.bit.tcp_chksum_ena = capa->config.pktout.bit.tcp_chksum; + capa->config.pktout.bit.sctp_chksum_ena = + capa->config.pktout.bit.sctp_chksum; return 0; }