From patchwork Thu Nov 30 01: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: 120055 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp59486qgn; Wed, 29 Nov 2017 17:00:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMZMSEk4/KF6tlKtjaupt34IfZrxFCic217ACFc45+Fk55HfPOUijxxd4fkqblKqOkOQQFzY X-Received: by 10.55.212.16 with SMTP id l16mr486521qki.40.1512003657421; Wed, 29 Nov 2017 17:00:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512003657; cv=none; d=google.com; s=arc-20160816; b=OM15solehMSViSDEDRc3fW1COLPOSEgI8zez5Ws9x6HvRfz7+rqogCX/oflDfhNQiv 2RX/XrgHNZO1NgvK62h1sOh0VP6unCJWFkgrsnG2HoyrVHtyCij3JkUcq1LRCI82IEU0 gIlEiKlRSc7HUHbo0AutHBRYlHb/6Qf2NXg8erQrXAHUy7brTFO+mW+wqCLn2Az5XeEH 3+hsleIyC7giXqVrSRBX9m7XqPTvHhwobi+7/QRHFkgIT+QcFGhI/uIOQAr/hr2mcm63 X68FYXyVqLXZoMYbTnsboNVRhxAvrRcgCE2oeWX3mGEuiRFtOasTvDA31dZkEWetf0Mf kF2w== 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=Cd9ttfqRkFh1QZWTmLeFJVWtLx2j82e9M9gl3gC5CvQ=; b=l392DPvAz+k25RS4rdS3Mk10rDwZ4LGoVxspcG4FqZVVQ3r0qBIbxSn1MDOvkoWpz3 BY1CY+EMRV4OnWdZVmVlFs8UaliNOVVoXn/WQ7ASiYTjF+mEIuckPKh2gxC2hPq5ypLk fzz00MLSwWGJRtSzc7F0WILtl0oqmimuN1Ul3UYpXcGWg0jPC0BEMgT3MMHeI15WcPfm 2A/dKAxUOglb8ZaClEB7WxLRFODXSANYm7GZmWYfOtd2I+BXVfRUBRpAwTHZ7w+Uoqnc xFCbXqRk8HqD/eRTUOxwWsRKxnWTMU/FgGoIwWDw8HVulMxsUDxa9SPACqdxDJmLICzM ndJA== 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 u186si917775qkh.147.2017.11.29.17.00.57; Wed, 29 Nov 2017 17:00:57 -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 121C160940; Thu, 30 Nov 2017 01:00:57 +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 020996091D; Thu, 30 Nov 2017 01:00:19 +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 2AC3060916; Thu, 30 Nov 2017 01:00:14 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id EDB8360908 for ; Thu, 30 Nov 2017 01:00:10 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 917FF2D81526 for ; Thu, 30 Nov 2017 04:00:09 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Lk45Zn7DSq-09DeLAo1; Thu, 30 Nov 2017 04:00:09 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cS7WlRUPfZ-08feIjRN; Thu, 30 Nov 2017 04: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 04:00:06 +0300 Message-Id: <1512003607-25941-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512003607-25941-1-git-send-email-odpbot@yandex.ru> References: <1512003607-25941-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v2 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: 5150c0fba1777777f4e9a7d0b37c7d02639d54be **/ 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..e04f85f7f 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 payload 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..acf5ebf3b 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.checksum.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.checksum.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.checksum.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.checksum.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.checksum.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 01: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: 120054 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp58963qgn; Wed, 29 Nov 2017 17:00:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMaEErWbavaHCVD1VwSLTSiBHLwe7ON+xza6dtNXPYnwoEd2uzDiEcqIsHS0rBbfPjCNU0b9 X-Received: by 10.200.33.185 with SMTP id 54mr1210959qty.236.1512003626188; Wed, 29 Nov 2017 17:00:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512003626; cv=none; d=google.com; s=arc-20160816; b=EKeTF2CHxPYzWOwzqMRa/9sL3xzuilYYQK5FwSgC0po76Uvmwppy8FPusQIfqTQ1rk hHCmqyIr+RSu8yJYzCgG9zEI6mTs8JYp2twFsd0/5FTQHQjRr+kUrVtynjmQ6BHOddZX KO/Yh1X6bnJ6RMpbLH2kWgCKjz9M5dIf7d0uBudVGGxmR4mOajEJMMuvJcoCphVu1BGQ MvB3cgj1WpQFny22isyzpMVrVHcV5XKRyd+K3h2R7WV+01h6x/UGhqjjsoIhTxMBHFEJ G4WyE8hyrVntjOeeIxpJv2Tjvda1ZbTHoAZo+M9imjupjWjO+xEnyYrkotCmMVRwy2tI w6uw== 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=+0GzzKL4rAvMt20FysQSFyo6hqc4rwRCZAppc6N7juQ=; b=SfBTx55+zJmDjbCOW1Gx5UUXVy2MAxO+l0sLAL7QTNDFNNFfLQZi/poGkzYxaENrns m1k3pS7Yq/o1x0nAK5I1696UE6MSaaF+jXc4FQM17F/JBg2b+fmNj7t2QoWvxAODkHkC N+V0VuXDQ+RN8ZDgpz1o8Y9ghkVmYpUag0C3YogX3tgauOJm/aoZ0hYM6U48Zv+KrgJH AdsOHkkd85agcU8xpG1jHcB+i7LSRasyV9GxbhAhxiEugGEnGMBMY8sgvCRk2DxwNtgG 9HYYUJTaAFEL49z5BbgGyod2bxdw12M15tJexGa9aGqloxWSsElV6BM6dKWuIkPCxbcZ jwsA== 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 c19si291588qta.479.2017.11.29.17.00.25; Wed, 29 Nov 2017 17:00:26 -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 5950860948; Thu, 30 Nov 2017 01:00:25 +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,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 33B9060908; Thu, 30 Nov 2017 01:00:17 +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 B6E2160916; Thu, 30 Nov 2017 01:00:13 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id A785360902 for ; Thu, 30 Nov 2017 01:00:11 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 2586534C52E0 for ; Thu, 30 Nov 2017 04:00:10 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4zNn8f0luo-0AdOSCA5; Thu, 30 Nov 2017 04:00:10 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cS7WlRUPfZ-09fGY6uP; Thu, 30 Nov 2017 04: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 04:00:07 +0300 Message-Id: <1512003607-25941-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512003607-25941-1-git-send-email-odpbot@yandex.ru> References: <1512003607-25941-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v2 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: 5150c0fba1777777f4e9a7d0b37c7d02639d54be **/ 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;