From patchwork Tue Dec 12 11:00:16 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: 121510 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3963174qgn; Tue, 12 Dec 2017 03:02:23 -0800 (PST) X-Google-Smtp-Source: ACJfBosEhUt5ykYba4MvK36qmXw3wfYh2tURdXBzIjoqL7AMTo0qtYLZIYr99joxBCWzwniXE834 X-Received: by 10.200.15.248 with SMTP id f53mr5044077qtk.127.1513076543153; Tue, 12 Dec 2017 03:02:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513076543; cv=none; d=google.com; s=arc-20160816; b=B2TKBC8ORuMr9RHMBZ5mHI8gjuUnanN+cj5xKqvuMe3P7xvDI27SaYN48sCk5JrsWa SuOdKyr/2hAE92PDEqxW0CFYXIXrdqZB+99vSHZkpwixv/oNQ36oC+RBNKezfF3w/yl/ m2n80wwfTMI96EUECfwLhzd8ug7HSJ9zCsTvho79EzJxgojRJKHw6MTrwBQr2w7aARph EXt1UfYGSCPfM0721j9yU6+AyCZI++QFEzKQaxmKklEOZ1jEw+g4LFiV2FdcaeYGgRIW 77PFviAWwRlmB/n1j0HieslRfveGeU0iGcDDpOwkDrQ3yBiBm+NnOHA7lC8ln9SPXZS8 gbYw== 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=Z4UF/UJbvTfKRPBX/XLV3T/32NgneVpYl/wijgvILiQ=; b=COfyWLNweSnkoT7cA8Ed0RFAIf+j1Z14NKRJCmK8fCvCvyhpjfYJo0+Q5ec9Q9niKX Z8yV1EehqWRSruxwxc7C7315W2XShE1jS78WDwa6ZEPx2Mw9AEbq9IML8XRgcCLq4YaN JeuBpaPfbmSzIgg3TxjhmcrtlZMaOUKXCcji3aSQZeYy60Y9SyK7cq4Q4HofXaymFIE6 IQq1Xek6ut1SxM1P9cgjoeqAAo/TtmX1monKKS3z68aehN/Gh72Ky0q7sXnBj+7ephEe 233t0e8tbcP6XqRUZPGwnoXmRfzglZ6Yuop9WjfNS/COFkyNh7iFTbXoX0zjRLuKF4SR YdfA== 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 p50si2899521qta.92.2017.12.12.03.02.22; Tue, 12 Dec 2017 03:02:23 -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 D1F6E608FD; Tue, 12 Dec 2017 11:02:22 +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 B74F860888; Tue, 12 Dec 2017 11:00:34 +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 D4A6360840; Tue, 12 Dec 2017 11:00:27 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 9081F6074A for ; Tue, 12 Dec 2017 11:00:21 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 0E3C36A8312D for ; Tue, 12 Dec 2017 14:00:20 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 8XYakHEZjo-0Kk8Ldhl; Tue, 12 Dec 2017 14:00:20 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZTkbj3OZS0-0J9usQav; Tue, 12 Dec 2017 14:00:19 +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, 12 Dec 2017 14:00:16 +0300 Message-Id: <1513076417-16974-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513076417-16974-1-git-send-email-odpbot@yandex.ru> References: <1513076417-16974-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v9 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: 630d8422564ebf4991b468cb38a29e9483fc2ec2 ** Merge commit sha: d21de3efe97c31a21f306eccdcd3f74d11eb7ca9 **/ include/odp/api/spec/packet.h | 53 +++++++++++++++++++++---------------- test/validation/api/packet/packet.c | 10 +++---- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index b897c9d3c..84ce302cd 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_proto_chksums_t { + /** Individual checksum bits. */ + struct { + /** IPv4 header checksum */ + uint32_t ipv4 : 1; + + /** UDP checksum */ + uint32_t udp : 1; + + /** TCP checksum */ + uint32_t tcp : 1; + + /** SCTP checksum */ + uint32_t sctp : 1; + + } chksum; + + /** All checksum bits. This can be used to set/clear all flags. */ + uint32_t all_chksum; + +} odp_proto_chksums_t; + /** * Packet parse parameters */ @@ -1190,30 +1215,12 @@ typedef struct odp_packet_parse_param_t { * layer than the layer of 'proto'. */ odp_proto_layer_t layer; - /** Flags to control payload data checks up to the selected parse - * layer. Checksum checking status can be queried for each packet with - * odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status(). + /** Flags to control payload data checksums checks up to the selected + * parse 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_proto_chksums_t checksums; } odp_packet_parse_param_t; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index ce4d66c0b..70555c920 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.checksums.all_chksum = 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.checksums.all_chksum = 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.checksums.all_chksum = 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.checksums.all_chksum = 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.checksums.all_chksum = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1],