From patchwork Mon Jan 8 17:00:36 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: 123749 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2973512qgn; Mon, 8 Jan 2018 09:06:49 -0800 (PST) X-Google-Smtp-Source: ACJfBovHnnOieAtrhbS0MuZ7ZxsNgGO7s8CHZF7hu4Gmz37U+RMMMhpzVvlXVraDZsIZllCMMC6y X-Received: by 10.37.84.6 with SMTP id i6mr10094863ybb.495.1515431209048; Mon, 08 Jan 2018 09:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515431209; cv=none; d=google.com; s=arc-20160816; b=PSYUOA+qpTVKOmxeTVL+hJHReX/uMvMjJjV75257xRhvFZGX4tDia3GVe/D4hZE/uJ 2LAUm+sxTnrluVnMgHhaT0QQ+NiU7BjipUQ/MOF6Cx8cSLtLWxyuvnYEC8MdiINinjAP y7+tFtQn1xo+UvINO/0TAf8l9jJ85iy5v1mp/TkFr+EkDQ+r3XZtZr2CrJCylUeTmVxF 37+Imk+MzAuC90emFZQgwAJDy1iizp6Jinhx5XXD9QtXcPkpisMhW/iokcP2wF90m5K4 WNPJJz10GKHYa2G7GGQQpCvTJf52qV4gTN/lYPXGKirnQWd2AuKkhL+ZqOCP7NbW12b4 LAtQ== 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=akrJppkkOtUB3FEZYlbl5yOak9WXKrelN2K3r9zAsCQ=; b=bQTxiCk7ikgX2Z/SClTpHAVdJ1gMrLdyIXi6SQ4eEAaw4shO+vYanvb7s0d4tJAeq8 Ccnhn+X/m5D6pfoLs4A2CdVOK0lV5nSN9Zk4kJwJXVLb3OtKwuIyeHob9WreBbROy1mN jUyhYbELJtVw6+QchBv7cZyx59K3hfG5OLCNqiiQZo5TOeX77JbyJ/ho2cP1RKMEPYff GschyJ7xdrZC/jR1uX+6M1ms43ajg7atzQEQNOk8jlOEA5nUTGD3WXg5LGDzrMeROZSa OVnmxSAQoS0njM2J7RP4IhWjzeC9agkQsnZLxv/WTcissERyWfEBX9XTKN1URbpXWiyr C4mA== 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 s16si1613711qth.32.2018.01.08.09.06.24; Mon, 08 Jan 2018 09:06:49 -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 7069261756; Mon, 8 Jan 2018 17:06:24 +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 C4CE761761; Mon, 8 Jan 2018 17:01:07 +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 3DD3E61734; Mon, 8 Jan 2018 17:00:48 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 9DEB261523 for ; Mon, 8 Jan 2018 17:00:40 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 722B634C33CD for ; Mon, 8 Jan 2018 20:00:39 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id o9X8JbeRdD-0d4OdIS0; Mon, 08 Jan 2018 20:00:39 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id g6Q0lH2sLu-0dJmuaJE; Mon, 08 Jan 2018 20:00:39 +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: Mon, 8 Jan 2018 20:00:36 +0300 Message-Id: <1515430837-17818-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515430837-17818-1-git-send-email-odpbot@yandex.ru> References: <1515430837-17818-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v6 1/2] api: ipsec: document TFC padding usage 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 It is possible to include TFC padding into ESP packets. Document usage of such padding according to RFC. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 329 (lumag:ipsec-tfc) ** https://github.com/Linaro/odp/pull/329 ** Patch: https://github.com/Linaro/odp/pull/329.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 52e02806dd3cade37d6594389c800c0f3610a267 **/ include/odp/api/spec/ipsec.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..3728e2e26 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -238,6 +238,10 @@ typedef struct odp_ipsec_capability_t { */ odp_support_t retain_header; + /** Implementation will automatically truncate TFC padding in received + * packets in ESP tunnel mode */ + odp_bool_t tfc_padding_truncate; + /** 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. @@ -1206,6 +1210,14 @@ typedef struct odp_ipsec_status_t { * restored. The amount and content of packet data before the IP header is * undefined. * + * Additional TFC padding might be present after packet contents. For ESP + * transport mode ODP does not truncate such padding, it up to an application + * to detect and drop it. For ESP tunnel mode, received side can use total + * (IPv4) or payload (IPv6) length from internal headers to drop such TFC + * padding. If tfc_padding_truncate capability is set, implementation will + * truncate received packets automatically. Otherwise ODP application has to + * truncate packets manually. + * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): @@ -1271,6 +1283,11 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * with IPSEC, etc headers constructed according to the standards. The amount * and content of packet data before the IP header is undefined. * + * Additional TFC padding might be present after packet payload (see RFC 4303 + * section 2.7 for the list of requirements). It should be filled by + * application before submitting packet to ODP. Such padding will be included + * into encrypted packet. Receiver side will skip this padding. + * * 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 Mon Jan 8 17:00:37 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: 123748 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2971946qgn; Mon, 8 Jan 2018 09:05:42 -0800 (PST) X-Google-Smtp-Source: ACJfBouwKQKd45CbcbLesfm5lvPWZVl1qevA14ZSBd87/qBunc6BUxkNkokgaW1hURjQ7rjuQELA X-Received: by 10.129.177.131 with SMTP id p125mr11069894ywh.362.1515431142155; Mon, 08 Jan 2018 09:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515431142; cv=none; d=google.com; s=arc-20160816; b=kP1ku+9cxhTh7Fk/0DYYd/x5eRkujql08Q2bDJuHIECQxca85IcjsC1m3jQF0rkeg+ NUTlmcrnc/Mju5zofuzTM/1bhu8DKRTgr5s4b7WM1hbymlsQofXgWtm0bZafxkl1V/8L TfkGoac+UyIYCLiZoW6wAYDAR0WGnFY/VfDmaHMz7KpOTJvIYh6x5oy3j5RR3QaXYBSe RggFrih9/PAGDJ68n+Gkkzgo402WrY5Gyk2RUfYTQDf/6RU2oHsQZRnJHrEuF6gMQCtC GuzBPz83DQv6IPIMFJhX2XZ8s+ViJzx35YlYSx+lmE8pUCBG3AsXMm2hRrVayo2E+Ihj s3Vg== 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=T3IwHvJ2lqnvO4jSYqY1eM3YZdNXxJ+z+KeYkmJLL90=; b=NI4WYu/sm1DbPhseoCeazH3EEf8KEQwlYkUUCq+z82lS49EDRKmNjv0yajFppijpWn UtEgWnOQIFQbZHJRAdw1Y3VN24pBXepQ2yvOSADtWqK7n7YgZnmuv6PHPRnVE2rBr2Lp UsC1xR4mjp7RHi24wPWSDuVlzPRHaehChsg5ULRECqS2EPtQ2DhYiFDwKndCZXrbE0JC +YHN6vy3BgTPGh5Kq7Q0znGLt8c0/y25jMUEXvAcN0yvYfjwQ6w9NxBKQi+BkUveksfW WrpgDcfR2TC5rwYzPk1gUGf9jcPAmXKYZbBbkjcgER/FttFnnIkX3sD4F5CBktLOEw49 cEuA== 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 x66si5110673qkb.388.2018.01.08.09.05.35; Mon, 08 Jan 2018 09:05:42 -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 9FD0161774; Mon, 8 Jan 2018 17:05: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_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 6D7DC61765; Mon, 8 Jan 2018 17:01:02 +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 0495361747; Mon, 8 Jan 2018 17:00:46 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 35BCB616D9 for ; Mon, 8 Jan 2018 17:00:41 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward106j.mail.yandex.net (Yandex) with ESMTP id E53F318031E3 for ; Mon, 8 Jan 2018 20:00:39 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4ZnLmcYGQr-0d08g8ho; Mon, 08 Jan 2018 20:00:39 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id g6Q0lH2sLu-0dJCjYik; Mon, 08 Jan 2018 20:00:39 +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: Mon, 8 Jan 2018 20:00:37 +0300 Message-Id: <1515430837-17818-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515430837-17818-1-git-send-email-odpbot@yandex.ru> References: <1515430837-17818-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v6 2/2] api: ipsec: support TFC packets reception 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 Add error bit used to report TFC (NH=59) packets. Such events MUST be generated in SYNC and ASYNC modes. In INLINE mode implementation tells to the application if it delivers or drop such packets via tfc_dummy_packets_drop capability. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 329 (lumag:ipsec-tfc) ** https://github.com/Linaro/odp/pull/329 ** Patch: https://github.com/Linaro/odp/pull/329.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 52e02806dd3cade37d6594389c800c0f3610a267 **/ include/odp/api/spec/ipsec.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 3728e2e26..696a59b7a 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -242,6 +242,11 @@ typedef struct odp_ipsec_capability_t { * packets in ESP tunnel mode */ odp_bool_t tfc_padding_truncate; + /** In INLINE mode drop TFC dummy packets (NH=59) instead of reporting + * them via tfc_dummy_packet error bit. + */ + odp_bool_t tfc_dummy_packets_drop; + /** 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. @@ -902,6 +907,9 @@ typedef struct odp_ipsec_error_t { /** Hard lifetime expired: packets */ uint32_t hard_exp_packets : 1; + + /** TFC dummy packet (NextHeader = 59) */ + uint32_t tfc_dummy_packet : 1; }; /** All error bits