From patchwork Tue Aug 21 17: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: 144760 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5522825ljj; Tue, 21 Aug 2018 10:07:18 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdas6eVQE7A5PwG5tjPbJ9EGgy03kRG+Nn/o0c4/L5Pwo2B2OuP0+2ySxrY7MNu+Go3SKeqQ X-Received: by 2002:a37:25c9:: with SMTP id l70-v6mr5792116qkl.199.1534871238021; Tue, 21 Aug 2018 10:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871238; cv=none; d=google.com; s=arc-20160816; b=SlJA7/pyM7ssW5Qkl9NbApz6WFfK73/17o5beiOLmZN4crrG2TENNGzFiN20RQ3JNs GMkzx8ypKseTmNEabVDoZXK6hV+B4iNesk2vBhIhyw0fUCrAnL4/ioMUF+3+rfEsZ78a 3UMOaszOA2EqLaSj63PcDOzKwz5F1H1Q44ELFsxYx+yfxmwjUzXCQCmyv0OonusnkOPm BWHhxHiwJWIaY8Xr8WZJDoEFfXCFnWFzNig89Rcw0ywKwbi8I/m6/5gbz3cbWUPe0K2v wOy3CgoDzSki9SggOiGAv9X5BkEksj/a6tU/mn8nMKYl6fNhmYWaby7rPkuuTZLdCujt 9/UQ== 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=DII49zzsPd8nWtNOPoS+TNaoxaCs31jSB1nqNGze4UI=; b=H4e8ljtFfpYJBD18GiSDyEkKLDvX9SVbuDf4zrG846MPomZLB0Le1/MeqhkrqvnnYA MccXeRteap7nB01sHZb7v8VTblKH+UMom+YOBoD94Cs9odKQmHIUUEC+5lIdHrBnyY0U 61Tf5zdrZO1XoPgLGKKG1/BdRLL0axaav97+h/yiZU5wzshqCGBsnWYa5Uu3MieSHqLU JuVY5TtGsQxnJc3VONzVjPXrZL/5Zbf9MdGB3MYajchIEiRsSw+aIln6x7/U1J7LRhmK TqkrF7iH2L5FtWRFUyclFoNeCTy4RYPIhnu6QHDvVIN2A2Q7COeqNn6j1IbU43xV9suZ Uyow== 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 t21-v6si2612248qte.375.2018.08.21.10.07.17; Tue, 21 Aug 2018 10:07:18 -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 AE32661706; Tue, 21 Aug 2018 17:07:17 +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 147796095C; Tue, 21 Aug 2018 17:03:02 +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 A81BD68615; Tue, 21 Aug 2018 17:02:50 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 01281685FE for ; Tue, 21 Aug 2018 17:00:42 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 955005883DC2 for ; Tue, 21 Aug 2018 20:00:37 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TJeUufUrH2-0brqmiXg; Tue, 21 Aug 2018 20:00:37 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PfJmBMqdLe-0aV0hs10; 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:05 +0000 Message-Id: <1534870807-18456-11-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 10/12] 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: f6c423a7d29e2c7d6d890cbc098a398d0d7e1288 ** Merge commit sha: d4f772b36da26684194cb0452a01b8da1ba7e3e1 **/ 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 2d8b843d6..e01dd4585 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -236,7 +236,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); @@ -260,6 +261,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); @@ -269,6 +275,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, @@ -376,9 +385,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; @@ -388,6 +399,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; }