From patchwork Tue Dec 5 16:00:21 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: 120710 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5921321qgn; Tue, 5 Dec 2017 08:01:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMbr5XO1zKVuG7j5Y0hRILyghtvCwQkXI8+bt735qyDXVXHoCfJ/FurZZdZlgCi7nVPfQRXW X-Received: by 10.36.58.12 with SMTP id m12mr9163561itm.17.1512489679438; Tue, 05 Dec 2017 08:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512489679; cv=none; d=google.com; s=arc-20160816; b=Qv4zzzCOGll36UocW0jtvgyCHVAfClHFEhUh4YgyNg7X3srdQsAH2y79WkAX/0Uxhw YeX9pB1if/Zp3DzsVK8fcHBCJiIyjHIrYa3f59+5JsZUsQ7pctlXNyHdVhy7njjUQDvr 82ht+J0NPu6Ev7lGFxFCe8f8YW8LPNPp2CW4m0DETPEsPzS9qqgONPkJSzbzAOe7PrE+ s8oNALMbDhOcyRNvwEV1uAZiLqZ241SNZ3HJfdhwdYmOh0lbsiXunR5lhlXDxwJfVoHk PDr1iyq0dVu5BZ+5IAGbpq750z0Ggu6iTxN+gpDQw8UHVNtgZFDZClTcEGsHRu/vX9lX cnFw== 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=VzrT+z1Qb2yD0BXyJzFvFcGJSAmI/NSejrP2pPYDKQ0=; b=yEQ594qwCaSpLkXDudNMQ+sTO0o241HQuTpUe0qcdKk/KktmJ/U3aVVWKQACMCKgKY NVoS/luYPX2SYFG+Fy/waMJeIBmc5UVfNcW8JXhMjeurfF/O3pN28kPnlcZ0kkU4cMGN g4ZPr77idje8bqL/1l/DMof0mw5TRTPa4sDXNZ7hTELGo2dO32U7tWcugyrVyneOSb0k SClu0BR1na4Fc9peIPEUvH73eUcGSmWKKrC8p2EYCM7PW3Yyruliy6urLtsz/EWO2XV/ Ih+iJA4ydF4vkdyNTCvKOBmwfj5BUdNon8qHfdacDmaf4l0fqr+qazSYYkqKM0mxUvau RqgQ== 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 f11si485357ite.9.2017.12.05.08.01.19; Tue, 05 Dec 2017 08:01:19 -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 F32CE607A3; Tue, 5 Dec 2017 16:01:18 +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 1B9CF607A0; Tue, 5 Dec 2017 16:00: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 424BF60816; Tue, 5 Dec 2017 16:00:28 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 38AF760696 for ; Tue, 5 Dec 2017 16:00:26 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward101p.mail.yandex.net (Yandex) with ESMTP id A77406A85A35 for ; Tue, 5 Dec 2017 19:00:24 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Yv2ZphSR3Z-0OK8stPx; Tue, 05 Dec 2017 19:00:24 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rlszrcHCmV-0NViMgBD; Tue, 05 Dec 2017 19:00:24 +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, 5 Dec 2017 19:00:21 +0300 Message-Id: <1512489622-22514-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512489622-22514-1-git-send-email-odpbot@yandex.ru> References: <1512489622-22514-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v5 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: cf7d38c194f1a9183a524790511de8bfd74a36a9 ** Merge commit sha: 507c1768bfbde64334e0a2ea85957eaeb2277064 **/ 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..b6baf41fe 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_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_proto_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_proto_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],