From patchwork Thu Nov 30 12:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120151 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp576308qgn; Thu, 30 Nov 2017 04:04:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZNOnd/+IFDeP78/IZbVXwn5JGDzIvzExoq00s0lJMO1KV/dVMRltR8wJKh4TpzDdtsItpK X-Received: by 10.55.166.82 with SMTP id p79mr2308959qke.302.1512043492175; Thu, 30 Nov 2017 04:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512043492; cv=none; d=google.com; s=arc-20160816; b=SLty/f1ccz4rOCi8T76cKwlK0FvL/UUM/yTs9D19qpIKSye5trZcuujkFgLmTsWIMH 1abmzEj5wjmEmvzgoq5TEU/+TxUEf6XvW2gvQelogI4tiTOf2G5TRRci8GGXEt/71Jbm /eux6lo18urTwYXK+p1XWKxy7G7de4+Upx0qvSznfe6a0b34TUXH/5JEPXoBjvh3bVEb 8qSBwJwM/t5b7eogk1b3dAMJkPkQrcGCVvvcE3iFHstyI52du5ibmafLYYVVvWdiYPvQ 0/qEI2YmF/xNIA75wmcrSX6zXxNYncywHo9uCtlmJhvZ8nbVA2216zJRaenkG7v4/5eb 7vxA== 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=bVhEfp3GhJOCKC6NZ7mJQEGBqHK3bqPEW8ez7Qhv5no=; b=TeoZRfsB1+7eaPsdninJAiEVdHf7j95wjUbrj7QcAVtln2Apq4XH1+BbjOJzUjSLdx qBPwxZ2h+No2ocS+lVdxyJQb/APWqBoMyek+xztooMOIzBJzMnzx+CIRFCGig3StArGK Zi6NUas/Ff1QKWAX/A0VyT5maR6ZKIyIA8Rc9Tr1rWHAccWTTWA7iuqcCrPIq/pjAPje 9GEOAzrj4NpuuuQtKY1jUknsrsqrld8NAU5Pg34xT7iiE+26O9FejMtWw7U2VkS7aJ+3 Ray0SJKaearlOGhbA7n/T9LyjgDWfCvj1WRQyEbA6C+jtEapZKTlcyl+Qtvf2kIuqGrR 7sQQ== 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 31si4120637qtv.152.2017.11.30.04.04.51; Thu, 30 Nov 2017 04:04:52 -0800 (PST) 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 D467360956; Thu, 30 Nov 2017 12:04:51 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED 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 A6F2260905; Thu, 30 Nov 2017 12:02:38 +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 9D41F60948; Thu, 30 Nov 2017 12:02:03 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 562CA607EC for ; Thu, 30 Nov 2017 12:00:12 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward101p.mail.yandex.net (Yandex) with ESMTP id CA19E6A82320 for ; Thu, 30 Nov 2017 15:00:09 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NmXLKGQUGV-091q401j; Thu, 30 Nov 2017 15:00:09 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TZRVxJjGds-082GKbpY; Thu, 30 Nov 2017 15:00:08 +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, 30 Nov 2017 15:00:06 +0300 Message-Id: <1512043207-8703-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512043207-8703-1-git-send-email-odpbot@yandex.ru> References: <1512043207-8703-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v4 1/2] api: packet: separate checksum check flags 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 Separate union controlling different checksum checks. It will be used by IPsec API. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 314 (lumag:ipsec-chksum) ** https://github.com/Linaro/odp/pull/314 ** Patch: https://github.com/Linaro/odp/pull/314.patch ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905 ** Merge commit sha: 6673dcd62b3b19902e452decdd5206958db67c58 **/ include/odp/api/spec/packet.h | 46 +++++++++++++++++++++---------------- test/validation/api/packet/packet.c | 10 ++++---- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index b897c9d3c..2917ebde0 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1178,6 +1178,31 @@ int odp_packet_move_data(odp_packet_t pkt, uint32_t dst_offset, * */ +/** + * Flags to control packet data checksum checking + */ +typedef union odp_packet_parse_chksum_t { + /** Individual check bits. */ + struct { + /** Check IPv4 header checksum */ + uint32_t ipv4_chksum : 1; + + /** Check UDP checksum */ + uint32_t udp_chksum : 1; + + /** Check TCP checksum */ + uint32_t tcp_chksum : 1; + + /** Check SCTP checksum */ + uint32_t sctp_chksum : 1; + + } check; + + /** All check bits. This can be used to set/clear all flags. */ + uint32_t all_check; + +} odp_packet_parse_chksum_t; + /** * Packet parse parameters */ @@ -1194,26 +1219,7 @@ typedef struct odp_packet_parse_param_t { * layer. Checksum checking status can be queried for each packet with * odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status(). */ - union { - /** Individual check bits. */ - struct { - /** Check IPv4 header checksum */ - uint32_t ipv4_chksum : 1; - - /** Check UDP checksum */ - uint32_t udp_chksum : 1; - - /** Check TCP checksum */ - uint32_t tcp_chksum : 1; - - /** Check SCTP checksum */ - uint32_t sctp_chksum : 1; - - } check; - - /** All check bits. This can be used to set/clear all flags. */ - uint32_t all_check; - }; + odp_packet_parse_chksum_t chksum; } odp_packet_parse_param_t; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index ce4d66c0b..3f0f957f2 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2451,7 +2451,7 @@ void packet_test_parse(void) parse.proto = ODP_PROTO_ETH; parse.layer = ODP_PROTO_LAYER_ALL; - parse.all_check = 0; + parse.chksum.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], @@ -2482,7 +2482,7 @@ void packet_test_parse(void) parse.proto = ODP_PROTO_IPV4; parse.layer = ODP_PROTO_LAYER_L4; - parse.all_check = 0; + parse.chksum.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], @@ -2512,7 +2512,7 @@ void packet_test_parse(void) parse.proto = ODP_PROTO_ETH; parse.layer = ODP_PROTO_LAYER_L4; - parse.all_check = 0; + parse.chksum.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], @@ -2542,7 +2542,7 @@ void packet_test_parse(void) parse.proto = ODP_PROTO_ETH; parse.layer = ODP_PROTO_LAYER_L4; - parse.all_check = 0; + parse.chksum.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], @@ -2573,7 +2573,7 @@ void packet_test_parse(void) parse.proto = ODP_PROTO_ETH; parse.layer = ODP_PROTO_LAYER_ALL; - parse.all_check = 0; + parse.chksum.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], From patchwork Thu Nov 30 12:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120150 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp574973qgn; Thu, 30 Nov 2017 04:03:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMb1vEa/yr8073vXQW2rYezZg4HGBQsmm6IvaKCQzC++CuEEaBNdVvRdGTzzhFnhKkEyPJGe X-Received: by 10.55.182.129 with SMTP id g123mr2022485qkf.243.1512043428719; Thu, 30 Nov 2017 04:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512043428; cv=none; d=google.com; s=arc-20160816; b=v99KoGQXHDQbCMyK2Mk9usMOBh0zGx2V+EFmAriWShGKe0AZrdfi4eBarVq0/q5EUJ ifCBVY/8x0069f1Ggwa5FJvJvwmZN7HqquGe7cNpsrz7xQYd6ROx2zdbi4pcMKb45tgb I9amBLbuZIBrQLWrShw7Urp7zhrQm306ahY2u/t28C7sgzRPsJXEqGCHvXQ1mimPkr+7 q6yQva/6IR5uqEAreo3iQWAxQRCSQ3SU6qPWNlxX5KBZMQ3/lzNJ4KZBMlLFmB/qZGEP q1MbBWS1u2QV9VhPpKqR0dYMy3k1KPvMLsoLZbPHkTHjcBzYFyIGqE9ThBTIOEpW/TWN r8Dw== 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=730H6XHPJJdOMBW0ANYxNucsDzQUEVtNAL/8GAnLl2g=; b=XZUGwpsiM5SmIqcCmBzxoBxiQJDU3H45aQuonmkq1O/AIaeAAAQIZkuR+Q3yiYTmAq YWK04syQCdADi7+opRtwUGtHeVSujpxu0rgjkShxXvv8kB+6/41DM87WnMEsPZrEpQaH BGMSBttVG36Z+pJdRtrtVHz8uB0aHZt1TCyWJMfKwvEBYo0/24Ad1P+kKM2W9FHdmz4W GkRz0VlDhi9IJvOk7kgHaku+xCwNnXJ7JlQfMAfRWfAVFNWINpRITFLJm15gOwpG4Mwh BIkEqC9LCP8tQPA9qkA618eTrAESvSyhIyyoJwOxsBAL+JZJQqNc9JequF8Bbc8CCdJr wohA== 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 h4si3982002qtj.314.2017.11.30.04.03.48; Thu, 30 Nov 2017 04:03:48 -0800 (PST) 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 6C6386097C; Thu, 30 Nov 2017 12:03: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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED 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 462E260943; Thu, 30 Nov 2017 12:02:23 +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 DF39960951; Thu, 30 Nov 2017 12:01:58 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id D88BF607E4 for ; Thu, 30 Nov 2017 12:00:11 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 6DE8B784E46 for ; Thu, 30 Nov 2017 15:00:10 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hgfWpUsvXO-0Ab0pFOF; Thu, 30 Nov 2017 15:00:10 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TZRVxJjGds-092GK82I; Thu, 30 Nov 2017 15:00:09 +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, 30 Nov 2017 15:00:07 +0300 Message-Id: <1512043207-8703-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512043207-8703-1-git-send-email-odpbot@yandex.ru> References: <1512043207-8703-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v4 2/2] api: ipsec: reuse checksum checking flags from packet API 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 Reuse odp_packet_parse_chksum_t from packet API to ease passing checksum flags to packet parsing functions. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 314 (lumag:ipsec-chksum) ** https://github.com/Linaro/odp/pull/314 ** Patch: https://github.com/Linaro/odp/pull/314.patch ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905 ** Merge commit sha: 6673dcd62b3b19902e452decdd5206958db67c58 **/ include/odp/api/spec/ipsec.h | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4a33af8ea..15d7d25ff 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -159,32 +159,7 @@ typedef struct odp_ipsec_inbound_config_t { * level. Checksum checking status can be queried for each packet with * odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status(). */ - union { - /** Mapping for individual bits */ - struct { - /** Check IPv4 header checksum in IPSEC payload. - * Default value is 0. */ - uint32_t ipv4_chksum : 1; - - /** Check UDP checksum in IPSEC payload. - * Default value is 0. */ - uint32_t udp_chksum : 1; - - /** Check TCP checksum in IPSEC payload. - * Default value is 0. */ - uint32_t tcp_chksum : 1; - - /** Check SCTP checksum in IPSEC payload. - * Default value is 0. */ - uint32_t sctp_chksum : 1; - } check; - - /** All bits of the bit field structure - * - * This field can be used to set/clear all flags, or bitwise - * operations over the entire structure. */ - uint32_t all_check; - }; + odp_packet_parse_chksum_t chksum; } odp_ipsec_inbound_config_t;