From patchwork Thu Jan 18 14:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124961 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp138305lja; Thu, 18 Jan 2018 06:02:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotpV3Hcvc7q5ESkXmcRZgpn/R39w8Pe8h/W4Js9Q3MAYu1eZBJg9RRvYixUf9OgYOFakbqX X-Received: by 10.46.4.15 with SMTP id 15mr3371659lje.64.1516284157537; Thu, 18 Jan 2018 06:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516284157; cv=none; d=google.com; s=arc-20160816; b=i8lxp2fHSLXakAdOzmgZCispkzyNmqHqRSPSGQkHLufkSealn9xldhlpMrcDSA0yvC DBJf+FI5vadATDD8XvGcj7IaRYggrFVUi46EOxeVOcRu4cUvu3Y7+dGEFXichEXCQ/Rx uYJrPhkNuqEwGOFXc8HDc4d567mpdjJCGOIwnvPnxvQ4BUzY8ekNDzPRG80N8m8EVBeO v7Q4ODDR6OWHIKs1WiBgxWYY4CMjHdGcD9eVgCAuCZQMyCqr3MJTbGAokzdJlTObhOm0 paz0VA7gA5s6v+5YWKnzY8Uu5TDO0Y4+0aqFAuRSE3sh+PBbmylAoYdylMSUA9iexras RsuQ== 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=Ww+u4dzIbUppu/NBpDTlqWX6HE8XiaAiUlpltklPVdc=; b=Et4J9tuQiwjn2lHH9ACUOPFlnMpVwHfC5IQMo4+GOlhwqVceuen8XIiHNH0S5ElgEw sn1LxLJ/J6OKCurg0rc0VJu+q8+HPkxSgBDFb3yp8GnfOpRa5/VDHw8kphlcx3sIrHT8 u1wVuQnPi54rv76qZsAKlB0CRYXPYIRX2NFYNaqfp7T6hGNL4sWLUV6bss3AyS3gbdFd Qg7ZbUTr8EajBATPRM68STB3N+WLyr27IhaO/b2/KU/fHDw3PzMy1xwo/6FSc+bErB6Z IzW3U4HTT0ol3OeiVgAV9aUZHz3UDs6l4SRGpQ4UQ2IMT8zTpjD0NB+lUCau0pm70Kpb Jb8A== 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 p41si5691440qta.81.2018.01.18.06.02.37; Thu, 18 Jan 2018 06:02:37 -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 E1FCE61802; Thu, 18 Jan 2018 14:02:36 +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_H2 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 219B6627DF; Thu, 18 Jan 2018 14:01:41 +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 CAD44627FD; Thu, 18 Jan 2018 14:01:37 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 620AF60B0E for ; Thu, 18 Jan 2018 14:00:31 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [5.45.198.18]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 76CCF5D83397 for ; Thu, 18 Jan 2018 17:00:29 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 71kFwIR8B2-0QWa2k2k; Thu, 18 Jan 2018 17:00:26 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dH7Jf5U1Ot-0JqmEahA; Thu, 18 Jan 2018 17:00:20 +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, 18 Jan 2018 17:00:09 +0300 Message-Id: <1516284012-2640-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> References: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v1 1/4] api: ipsec: IP header parameter types 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: Petri Savolainen Create IP header parameter types, so that those can be used also outside of SA parameter struct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: 14f0b7020e142ed747602a2856214c93e06ff84e **/ include/odp/api/spec/ipsec.h | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..f97e071a6 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -382,6 +382,44 @@ typedef struct odp_ipsec_crypto_param_t { } odp_ipsec_crypto_param_t; +/** IPv4 header parameters */ +typedef struct odp_ipsec_ipv4_param_t { + /** IPv4 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv4 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv4 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv4 Don't Fragment bit */ + uint8_t df; + + /** IPv4 Time To Live */ + uint8_t ttl; + +} odp_ipsec_ipv4_param_t; + +/** IPv6 header parameters */ +typedef struct odp_ipsec_ipv6_param_t { + /** IPv6 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv6 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv6 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv6 flow label */ + uint32_t flabel; + + /** IPv6 hop limit */ + uint8_t hlimit; + +} odp_ipsec_ipv6_param_t; + /** * IPSEC tunnel parameters * @@ -397,40 +435,10 @@ typedef struct odp_ipsec_tunnel_param_t { /** Variant mappings for tunnel parameters */ union { /** IPv4 header parameters */ - struct { - /** IPv4 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv4 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv4 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv4 Don't Fragment bit */ - uint8_t df; - - /** IPv4 Time To Live */ - uint8_t ttl; - } ipv4; + odp_ipsec_ipv4_param_t ipv4; /** IPv6 header parameters */ - struct { - /** IPv6 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv6 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv6 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv6 flow label */ - uint32_t flabel; - - /** IPv6 hop limit */ - uint8_t hlimit; - } ipv6; + odp_ipsec_ipv6_param_t ipv6; }; } odp_ipsec_tunnel_param_t; From patchwork Thu Jan 18 14:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124963 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp139248lja; Thu, 18 Jan 2018 06:04:29 -0800 (PST) X-Google-Smtp-Source: ACJfBos8aNYuqAI/2LRDn2E/kgblZNQA7e2usfRL1aFS1zBbuIZmO8wV+wsNgBJFrS4EwMVo8B5A X-Received: by 10.237.47.131 with SMTP id m3mr20733816qtd.201.1516284269256; Thu, 18 Jan 2018 06:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516284269; cv=none; d=google.com; s=arc-20160816; b=CQ8IkAQkmk1hCFrAvMhCsyLvPLU0dbUjDdb7uAJwyx3/+0PEsGqWw8caT6qTAN/GjT Sgv1nH+KvjGA9oYuv8uUoFhvuuQHEHCSErY+hkMNeBzgfgjHu2BT4f2QU1AhXI/HiWEY lTULXKSGPSctQRGgwc6oGc7fIUPN8dAedVjtN7N3zi+31Amp7xZsgpq0BGwqJJcPU34V hLwTKr/OHCcf5IV5peNu6DKNK03hJubWzsCigU3atpcuRKEZu/Vc8uKiPNwkS5S/Dtsh wHSxvZsOF7DMahKKKnrtuuFpzbf0dennqN+g1u71SPgkzN6vjQGRDvN7hm2faIUQZVs1 8PFg== 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=F7ANnbDA4AGabgwAGyKoATeZH7jUi+3fsuvdJjX8o6E=; b=n1BqqMOlEk31huj0Wr2fWaxK1yW2jwdh9kJRzdeei1g0bQY6DWrwAq2F7iDmyrY0sv vh28rpcaNs0qa002UL4DZbN7iviJsIgsxinlVZVuGR54+UrLKdtgP2J3BCzNnYvm+iav yXPtF7UOZuGk0uFqJ+9d8tzksx5I37ZWfJM9kBoQgWJncZSVlCjUs2Brnp+PIxLe6J0j XXW/CpW3cGLzo/G1fGnHkA+ZvSNBnns+SrRpOGoscTC7nLFPudSKIlYIj1BWophT+EnZ peMPFs7QRvFecGUDwabBWwsdxYSTuXEiG7E9Oy1z96do18P38AtdsWQinZnIz3pj7LyQ 6xBA== 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 q63si7636572qkl.36.2018.01.18.06.04.28; Thu, 18 Jan 2018 06:04: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 DA6BB62842; Thu, 18 Jan 2018 14:04: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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 272C8627FF; Thu, 18 Jan 2018 14:02:05 +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 8CAA8627A7; Thu, 18 Jan 2018 14:01:47 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id DEFE162787 for ; Thu, 18 Jan 2018 14:00:37 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 134AF78176E for ; Thu, 18 Jan 2018 17:00:36 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Hjsjc0FxNh-0ZUKciou; Thu, 18 Jan 2018 17:00:36 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dH7Jf5U1Ot-0TqqEOYq; Thu, 18 Jan 2018 17:00:29 +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, 18 Jan 2018 17:00:10 +0300 Message-Id: <1516284012-2640-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> References: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v1 2/4] api: ipsec: rename fragmentation mode option 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: Petri Savolainen Rename outbound operation fragmentation options to frag_mode. Frag_mode is used elsewhere in the API and "mode" is too generic term for it (not future proof). Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: 14f0b7020e142ed747602a2856214c93e06ff84e **/ include/odp/api/spec/ipsec.h | 2 +- platform/linux-generic/odp_ipsec.c | 2 +- test/validation/api/ipsec/ipsec_test_out.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index f97e071a6..471df6192 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -984,7 +984,7 @@ typedef struct odp_ipsec_op_flag_t { */ typedef struct odp_ipsec_out_opt_t { /** Fragmentation mode */ - odp_ipsec_frag_mode_t mode; + odp_ipsec_frag_mode_t frag_mode; } odp_ipsec_out_opt_t; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index e19907a5f..29e75fdd4 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1304,7 +1304,7 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, ipsec_sa = _odp_ipsec_sa_use(sa); ODP_ASSERT(NULL != ipsec_sa); - if ((opt && opt->mode == ODP_IPSEC_FRAG_CHECK) || + if ((opt && opt->frag_mode == ODP_IPSEC_FRAG_CHECK) || (!opt && ipsec_sa->out.frag_mode == ODP_IPSEC_FRAG_CHECK)) mtu = ipsec_sa->out.mtu; else diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c index 4751e6ec8..7dc7d2bc3 100644 --- a/test/validation/api/ipsec/ipsec_test_out.c +++ b/test/validation/api/ipsec/ipsec_test_out.c @@ -530,7 +530,7 @@ static void test_out_ipv4_ah_sha256_frag_check(void) ipsec_test_part test2 = { .pkt_in = &pkt_ipv4_icmp_0, .num_opt = 1, - .opt = { .mode = ODP_IPSEC_FRAG_DISABLED, }, + .opt = { .frag_mode = ODP_IPSEC_FRAG_DISABLED, }, .out_pkt = 1, .out = { { .status.warn.all = 0, @@ -623,7 +623,7 @@ static void test_out_ipv4_esp_null_sha256_frag_check(void) ipsec_test_part test2 = { .pkt_in = &pkt_ipv4_icmp_0, .num_opt = 1, - .opt = { .mode = ODP_IPSEC_FRAG_DISABLED, }, + .opt = { .frag_mode = ODP_IPSEC_FRAG_DISABLED, }, .out_pkt = 1, .out = { { .status.warn.all = 0, From patchwork Thu Jan 18 14:00:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124965 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp140320lja; Thu, 18 Jan 2018 06:06:49 -0800 (PST) X-Google-Smtp-Source: ACJfBosCYy9O4DU5yFf2fQHGO8bgGM1JLlXEggGc9Ks+SPc+SMznXaKXp+4Tg5a/UnjCog7iIQsf X-Received: by 10.37.10.67 with SMTP id 64mr3111635ybk.184.1516284408843; Thu, 18 Jan 2018 06:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516284408; cv=none; d=google.com; s=arc-20160816; b=Ffm0WZUq+vjQdTiXg4alZ2It7ydPYjU3l2tht2bFhJZmEjmE8CyAZ7KR5rawf1Mk4N 9/66rvOcHWo+xhmyPbY6bpzY9kSQm86REMPQJRHk8TV9FnoFFtXN/lmGJ9V2PnddESIc R+U51s8+VrCXoWhmQx9TQ6xuhBVOgw3MaJL5cqeFa8QnWFogs9lZ6hFGLGl/A7KspwCU ijpuSSfYc2RS6qLbVj5juwhsFnmZyq9VASrLMo7FOXzn+vdkQM0KewBmyRv/uH1dsVWr 5daalVcx51aNANb408f3xOyNNsRv1dH5kvcvPHlUbE1ak2HerZd9gBKMpjSc3NRKgiOR NfqQ== 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=slH0lsbBsKaAZOVOTSj0K78Jo1rVH1NVxk/UlPbWhzk=; b=PMCPqR9lI6y0Gv8DwLAF7fWJMsapHkTI0qdyu7H2hlVxqcFdXLDgad03T+lJ0uAf+z AFNImP2F5AotINolvR6GUg6+sIqfmCjwhbBNt3CiwUw4+bmD18LuvyuS0Ok0XpIxsfiO WwMhmbPrTEoKJAh/10NLvxsaUn9d06rAcVM+cFBQZ3/zzWPWmKFcdy570t2m1v5QnfLL kYSP+oUqVF3ilfaICHV1a6im5E3/t77iht4cMg9YbpBVFV3wa8GwQPwSy1zWkAbyNjil L6LMxwmJ3oBF0r1MFjeZFx2fxnPWdKODI8uOi6dLbAe1tcTvxOBUXpIBQRkFqFrufroK WwVA== 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 j1si1568798qkh.258.2018.01.18.06.06.48; Thu, 18 Jan 2018 06:06:48 -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 7AF116282D; Thu, 18 Jan 2018 14:06:48 +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 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 52DC062800; Thu, 18 Jan 2018 14:03: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 44D7C6280D; Thu, 18 Jan 2018 14:03:07 +0000 (UTC) Received: from forward1o.cmail.yandex.net (forward1o.cmail.yandex.net [37.9.109.84]) by lists.linaro.org (Postfix) with ESMTPS id 73FFD6278F for ; Thu, 18 Jan 2018 14:01:06 +0000 (UTC) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [77.88.29.85]) by forward1o.cmail.yandex.net (Yandex) with ESMTP id D299220CC5 for ; Thu, 18 Jan 2018 17:01:04 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id 853821A800AE for ; Thu, 18 Jan 2018 17:00:47 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dH7Jf5U1Ot-0aq0eG8r; Thu, 18 Jan 2018 17:00:36 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 18 Jan 2018 17:00:11 +0300 Message-Id: <1516284012-2640-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> References: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v1 3/4] api: ipsec: TFC padding and dummy packets 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: Petri Savolainen Specify how application can recognize/create TFC padding and dummy packets. At input, packet metadata flags for IPv4 and IPv6 indicate the if original packet was an IP or dummy packet. At output, application can use odp_ipsec_out_opt_t options to reguest addition of TFC padding, or creation of a TFC dummy packet (next header = 59). IP parameter override option is needed for dummy packet creation as there's no IP header to copy e.g. DSCP or flow label values. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: 14f0b7020e142ed747602a2856214c93e06ff84e **/ include/odp/api/spec/ipsec.h | 72 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 471df6192..bb09dd854 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -983,9 +983,55 @@ typedef struct odp_ipsec_op_flag_t { * These may be used to override some SA level options */ typedef struct odp_ipsec_out_opt_t { + /** Union of all flag bits */ + union { + /** Option flags. Set flag for those options that are + * used, all other options are ignored. */ + struct { + /** Use fragmentation mode option */ + uint32_t frag_mode: 1; + + /** Use IP parameters option */ + uint32_t ip_param: 1; + + /** Use TFC padding length option */ + uint32_t tfc_pad: 1; + + /** Tunnel mode TFC dummy packet. In tunnel mode, set + * this flag to create a TFC dummy packet. The flag + * indicates packet data (at L3 offset) does not + * contain an inner packet IP header. If SA is + * configured to copy IP header fields from inner + * packet, those fields must be passed with + * IP parameters option. */ + uint32_t tfc_dummy: 1; + } flag; + + /** All flag bits */ + uint32_t all_flags; + }; + /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; + /** Union of IP parameters */ + union { + /** Override IPv4 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv4_param_t ipv4; + + /** Override IPv6 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv6_param_t ipv6; + }; + + /** TFC padding length + * + * Number of TFC padding bytes added to the packet during IPSEC + * processing. Implementation guarantees that the padding does not + * contain any confidential information. */ + uint32_t tfc_pad_len; + } odp_ipsec_out_opt_t; /** @@ -1210,16 +1256,22 @@ typedef struct odp_ipsec_status_t { * * The operation does packet transformation according to IPSEC standards (see * e.g. RFC 4302 and 4303). Resulting packets are well formed, reconstructed - * original IP packets, with IPSEC headers removed and valid header field values - * restored. The amount and content of packet data before the IP header is - * undefined. + * original IP (or TFC dummy) packets, with IPSEC headers removed and valid + * header field values restored. The amount and content of packet data before + * the IP header is undefined. TFC padding may follow the IP packet payload, + * in which case packet length is larger than protocol headers indicate. + * TFC dummy packets have both IPv4 and IPv6 flags cleared, although L3 offset + * is set also for those. * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): - * - L3 offset: Offset to the first byte of the (outmost) IP header - * - pktio: For inline IPSEC processed packets, original packet input - * interface + * - l3_offset: Offset to the first byte of the original IP (or TFC dummy) + * packet + * - has_ipv4/6: Specifies if the original packet is IPv4 or IPv6. For tunnel + * mode TFC dummy packets neither flag is set. + * - pktio: For inline IPSEC processed packets, original packet input + * interface * * Other metadata for parse results and error checks depend on configuration * (selected parse and error check levels). @@ -1277,7 +1329,13 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * The operation does packet transformation according to IPSEC standards (see * e.g. RFC 4302 and 4303). Resulting packets are well formed IP packets * with IPSEC, etc headers constructed according to the standards. The amount - * and content of packet data before the IP header is undefined. + * and content of packet data before the IP header is undefined. Use outbound + * operation parameters to specify the amount of TFC padding appended to + * the packet during IPSEC transformation. Options can be used also to create + * TFC dummy packets. L3 offset needs to be set also for dummy packets, + * although packet data content is ignored. Payload length for the IPSEC + * transformation is always odp_packet_len() minus odp_packet_l3_offset() plus + * tfc_pad_len (when used). * * Each successfully transformed packet has a valid value for these metadata: * - L3 offset: Offset to the first byte of the (outmost) IP header From patchwork Thu Jan 18 14:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124962 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp138809lja; Thu, 18 Jan 2018 06:03:35 -0800 (PST) X-Google-Smtp-Source: ACJfBovQt4mnQ3rhlvWA8Q0/6aYtSXWdJHONXE5MespuRvbm1WQ0qYCM8AwaqodnHkIq/r1yLfIX X-Received: by 10.200.7.74 with SMTP id k10mr23513318qth.333.1516284215844; Thu, 18 Jan 2018 06:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516284215; cv=none; d=google.com; s=arc-20160816; b=oxADu1BpX+NZVn7+jmIQI5nBKKPtae22X4gWwN/LmIY41S1foiSFc1VrCJLsOPxBaY EgC35CK8JAwrlYxwjZhVfhk+ljLbpur4CuFVr9kvWKP8it6Rc8OyalyKoY+TqBy5P2oC 6miol9ltQEVVWUrN2lH0cVIMFb5FxQDfmw68Vveprv4SUFE+WxC5DNgAQq1fDcaKg7Dr EgYzo5AfVZ5e/bZ/MNAqnNzscZ45oWN/wkgVdPycexmjz6P7ZrsKiQVZeocsY+/w2OFd h9NUr8UeZjLaFVXPD4l9r5yjx5YR4hiAfEiGi3zVtx5/AK98LN3uPmnbOUCos/fMpp7x mn2A== 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=54gDb5obCG2i2YsYF7GlhAJazr07/0V5gyehIw70hBY=; b=RV7dI2RYI2BWTpkzl7lbiYEIBA+9ZMrhTZ6T2TQccus9Rg7mQ0bLncePvj1XpTGrk2 p70an0Kl8jkfhEEkW+TR9F9vjkXjzsnZn026anS4sJbhOmyHzuLqJe2hUT2z3tgf+OCG k99KJ7FgXedGwk3CzkhVdelysxsSKNPQXPp1UWW+HBU66Yq7SdJ4J2ks7/RvDCMQN8Ws JKLaYE/vNC9QLxnpD2o6eDKbA4Sf1RsAwNSjBuYckr7l0813ID3ZWt3tvUjZBdI9FKUU CtdVqeX7sIHYxxiCjTT3rRKnOlo+I5hwCua+MJ6hV8qwLyT+wQ6wFHlqiUVzGRClgD1i JiiA== 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 h12si7458490qtc.399.2018.01.18.06.03.35; Thu, 18 Jan 2018 06:03:35 -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 802E662820; Thu, 18 Jan 2018 14:03:35 +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_H2 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 A077662787; Thu, 18 Jan 2018 14:01:55 +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 32B00627BA; Thu, 18 Jan 2018 14:01:45 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 53D0A60975 for ; Thu, 18 Jan 2018 14:00:58 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 0794B1343054 for ; Thu, 18 Jan 2018 17:00:57 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jaIVmY5tMC-0uX8YpX1; Thu, 18 Jan 2018 17:00:56 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dH7Jf5U1Ot-0mqGKcTE; Thu, 18 Jan 2018 17:00:48 +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, 18 Jan 2018 17:00:12 +0300 Message-Id: <1516284012-2640-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> References: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v1 4/4] api: ipsec: inbound inner packet checksum capability 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: Petri Savolainen Add inbound inner packet checksum check capability. When e.g. L4 checksum checking is not implemented in HW, it may be better to leave checking for application, as it would check only those packets that need the check. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: 14f0b7020e142ed747602a2856214c93e06ff84e **/ include/odp/api/spec/ipsec.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index bb09dd854..8bafd007a 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -238,6 +238,11 @@ typedef struct odp_ipsec_capability_t { */ odp_support_t retain_header; + /** + * Inner packet checksum check offload support in inbound direction. + */ + odp_proto_chksums_t chksums_in; + /** Maximum number of different destination CoSes in classification * pipelining. The same CoS may be used for many SAs. This is equal or * less than 'max_cos' capability in classifier API.