From patchwork Mon Dec 11 23:00:15 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: 121472 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3391156qgn; Mon, 11 Dec 2017 15:00:54 -0800 (PST) X-Google-Smtp-Source: ACJfBovVH1AvphWxurnSbTxwzrc03BWgwBIcLdz3K39glAN83n4x7kngDUoq5ijX1SLcHaRKUIGE X-Received: by 10.55.166.82 with SMTP id p79mr3017346qke.302.1513033253975; Mon, 11 Dec 2017 15:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513033253; cv=none; d=google.com; s=arc-20160816; b=Cqy7Cayu1eqveOV2dFbE7jrkxLIae8467AkbINmNPSA2/+dmBA20gsjR32hlR9ftmT /3RYPkFuwkELz9fB7TpRKtU5iEbe+qnAzw5iAFY+T2hC50quFXY1zX3TX6y2DxUrNDYm p77wqu+uKGyAAVAzACMSgsKoakIJaKB++Z6gSZIIr/Ciw+9ubn89catOnA6KzTAxlyiI fOpKX64bjszfv5aDLRzKjissU39uLNm/kUT5EALPn5M5PIciUr7H/PswgJo+V4jxxdUw Wl4zUAYIrLVYxUgm+1Tj49TYgYuSrTRm88uI71zkn9IBQtDgGFxz9kKXh2Z+lq3RXxBv k7dw== 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=AllQhYbkcYA56hTiuKWYs9WmNKBNIOeMUzVJB6BnhnE=; b=MHbaaPWhYB7Bt2+RFWhOo6/xJFYwTBxvW/dm8gnCWcAv48/XkCD65SVN+n9KNhmSVu mTVk+SEy3yIbpnEq9auoGemoXVgBAHejpw2Wd83+KYNDpAa6odiP2j5Y5GahpGl7Fxy1 tFKNoJrhTaSxg2O20RyfeF3lHA75wC//6tMKzcgjMqVtUdGVov2LCTTTe8Xsy7cetUdf rBddBJBwdvE/PtVBKf1rAm8c6fjA1i4Mo9Xgag/SVMiDo+iS+jw/7i7rIstEjNWP7Nab vZ8nkQ4dvUJ6PQCOExF16ZYUAsUR1kwxGQPGC52ZMu5gt7Jo6jkogGNyPIf6UzkmOZLW QDVA== 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 n189si1767415qkf.215.2017.12.11.15.00.53; Mon, 11 Dec 2017 15:00:53 -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 A249360985; Mon, 11 Dec 2017 23:00:53 +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 EE3976098C; Mon, 11 Dec 2017 23: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 5CA2560982; Mon, 11 Dec 2017 23:00:21 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id A51B86097B for ; Mon, 11 Dec 2017 23:00:19 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 567A14303121 for ; Tue, 12 Dec 2017 02:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ljzItBems4-0I0qH9Pe; Tue, 12 Dec 2017 02:00:18 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nXU3MWShLc-0HaC8wJO; Tue, 12 Dec 2017 02:00:17 +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 02:00:15 +0300 Message-Id: <1513033216-731-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513033216-731-1-git-send-email-odpbot@yandex.ru> References: <1513033216-731-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v8 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: 0fe38b26ae32c0f63255268251af6908304afa45 **/ 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..bc0cf54c9 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_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.check.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.check.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.check.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.check.all_chksum = 0; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1], From patchwork Mon Dec 11 23: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: 121473 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3391884qgn; Mon, 11 Dec 2017 15:01:28 -0800 (PST) X-Google-Smtp-Source: ACJfBosKH96cNBtm2UZFWGTIGTYqRCBBmnhQb2ZwNwQwRVayBZVTLsaDdyzW2db30MXLAEEBStLa X-Received: by 10.200.27.76 with SMTP id p12mr3118340qtk.310.1513033288693; Mon, 11 Dec 2017 15:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513033288; cv=none; d=google.com; s=arc-20160816; b=YctHgdwsOXHSY5E9QHvnfv/l8vTd7NhlAj+YZgfAOB8PSSIvoQgrFvGOGZfbu00lzW AxQUzTe2hzMALyG5wjzCIaulRqnuXxgT1eVAzdDCmzVm/ql+9k2HyLBsX7T+9qgwQiyN BGfHeT1uTIUDQzWFErxUFPwbLFea724Y+cPwDlN1mso/2JpHBdeaZNGCQ5JFwE9v9uDv A24Rh+r+lJsHlvnvPxtHpuwQOmmgG6WZpyfAxbTpZK9PEfvf1P6T54b1C2XrtqzYASy3 fDHXde0QKMpZ02THSrzWgSWh8UX5QVCwaNWs7iz4IM603mHV2llwIuQgulzUaJrftwGK g3mg== 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=fxWYlGr3UdlEUFSVgyHk4fSyFGpPbQfTWtKYqtBSNNU=; b=cTbOAybh9OIdPQXfSFFqu+2+ID83Uk+G9/7/e4tusg1jfECZXyeqakK16NxLopuSG8 xVU7P5CC+oedTIxDPrJqjiDhflwGBmKSKFWG1UWhPE2Pzzji4UnSR5wHyzzQTkoK+6Ug +/zk99ALREtau9CMSxnC7+lJnvJEbQ2vVg8FMXmXQNvaJ7aVIX/o/G2WOACHwHp1tdoC XrDOvdlSyMWgfDYHI6OVbspX1r/fWHmI74D14UbNkkMWwguiWp5WmlqYZwswqsLcR18w EHIQ4SmB2uMCr/luZGPAS4s+rCKSHflfIK+nMlYvUfLk6+KuPRqLgi05QdyHfN1opD+x nS1A== 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 d190si2697090qkf.150.2017.12.11.15.01.28; Mon, 11 Dec 2017 15:01:28 -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 4DC3160982; Mon, 11 Dec 2017 23:01:28 +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 47A486099C; Mon, 11 Dec 2017 23:00:29 +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 622A86097F; Mon, 11 Dec 2017 23:00:22 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id E2C7560955 for ; Mon, 11 Dec 2017 23:00:20 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 2F2AE4080E09 for ; Tue, 12 Dec 2017 02:00:19 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Vla4Cv2Cww-0Ibi50AG; Tue, 12 Dec 2017 02:00:19 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nXU3MWShLc-0IaelXlp; Tue, 12 Dec 2017 02:00:18 +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 02:00:16 +0300 Message-Id: <1513033216-731-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513033216-731-1-git-send-email-odpbot@yandex.ru> References: <1513033216-731-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 314 Subject: [lng-odp] [PATCH API-NEXT v8 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: 630d8422564ebf4991b468cb38a29e9483fc2ec2 ** Merge commit sha: 0fe38b26ae32c0f63255268251af6908304afa45 **/ include/odp/api/spec/ipsec.h | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index d57815ed2..4504140d3 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -158,33 +158,9 @@ typedef struct odp_ipsec_inbound_config_t { /** Flags to control IPSEC payload data checks up to the selected parse * level. Checksum checking status can be queried for each packet with * odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status(). + * Default value for all bits is 0 (skip all checksum checks). */ - 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_proto_chksums_t check; } odp_ipsec_inbound_config_t;