From patchwork Wed Jan 31 14:00:30 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: 126344 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp772023ljc; Wed, 31 Jan 2018 06:17:35 -0800 (PST) X-Google-Smtp-Source: AH8x226luz8ars2O4W42Yhq5eyRO75Ek+H6Ftr/dzJ9YDfkjaPYs3ilBt1whxrlvto16Bp+ArhCJ X-Received: by 10.200.6.208 with SMTP id j16mr49009753qth.166.1517408255675; Wed, 31 Jan 2018 06:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408255; cv=none; d=google.com; s=arc-20160816; b=RtACGi1/bCCMBJBQ8BLGTgzaSGMdZ46JNgzItYFur13v68srwQVuCqGrMXU3/FCZ3Z yenqn3Jcvu6DgJqsQw/oFze4HcfZWTWyzCf9CxBNwY/gvqjERmCFuDVEx0HwO5sX0Qk4 KRWSgpwA6U0IvvxMDuvpnQz2GSXUraHhaQE8U9X+GZp3xqvrQ+s+f+Uh4ldW1BG2Z9rE b4Ij9vcrdMm7W+NRmAUaxmnQXdEjp/2JpxQPrq0wt7RGieUccfS5ohQJ+JHgtnHqGSYx +Eqg91VgTrlvJstT/klL+hUSCP26QDMN/DljdNisVAtFA49U+O8TalilfC0cJHmDyG8Z L36A== 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=WzlkFlGMsJ7xLNIrgxFMFJUE32RCxi8FMw0i1zIIDc4=; b=PzVXUYe04ycXlXgVjvku0yaW8rPJd3LMOipt8mTAN6q7lxqf5H5UU7DioT3Aa6/y8Q o1vtH2/JYvucc592ErmlAKRKvfyhIsQUIKKkjr9LwuKPESBlecU9ZwuB90uhx/5RO2gC 5wAtbVG3c6MW3V8SrRgH1DvFIh16/webvZN9nxkrJ1mWoLHPit/Pe3T7e9mxr3++pI0p lcXVqAZnhSUjXlnOrVoPAkai2HrcdDm7vuluF/qFLZ8PJg7fv2cPl3Nqigngg61lAL0x JmvqDuUCtsMr+LUSXthsIkaL7/PovmSX42EVpCQAQAffKvSIPhTr4srZUegVJax8SEzj KZhg== 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 b7si369869qkf.424.2018.01.31.06.17.35; Wed, 31 Jan 2018 06:17: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 5785760C56; Wed, 31 Jan 2018 14:17: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 ADCF4617EA; Wed, 31 Jan 2018 14:03: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 56403617E2; Wed, 31 Jan 2018 14:03:22 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 7B93861788 for ; Wed, 31 Jan 2018 14:00:38 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 4B80942927 for ; Wed, 31 Jan 2018 17:00:37 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nNL3lfWtLg-0bwCxwLv; Wed, 31 Jan 2018 17:00:37 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0aqSwNUB; Wed, 31 Jan 2018 17:00:36 +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, 31 Jan 2018 17:00:30 +0300 Message-Id: <1517407234-19273-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 3/7] 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: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ 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 c78afbe3f..1060a3ee2 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 b6192377e..9f08b228c 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1306,7 +1306,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 971fbbf8d..4940efa5a 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 Wed Jan 31 14:00:31 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: 126345 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp772933ljc; Wed, 31 Jan 2018 06:18:32 -0800 (PST) X-Google-Smtp-Source: AH8x224hWVdOUqbm4AXjZDrCR09qoXGsMHHXpwfrQH4iHRBphjH2ki1HVDTsLYekHB2TNggmZRtN X-Received: by 10.37.208.66 with SMTP id h63mr22121783ybg.35.1517408312291; Wed, 31 Jan 2018 06:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408312; cv=none; d=google.com; s=arc-20160816; b=psEIxDWSPtyrrTnaaNVVYYOU1hDb092k8zm6M7FjpWn8jJt+DIaLSYWHctpXU1k6M7 d8iCXaAXo8dsoKjxqSeMrDxa2C1dM9D4RDWYqMR9LG/wLkpc57hJOsLsmSdAtWVAGQ8T IxHIhvnF+Wuhfn1IJZQ4vbad/Oil/KEZsqohnofpPCqPTbXDoTzcmvLbzH89NO9HZHXm CHSVHQuhWKE7AhX1Qz0Aqy9r4JcQsqxLcPho9GGy8EdsQuqtotjmsc/SlRl4erSYn2GJ 8s6trrKEBWsYKgXupWk0HohO4C6292FomeaQMCY+HlK6aSBJZlOI8xtVPkJItamXOLc2 mocw== 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=IHQl4kIxdRtdPYbXOStiifQcrmQIZEPrhxETbbmXflg=; b=CfQP5TrzP+xSMICDaxfNSetfE18zoG8zUsI9piwI+K1jdtjtVy8ZR1Qo4A7a0ZFD86 +rdTGkS5YWveCYn9ziGa6jgaGqHGydOOW07EL6LI79MZR2CXB2HKwFVt3LmOt/2h+LpH iX1BBJdtdGyc4Y8VPdMAVPTf0xE3cStbHZIUH+rWh5urIR61i1jphUkK6c8Nyz/Rgqrt 1kU5eIiC4zFyuX6gQ4yRye2Lu+BbpxBAqHKVJgTxisppf6EuUezxF0ilPInpW0zTWipC vUNzmTLrPCewe7WIKWaAUtBdZN+fKvzVw+3NHHJbd/49LDnjmJDlIO03kUs/or2tKzOB dyWg== 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 j2si596487qth.448.2018.01.31.06.18.31; Wed, 31 Jan 2018 06:18:32 -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 BA215617D7; Wed, 31 Jan 2018 14:18:31 +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 31900617EE; Wed, 31 Jan 2018 14:03:47 +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 6A3BF617EE; Wed, 31 Jan 2018 14:03: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 02C636178E for ; Wed, 31 Jan 2018 14:00:39 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward102j.mail.yandex.net (Yandex) with ESMTP id C79FF5601B36 for ; Wed, 31 Jan 2018 17:00:37 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9WXNr0JhvL-0bfSYSSn; Wed, 31 Jan 2018 17:00:37 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0bqO8I2t; Wed, 31 Jan 2018 17:00:37 +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, 31 Jan 2018 17:00:31 +0300 Message-Id: <1517407234-19273-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 4/7] api: ipsec: outbound operation option 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: Petri Savolainen Add flags to select which options application uses. Currently, there's no ambiguity, but as soon as there are multiple options implementation needs to know which options are used and which are ignored. 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: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ include/odp/api/spec/ipsec.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 1060a3ee2..08533d80d 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -983,6 +983,20 @@ 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; + + } flag; + + /** All flag bits */ + uint32_t all_flags; + }; + /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; From patchwork Wed Jan 31 14:00:32 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: 126346 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp773416ljc; Wed, 31 Jan 2018 06:19:07 -0800 (PST) X-Google-Smtp-Source: AH8x2265RMWS3aoPdjhF1Ls993RhfatUaTbeJdOLDgRx4libwawM53yQ14e/83yF0rjKHx6wjHL6 X-Received: by 10.13.212.9 with SMTP id w9mr22633821ywd.483.1517408346988; Wed, 31 Jan 2018 06:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408346; cv=none; d=google.com; s=arc-20160816; b=IfuvW0J/XOzsYxvMOc3h56XBanbMX8cp2sdSfsPlu71sM6ulWgPLOFYoJryIARKYjA 4rV60MU0fWIfD6HRS1Xs4t57BKw6njVxnjLjtZOiwvh+kUOChZGwiEsRjRhL6UgfnW8q hCyOoVLUFf2WJyDq8dEQa9doTg/AQ83HMjhEdDVf/SZcwRNGUdCaUL9K6FVUGIgsC5Pm lLvOqtLOYpmVnRQ1cjdTu4GY6wGrpybiXPLKP5BWmsIDISZcbo9yjnX3Pjfe4YgzEN84 O1CA+UlnyjHxOJW0G4AfHFgPuEzlLKvGkNNY/GDUZPEhkj12zEMLAxK25xJMjYZBkRa+ DAwA== 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=aeEZMJbhcH4rOctKzMfk8q8AyIdm5vg9BzpRO1Y1KDU=; b=XyEEbuv1SqGrDsjTzOAqsd6zFy67KSYEbZQhV698dzFOeaNs6UoDQmcBF106txZ0zd 4dLDBMSUeaRYYrPhca1dtYAP4LhKGtFxDoChhsa9zcKmgpiD6WBBPUYhFbsoKDClFpOP AlXoUM7omjdGVynalBhtEOQPRDdG99bq93d0a2vSuBWeZ4bz6EDj5XVd+wZt3FgoNoUp 9u8yH5liP+5ccJzwcSF/R6KX+Bk3DTie1rBHgY2FyUzZCJTyyQxyDom+YNUq2JZFhg83 vpcgm8Qxyw+4Qje9jyFyhmkny3um278o2RPvpwPnP7MRCxH9xeOIYGd50aER8Czx2znp RaTA== 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 o14si2518373qke.428.2018.01.31.06.19.06; Wed, 31 Jan 2018 06:19:06 -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 950346176F; Wed, 31 Jan 2018 14:19:06 +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 957556179C; Wed, 31 Jan 2018 14:04:13 +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 7EAA9617F2; Wed, 31 Jan 2018 14:04:04 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 8005961799 for ; Wed, 31 Jan 2018 14:00:43 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 5E7B734C2D8D for ; Wed, 31 Jan 2018 17:00:38 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IfXdCFdcXG-0ciGP71E; Wed, 31 Jan 2018 17:00:38 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0bqGJ6fJ; Wed, 31 Jan 2018 17:00:37 +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, 31 Jan 2018 17:00:32 +0300 Message-Id: <1517407234-19273-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 5/7] api: ipsec: inbound 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 TFC padding and dummy packets at input. Packet metadata for L3/L4 protocol type indicate if the original packet was an IP or a TFC dummy packet. When packet length is larger than protocol fields indicate, some TFC padding remain in the packet. 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: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ include/odp/api/spec/ipsec.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 08533d80d..721f96856 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1226,12 +1226,23 @@ typedef struct odp_ipsec_status_t { * 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. + * undefined. Some amount of TFC padding may follow the IP packet payload, + * in which case packet length is larger than protocol headers indicate. + * TFC dummy packets have l3_type set to ODP_PROTO_L3_TYPE_NONE in tunnel mode + * or l4_type set to ODP_PROTO_L4_TYPE_NO_NEXT in transport mode. Dummy + * packets contain implementation specific amount of (dummy) data. Furthermore, + * inline IPSEC processing may drop dummy packets. * * 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 + * - l3_offset: Offset to the first byte of the original IP packet. The value + * is implementation specific for tunnel mode TFC dummy packets. + * - l3_type: Specifies if the original packet is IPv4 or IPv6. For tunnel + * mode TFC dummy packets set to ODP_PROTO_L3_TYPE_NONE. + * - l4_type: Always set to ODP_PROTO_L4_TYPE_NO_NEXT for transport mode dummy + * packets. Otherwise, depends on parse configuration. Default + * value is ODP_PROTO_L4_TYPE_NONE. * - pktio: For inline IPSEC processed packets, original packet input * interface * From patchwork Wed Jan 31 14:00:33 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: 126353 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp779195ljc; Wed, 31 Jan 2018 06:26:00 -0800 (PST) X-Google-Smtp-Source: AH8x227udN1W/qZv9+JuIEsy3mbnQEWM7rOks8pCkQ+5piCBUD9GCSqiYTdzY23XuI/o4AHG35YR X-Received: by 10.129.78.16 with SMTP id c16mr21368270ywb.98.1517408760354; Wed, 31 Jan 2018 06:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408760; cv=none; d=google.com; s=arc-20160816; b=VLm3avDVi3VN5ortg4/EighN1zdZ9EkJS5gCu809Lq3LjgAzQqVN/Al5xGy6an+JPd smIOai0ZiyiHo5Bh2rISBorBanw4KDSL0qwDy05ry/Dk309aF+tKuRM/pXzpCIZLIDAt 16vUYPlX1+jfEdte0Up768sv8HKuOLJDvl6Yx09ApJnifMeLFgroKY+uhOSmh62lkdkH CqKcqz0R4HREhaxqWu8M6MRCNafwYzQMajJQHoIryiOOxGDGY9NDDOUbRW5HNQf6NAml u2F+L/LTaZ/zjmLbZ3xTg54BOY4SKsZaMfHjPsuFW1xT1AJhe/rzDqq0t1tga0UF4lpn zHvA== 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=k7xC+es+9kSRZfK/JnfedsuKg1i4MyUDKpp9XKHMIRo=; b=Uzyn9Fu8cj6KymiDK7u8uG6ZFMKP8eFyri+bwbuwW+/MK6f5SeQPlubCuduuEyWwns FC0VWwZcnodiD9LqwNl8Ivd0tXJwslBgH+Tz0ej5g2h/YzoGKUN3tGXuMjJ6ExdbbryD rRiYRqZNpRx3BBC3c3IC+lYp5/jLG+C+Ra9TY5XWXpyO0pNWAZCLWvntlYFbkpoqfF+Q eqlP8DOOlxt9olhWuE0epHRjfleRY9lsPZGl7P0udXDQgVAv5w7OVVl5B2toyfia1Vq/ MGsUo7/jRw/Y1jqx6Hq7G7aKJk2J92i4kBxnQWxIA98TOgbhJ6E3TNYOV245h5ZbOfOl fnEQ== 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 r6si3818289qti.330.2018.01.31.06.26.00; Wed, 31 Jan 2018 06:26:00 -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 ECFD7617DD; Wed, 31 Jan 2018 14:25:59 +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 1C44B61813; Wed, 31 Jan 2018 14:07: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 CB0C161813; Wed, 31 Jan 2018 14:07:07 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id CA6BB617CC for ; Wed, 31 Jan 2018 14:01:46 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 83311185AAE for ; Wed, 31 Jan 2018 17:00:39 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rDz5J4DLYR-0d2CIx0B; Wed, 31 Jan 2018 17:00:39 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0cq8eMFE; Wed, 31 Jan 2018 17:00:38 +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, 31 Jan 2018 17:00:33 +0300 Message-Id: <1517407234-19273-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 6/7] api: ipsec: outbound 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 request TFC padding and dummy packet creation 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 options are needed for tunnel mode dummy packet creation as there's no IP header to copy e.g. DSCP or flow label values to tunnel IP header. 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: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ include/odp/api/spec/ipsec.h | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 721f96856..665dc07bc 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -991,6 +991,22 @@ typedef struct odp_ipsec_out_opt_t { /** Use fragmentation mode option */ uint32_t frag_mode: 1; + /** Use TFC padding length option */ + uint32_t tfc_pad: 1; + + /** Tunnel mode TFC dummy packet. This can be used only + * in tunnel mode. When the flag is set, packet length + * and content is ignored and instead a TFC dummy + * packet is created during IPSEC operation. The dummy + * packet length is defined by 'tfc_pad_len' option. + * If the SA is configured to copy IP header fields + * from inner IP packet, those fields must be passed + * with IP parameters option. */ + uint32_t tfc_dummy: 1; + + /** Use IP parameters option */ + uint32_t ip_param: 1; + } flag; /** All flag bits */ @@ -1000,6 +1016,26 @@ typedef struct odp_ipsec_out_opt_t { /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; + /** TFC padding length + * + * Number of TFC padding bytes added to the packet during IPSEC + * processing. Resulting packet should not exceed the maximum packet + * length of the pool, otherwise IPSEC operation may fail. + * Implementation guarantees that the padding does not contain any + * confidential information. */ + uint32_t tfc_pad_len; + + /** 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; + }; + } odp_ipsec_out_opt_t; /** @@ -1302,7 +1338,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. Packet data content is ignored in tunnel mode TFC dummy + * packet creation as tfc_pad_len option defines solely the packet length. + * In all other cases, payload length for the IPSEC transformation is specified + * by odp_packet_len() minus odp_packet_l3_offset() plus tfc_pad_len option. * * Each successfully transformed packet has a valid value for these metadata: * - L3 offset: Offset to the first byte of the (outmost) IP header