From patchwork Mon Dec 11 10:00:18 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: 121345 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2588642qgn; Mon, 11 Dec 2017 02:02:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMYI27bLXzidezZI6/7BmYVf1srimwGdnf5XcAbO82M+MSprgxUSEdl/s+fdeTWqVeiIfPHd X-Received: by 10.55.215.22 with SMTP id m22mr26385388qki.91.1512986525797; Mon, 11 Dec 2017 02:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512986525; cv=none; d=google.com; s=arc-20160816; b=buCzwvXvZLnGUWZLr5y0DHSdWKo2ZpcglL3N6U4bZAn/Yz9mqoDu9slUwrEPl2rds+ 40TRwJJZMerRIA3j4OT8IxfxIcABESa36x3MQHbLJ/EYP1BaiRzoTwsjGrwKOR7xB4yy vct9oiVEqcarRv7VBttQEQSq+B/FDAVrc5woqA49LvQMUE3GwsSd0Wr6lV1300Rx4M7i a+o4Yec+npmtf7z/W23np6gt8sr87CN2nFu9BFCrBRllUwJBkQLJ6Yjog+fs1ehAXJnZ ArezgM/v/fbYiKv5HMsphBRbtLdLm3uKKrECq/wqFCG4AvysTEG577KBIpkuQzJBhLxk C25Q== 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=1ClEj9Qs7KoN6iHAydDQWk8ZCrej6xXDUGI8MyR7g1Y=; b=OZ7I5LCxKr8Md/7X0KdtcJLdQunaKFPk9CdC+/4o8j0RBXiyG0grLeyIIeBjKnjf6/ ALY/SdxTiCoE82nTAnltjRckHH1B8aGjcJIQYqcb0xUpKjsWfycElVZwk7X5eY9YCSqY lA5/u6IUIpg9ujpSq8ycaPjv/K8u6sbgu4OiymfTq7+mJI3bw6k+/WJSyIdgEZ4q20BF FA4J4JfcIykBdCVM8klPFC743vM2od9EmOvzmvC1TcDNUznn54aRiW3HRuASOk5LpGA1 XO/LnCuK9enlrlZp9pdfNZPUGIYSt6gqcrmYM0lQiUb7NUrtIvMg/mCwjOczaDOH0LOv cUOg== 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 s63si4152991qkd.22.2017.12.11.02.02.05; Mon, 11 Dec 2017 02:02:05 -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 7F2BC608FA; Mon, 11 Dec 2017 10:02:05 +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 D6B566088A; Mon, 11 Dec 2017 10:01: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 1E664608DC; Mon, 11 Dec 2017 10:01:13 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 9EA3760880 for ; Mon, 11 Dec 2017 10:00:35 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward101p.mail.yandex.net (Yandex) with ESMTP id E9E7A6A81066 for ; Mon, 11 Dec 2017 13:00:33 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id h5W4kmEVXw-0X6CQSo0; Mon, 11 Dec 2017 13:00:33 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6KBJ5xilJU-0R1OpnCH; Mon, 11 Dec 2017 13:00:27 +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: Mon, 11 Dec 2017 13:00:18 +0300 Message-Id: <1512986419-17024-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512986419-17024-1-git-send-email-odpbot@yandex.ru> References: <1512986419-17024-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v6 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: 0980001e33b4190133d478a0aa2e718fd1e3c164 ** Merge commit sha: 72c08168e486c67632c0701bbe9602ec595d484c **/ 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..02c770f21 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 */ @@ -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_chksums_t check; } odp_packet_parse_param_t; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index ce4d66c0b..6ff964494 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.check.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.check.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.check.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.check.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.check.all_check = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1],