From patchwork Thu Nov 30 02:00:05 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: 120064 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp105128qgn; Wed, 29 Nov 2017 18:00:54 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ1jBelj5DrpFjal7VtdLsE8r4K7wN63ihvEvbmz+CK7JFY2IgVCoHlBNU97PvApe78i+EF X-Received: by 10.200.42.211 with SMTP id c19mr402332qta.70.1512007254545; Wed, 29 Nov 2017 18:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512007254; cv=none; d=google.com; s=arc-20160816; b=Aqyba6Rc/27sQwIEJgY6OPZGHXnaMFdMr1bkGVMyByigwXDmu7Q9jWm3uvxj6KB+BX yxANEdopCpwIl0GzHjDGMJR6dpf0yFZvF5r/OVpouP284tJ34FT5CP+tJYQ9niRsjGFk dAaQElRXRWoxSFIRkxzSdGii2PhuMCPz0nnbtoxOyigoh8AyPm4CKa12NJUfmkbX5MtY cFzmbkVJwOXHLgZ/EZT0qaxR3UTcmC77hXvHIWaw5tdDlNRjtk9bYgd9LdMo3AxHPxCg Y3cLgyc1b70Kb/fk4vGHPi5HVaD8FxuYGQh/bfhTI43l0LmV6CCq2hSyF56NhCNOpfFz fArg== 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=e5lUFaLrwli6YuF4PQJBzX2h7r7kh7+g0sEoGccZlEQ=; b=oYGm+lDVSVTD4rhpDcofEDGnYdOlJzNSNU7cgaLQMqDWrTaHxPapZLlPh9atY9GG3d B+olJ6SHZarPeXSscavPQr1GGp6qcs+X0WQ8H84/d6PBGx2tuPknu4gb+c83gFxYu4x7 Ux5uhRNN7ghKrTpVxIyH7IDjgC/x900oVvRyZ2SoEPBTVFjxjQVRZQE4KPYvdvssxOI/ /HDMvX9ir/UYFEp3e/Q8VfTJ/MkMdMR6GKKoi06G5/s8pL76FNjfmjKUzB5LTKLkzHhr qBGgmrzO1jpU7npO+0bJviQCnJ5rYq7Bot0fHxPtXXhXp8zJHp7e7x7UOY4UaSvzUVOg YmIA== 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 u34si3236179qta.358.2017.11.29.18.00.54; Wed, 29 Nov 2017 18:00:54 -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 1B0536093E; Thu, 30 Nov 2017 02:00:54 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 EC57660593; Thu, 30 Nov 2017 02:00:24 +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 8371A60908; Thu, 30 Nov 2017 02:00:14 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 3EFC560593 for ; Thu, 30 Nov 2017 02:00:09 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward104j.mail.yandex.net (Yandex) with ESMTP id C8C3446F03 for ; Thu, 30 Nov 2017 05:00:07 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id iAbsA3GNaf-076OT6lh; Thu, 30 Nov 2017 05:00:07 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I2kDxvmn8n-07GOAB2P; Thu, 30 Nov 2017 05:00:07 +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 05:00:05 +0300 Message-Id: <1512007206-26876-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512007206-26876-1-git-send-email-odpbot@yandex.ru> References: <1512007206-26876-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v3 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: 2550976ae1c39e57b39a5e760aebb7f1c8715de8 **/ 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..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 02: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: 120065 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp105721qgn; Wed, 29 Nov 2017 18:01:29 -0800 (PST) X-Google-Smtp-Source: AGs4zMa/HaNSadxbOgVn4OuM491HxVp2F0t9izdHjyrkUDfBBOuLhXLubNasDQRPK1qdFUeIhrcP X-Received: by 10.237.35.146 with SMTP id j18mr1273462qtc.271.1512007289486; Wed, 29 Nov 2017 18:01:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512007289; cv=none; d=google.com; s=arc-20160816; b=r1iUSR4N+lmnS4on+yf9rFBdgYCKoTL+ZBgaUGw20uax3tW5QNWN0JvkB9N02bS3rX exmhroN2mXEDtPtjg57NO2hsTGiFvzagSeF41UQBc4AfLWHv1442wGgn3jnnuC4wGEYB Y8X3lYoezyWFoc9mumFslxHdL6sEvnQhYIy8BKN9ufzzm63U5VA7f5T1NcdZuairsamO CPWBWmIW3YTwYmH4ZSYIiihL6T50R7tE/a5AsnMYLjgPdrrX7pxHyyG8sdDzgtEAMGzd 6QTxcIniDSdFt2hrqBMPNmfUqJRJ3yN3hNyv15vdZxcXEkBkun1MITWSj8zMVOaROgDA b6JQ== 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=KhE2TdnLcNPkeYzQsb09IxQ33qWuJDoPkj0oTzUZWX0=; b=ruYbJsldx527OpdXc7M7U86vGP5T/nLpXQ/1/oqvi++btizmBhWcEXtEmaevMwHoVp 02/h8H3v6O2EC6TVfOB5srE3a6Li7exmHQAVns11C4l1lA051ROGIrUCC23EzYrX3oXm HY97CY5nWlFmr41ercBDLbOulrohuPWJTae/UZmbZKUcVH6ZOuYLWsuHqYxr8n2LlC1l qjWB/AQODGNU381+WjfA2wXTPTFfYDvW2CZ+vOWrExCrJTl2qojtqhjC7MjfyzAehHrY M3+xdmveAKtsgtJP+Z2KhYZzkPR2NqyOqWvFJ3G7HKdy/LYvNnmDQZzbe5SjvjvlDsxC uMQg== 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 t5si1783355qtc.281.2017.11.29.18.01.29; Wed, 29 Nov 2017 18:01:29 -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 2A35F60950; Thu, 30 Nov 2017 02:01:29 +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 94F1A60509; Thu, 30 Nov 2017 02:00:30 +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 CEB9F60908; Thu, 30 Nov 2017 02:00:14 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id E205260905 for ; Thu, 30 Nov 2017 02:00:10 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward103p.mail.yandex.net (Yandex) with ESMTP id CB4AE2185772 for ; Thu, 30 Nov 2017 05:00:08 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Astt4tdjRO-08xqgPL9; Thu, 30 Nov 2017 05:00:08 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I2kDxvmn8n-07G0BGHp; Thu, 30 Nov 2017 05:00:07 +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 05:00:06 +0300 Message-Id: <1512007206-26876-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512007206-26876-1-git-send-email-odpbot@yandex.ru> References: <1512007206-26876-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v3 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: 2550976ae1c39e57b39a5e760aebb7f1c8715de8 **/ 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;