From patchwork Wed Dec 13 12:00:08 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: 121736 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5378190qgn; Wed, 13 Dec 2017 04:03:59 -0800 (PST) X-Google-Smtp-Source: ACJfBov2Pd1NR1y3SlXkxCtagDQf1JJsbHB1SHfu26EigFRPv8TzG2pgU1ipHUaJH/8VzPPJs4EX X-Received: by 10.55.25.18 with SMTP id k18mr10247950qkh.336.1513166638950; Wed, 13 Dec 2017 04:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166638; cv=none; d=google.com; s=arc-20160816; b=iyVTFSuMPRm98t5DsPjvnfq/xGtT5gCYwf5ZAcA/irimnJwZTmEj4CZ5DqNX29E+9k EzArQd4+urka/aZCyh1ZwxZYPGe2d78nr9Km0+UtJ/RiWnSVo9Ao+13ko2e4uwRmFhG6 KG6T2d6PmBQamDecrSaJ6+8ds5IDw9+99JcqqM4a1DuSGIpWcPRlxYXLcf7Q57oEMgry hZbs+BFqFTyG54pN4svlnrKg/C77T3SY4/u6xT5zYWCX1lexShDlAJZhUKdmzWb4GjPd S5zVBWZSlBhEX33hplNQ1CjG1KeYX9xTUO06Oq9G0jPOSnmrroHUPF+GSxFytZ3ABDvT Ta7Q== 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=z2AbwnJnJI0ELj8wfcGsUg+ZgeioQZBHEapFKx8oKgA=; b=JMX+aFvrv0r8F161ycngH9sFAZ1esD8yUFXVowoMAfK+DDWKQOkjhNP6kBVlaVrtyi u2jei80XeTTLuEEPQhzLS1KsEqWCHy40D5z7+w+e3Ol0VEH8OeXywKwQMue3615tHSWw KT7fl5S83UoU633uRnHUzHRx0XwJzD5iZ8tv3ew4499sB+TxtlAMmYIZrMFQEdPvGn05 J9wwN7mhujMJX0neLICTtMMDEws9SzNkWs6zVVU2kl7w2ys2EIYXtQ52D9IS1UmltkWX vfUsZu1OJujz22bu7asAoPNNFf3wb5DfT48CgLjs/YDIeA+tJy3ba1sfDpunI3QceCI7 mPwA== 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 125si1634169qkl.409.2017.12.13.04.03.58; Wed, 13 Dec 2017 04:03:58 -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 A465060800; Wed, 13 Dec 2017 12:03:58 +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 E452360928; Wed, 13 Dec 2017 12:02:43 +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 35E3760925; Wed, 13 Dec 2017 12:02:31 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 5D6646096D for ; Wed, 13 Dec 2017 12:00:13 +0000 (UTC) Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward104p.mail.yandex.net (Yandex) with ESMTP id B0CDF1853D2 for ; Wed, 13 Dec 2017 15:00:11 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cLOBS71H1Y-0BCiwOdq; Wed, 13 Dec 2017 15:00:11 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jcqEDiDE4k-0BpG73tk; Wed, 13 Dec 2017 15:00:11 +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: Wed, 13 Dec 2017 15:00:08 +0300 Message-Id: <1513166409-7927-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166409-7927-1-git-send-email-odpbot@yandex.ru> References: <1513166409-7927-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 336 Subject: [lng-odp] [PATCH API-NEXT v4 1/2] api: ipsec: use odp_proto_layer_t for parse layer spec 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 Usign odp_proto_layer_t for parse layer spec is more logical, as it is the same enum that is used for the rest of packet parsing API. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 336 (lumag:ipsec-proto-layer) ** https://github.com/Linaro/odp/pull/336 ** Patch: https://github.com/Linaro/odp/pull/336.patch ** Base sha: d96a8207591fbcaac25b79286d7d72a537354c1f ** Merge commit sha: 601b6c49aa37a7c95d2987a35e0c321177802840 **/ include/odp/api/spec/ipsec.h | 4 ++-- platform/linux-generic/odp_ipsec.c | 14 +++++++------- test/validation/api/ipsec/ipsec.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 538472a5e..c67954689 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -156,9 +156,9 @@ typedef struct odp_ipsec_inbound_config_t { * * Each successfully transformed packet has a valid value for L3 offset * regardless of the parse configuration. Default value is - * ODP_IPSEC_LAYER_NONE. ODP_IPSEC_LAYER_L2 is not a valid value. + * ODP_PROTO_LAYER_NONE. ODP_PROTO_LAYER_L2 is not a valid value. */ - odp_ipsec_proto_layer_t parse; + odp_proto_layer_t parse_level; /** Flags to control IPSEC payload data checks up to the selected parse * level. Checksum checking status can be queried for each packet with diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 8735e6052..1705d5b7d 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -200,18 +200,18 @@ static const uint8_t ipsec_padding[255] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, }; -static inline odp_pktio_parser_layer_t parse_layer(odp_ipsec_proto_layer_t l) +static inline odp_pktio_parser_layer_t parse_layer(odp_proto_layer_t l) { switch (l) { - case ODP_IPSEC_LAYER_NONE: + case ODP_PROTO_LAYER_NONE: return ODP_PKTIO_PARSER_LAYER_NONE; - case ODP_IPSEC_LAYER_L2: + case ODP_PROTO_LAYER_L2: return ODP_PKTIO_PARSER_LAYER_L2; - case ODP_IPSEC_LAYER_L3: + case ODP_PROTO_LAYER_L3: return ODP_PKTIO_PARSER_LAYER_L3; - case ODP_IPSEC_LAYER_L4: + case ODP_PROTO_LAYER_L4: return ODP_PKTIO_PARSER_LAYER_L4; - case ODP_IPSEC_LAYER_ALL: + case ODP_PROTO_LAYER_ALL: return ODP_PKTIO_PARSER_LAYER_ALL; } @@ -553,7 +553,7 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, packet_parse_reset(pkt_hdr); - packet_parse_l3_l4(pkt_hdr, parse_layer(ipsec_config.inbound.parse), + packet_parse_l3_l4(pkt_hdr, parse_layer(ipsec_config.inbound.parse_level), ip_offset, _ODP_ETHTYPE_IPV4); *pkt_out = pkt; diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 7b39c2c5a..1e28b384b 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -896,7 +896,7 @@ int ipsec_config(odp_instance_t ODP_UNUSED inst) ipsec_config.inbound_mode = suite_context.inbound_op_mode; ipsec_config.outbound_mode = suite_context.outbound_op_mode; ipsec_config.inbound.default_queue = suite_context.queue; - ipsec_config.inbound.parse = ODP_IPSEC_LAYER_ALL; + ipsec_config.inbound.parse_level = ODP_PROTO_LAYER_ALL; if (ODP_IPSEC_OK != odp_ipsec_config(&ipsec_config)) return -1; From patchwork Wed Dec 13 12:00:09 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: 121737 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5379113qgn; Wed, 13 Dec 2017 04:04:39 -0800 (PST) X-Google-Smtp-Source: ACJfBoux/vHW6VowG5ndq8myp7KFX3JCCEdoSm2n586pJQbn5w3d0ZjaGpwQZKnbnclVHNNNGm79 X-Received: by 10.237.63.121 with SMTP id q54mr10653838qtf.337.1513166679770; Wed, 13 Dec 2017 04:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166679; cv=none; d=google.com; s=arc-20160816; b=tuE2TAk3kHbTV6OzUS6OYj8dW352BZDamoP1Yd+O+daQ8czOKFRHCX9cNrk0mcGDfx J0Tw10J2UqLS/LahUvsiqc514YPBw7dnkOzx20JZZB47In6eczZl9HNcZ+DK9TzKyoO0 lVidU4OfjbCU+UTTTuRh03WW11Fjcht5adcBSM3s1HL41MjhGgQunEeM+oajIZXsNOOm Z41BuKXQ/OsybCwMiFx/3m1pS5FDmIbgdFydsDlMDgHpZ/p2XayEQtan0UoTa6DR1Ubr xRa8YdYkAenk+RhwX5NqtRLjX3qo8IFirG97Ga8q/ddH+4bmVB+8KiPsWYgb2viBncas a3ng== 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=/s2Y34Yvkc3L4qWpIXSZnCxth6PkbvyjANGlthubFyA=; b=EBhKN5MAGrFYP/Lnn67d585YerssYCmkrhmxaw0gIskgIcObLC/rMxzJXq4Pyde3Bh z69CKL7NTF6j8kx/fz8XeIYH9m5RMF07YM3dwEGYPJ/+JYtbkEhMNaHsTFfwGSKzVexr R9w4aEsxFjNtTyT0ckn1r0o+CwT6qOSaIXaEXx4p7yriRmGBU0OX2TOxuhXfhseIUF0U 2thYmsQFzm4hvrBheSmK9ycczyQYXQwn1Mf8iE3vmRUkF9O6X8kyGB6emffxqS8/Rrq2 x8KHPnzQp8dOI3ldxUAouTjom3JSx9ht8BUulOx3tAbOfc5JGtnrp0qiLoFjfT6vB/7A qZKQ== 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 i58si1720087qta.381.2017.12.13.04.04.39; Wed, 13 Dec 2017 04:04:39 -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 7428A60916; Wed, 13 Dec 2017 12:04:39 +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_H4,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 37BBF60966; Wed, 13 Dec 2017 12:02:51 +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 BE11E60950; Wed, 13 Dec 2017 12:02:35 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 693F060800 for ; Wed, 13 Dec 2017 12:00:19 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 4C34E560088C for ; Wed, 13 Dec 2017 15:00:12 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dD6klnT2vb-0CMSbWmq; Wed, 13 Dec 2017 15:00:12 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jcqEDiDE4k-0BpOrnhR; Wed, 13 Dec 2017 15:00:11 +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: Wed, 13 Dec 2017 15:00:09 +0300 Message-Id: <1513166409-7927-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166409-7927-1-git-send-email-odpbot@yandex.ru> References: <1513166409-7927-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 336 Subject: [lng-odp] [PATCH API-NEXT v4 2/2] api: ipsec: drop odp_ipsec_proto_layer_t 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 Use odp_proto_layer_t to specify outer header retention level. Drop separate odp_ipsec_proto_layer_t. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 336 (lumag:ipsec-proto-layer) ** https://github.com/Linaro/odp/pull/336 ** Patch: https://github.com/Linaro/odp/pull/336.patch ** Base sha: d96a8207591fbcaac25b79286d7d72a537354c1f ** Merge commit sha: 601b6c49aa37a7c95d2987a35e0c321177802840 **/ include/odp/api/spec/ipsec.h | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index c67954689..4f8748a61 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -69,27 +69,6 @@ typedef enum odp_ipsec_op_mode_t { } odp_ipsec_op_mode_t; -/** - * Protocol layers in IPSEC configuration - */ -typedef enum odp_ipsec_proto_layer_t { - /** No layers */ - ODP_IPSEC_LAYER_NONE = ODP_PROTO_LAYER_NONE, - - /** Layer L2 protocols (Ethernet, VLAN, etc) */ - ODP_IPSEC_LAYER_L2 = ODP_PROTO_LAYER_L2, - - /** Layer L3 protocols (IPv4, IPv6, ICMP, IPSEC, etc) */ - ODP_IPSEC_LAYER_L3 = ODP_PROTO_LAYER_L3, - - /** Layer L4 protocols (UDP, TCP, SCTP) */ - ODP_IPSEC_LAYER_L4 = ODP_PROTO_LAYER_L4, - - /** All layers */ - ODP_IPSEC_LAYER_ALL = ODP_PROTO_LAYER_ALL - -} odp_ipsec_proto_layer_t; - /** * Configuration options for IPSEC inbound processing */ @@ -125,25 +104,25 @@ typedef struct odp_ipsec_inbound_config_t { * * Select up to which protocol layer (at least) outer headers are * retained in inbound inline processing. Default value is - * ODP_IPSEC_LAYER_NONE. + * ODP_PROTO_LAYER_NONE. * - * ODP_IPSEC_LAYER_NONE: Application does not require any outer + * ODP_PROTO_LAYER_NONE: Application does not require any outer * headers to be retained. * - * ODP_IPSEC_LAYER_L2: Retain headers up to layer 2. + * ODP_PROTO_LAYER_L2: Retain headers up to layer 2. * - * ODP_IPSEC_LAYER_L3: Retain headers up to layer 3, otherwise the - * same as ODP_IPSEC_LAYER_ALL. + * ODP_PROTO_LAYER_L3: Retain headers up to layer 3, otherwise the + * same as ODP_PROTO_LAYER_ALL. * - * ODP_IPSEC_LAYER_L4: Retain headers up to layer 4, otherwise the - * same as ODP_IPSEC_LAYER_ALL. + * ODP_PROTO_LAYER_L4: Retain headers up to layer 4, otherwise the + * same as ODP_PROTO_LAYER_ALL. * - * ODP_IPSEC_LAYER_ALL: In tunnel mode, all headers before IPSEC are + * ODP_PROTO_LAYER_ALL: In tunnel mode, all headers before IPSEC are * retained. In transport mode, all headers * before IP (carrying IPSEC) are retained. * */ - odp_ipsec_proto_layer_t retain_outer; + odp_proto_layer_t retain_outer; /** Parse packet headers after IPSEC transformation *