From patchwork Thu Dec 21 23:00:39 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: 122610 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1516082qgn; Thu, 21 Dec 2017 15:09:23 -0800 (PST) X-Google-Smtp-Source: ACJfBovSwGDfwMu9G8fzvhlqSo0Gn4cGk3cI7I0EBRTc7MeGl3iBC1uy+1oo9vP/dNhmS2eHNY7N X-Received: by 10.200.10.129 with SMTP id d1mr17487264qti.209.1513897762983; Thu, 21 Dec 2017 15:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513897762; cv=none; d=google.com; s=arc-20160816; b=i6HMXb1Pm1BcuWufmzTvLXudrED5iq6Yu0jkNKSIAAZt4VXDlnKLznoXTPtForGf7p 70qfN07z7Qnv48zBf6MvH5QtsDvmWbp2/pKa87tJbOskyrqnXCRv03BvjwVuawKKrTux fc0XI5/+eVrdYGripQRXV6ufHb+iHXH1bV3sphqOf8rx1zRL7wq6NWAHuD2DCR29f1U4 F/SXBHSpVSkCZvpm9j6IvV/0kKmuIlMVyW/CJDPFPMIY43A6+OShalLxgCqqX4HvmjKi +K8fOz8n5ZmVGUqQ4kpTmmBr+sYiQwvrT3wlAgsQeS4PmNIYMmJvZNdzc84F3YT/N0rh jQ4A== 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=6ULAtK/e9HmbxfFmCwA25T5bpOzuZBI4AtIaXoREl5c=; b=FiL4s2wS0C8PJTeqM0z++2/yv1ahVe//z2/See0xZYIGnUGw1uWKZJND+/sBOUwlfq xj2qihXmEyWyFm/EEDa6MHovAaYiQaY0CpgMhDp7gEc5d3k9wLxHCilVYC8+EjOycR3i uU0OD8HVdnwabgtE6m6+wfPPpYV4s2Aw3fEiRsnZELdzA6MB4UsvKCArlm55wT188yV0 o4oBxSqAkxsn1lYfjipjUyPFoTuZ7t7mfsfXKO3wozyDLl7gQrxTkcZ2I85y52KfPtmB KcrnrZwRAZwmDWI20pOINNDNz0fGmUvEcS3ma4Twvuj6GtnpbHovKocaUmDGqwSxnBBw 05bw== 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 e17si6030173qki.137.2017.12.21.15.09.22; Thu, 21 Dec 2017 15:09:22 -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 A20A261515; Thu, 21 Dec 2017 23:09:22 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 52449616F9; Thu, 21 Dec 2017 23:02:57 +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 E9464616ED; Thu, 21 Dec 2017 23:02:50 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 8C40E61523 for ; Thu, 21 Dec 2017 23:00:42 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 8B9515D820A5 for ; Fri, 22 Dec 2017 02:00:41 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NJHDMjKvT6-0fNa2XfL; Fri, 22 Dec 2017 02:00:41 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eIQBj3oT7q-0fme8FNS; Fri, 22 Dec 2017 02:00:41 +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: Fri, 22 Dec 2017 02:00:39 +0300 Message-Id: <1513897240-21266-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513897240-21266-1-git-send-email-odpbot@yandex.ru> References: <1513897240-21266-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v3 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-tunnel 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: 177eeff39e19289e771119cfdffc515cb16f9db5 ** Merge commit sha: b3c4632b8d6f0fb1635f4ec9eedd9862b727f5a5 **/ include/odp/api/spec/ipsec.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..a6a622f13 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 */ + 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,12 @@ 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 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 +1281,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 for ESP-tunnel + * mode. 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 Thu Dec 21 23:00:40 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: 122609 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1515465qgn; Thu, 21 Dec 2017 15:08:45 -0800 (PST) X-Google-Smtp-Source: ACJfBotzjJD9yd7I1dVeS2ra7nmZb6MuQc26YHO0HbbbDf7GdmPk5PYVlbndTgIYi0zeQsF0gkmb X-Received: by 10.55.234.20 with SMTP id t20mr16665944qkj.131.1513897725600; Thu, 21 Dec 2017 15:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513897725; cv=none; d=google.com; s=arc-20160816; b=FH6iKcfcWmllIZWFggG/dj8KMJ45S/9InhZa9DUmSyA7OSCIQOyh0wgjjhYTohW8pD nyI7my0a4RXFzHA9FvO5vynYSQIMdL7P8DKoPiPzcpcTv6rzG4ZRwbaCvCRARmxRVqWT 4p7H1ScLmy7pfLtdOwwZ5WiwgASQAf5CAmlG9nuxBDhNzr69MptNCW6nuq6tPy8tnfZ+ my5/36pE1b1gtUtsYcBOFehAo2AyvzWD2+FU2QieV5wVYQQHOG8Up7BE2HoUQ+iAdX1X 7At3mPv+qf0v7ZCWhQAKqNohkCrL93UIpSCXVTwZYfoeYYkrNzuEagBSwBw98dt2WGFH y6fQ== 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=008e561wfMI0UVr+APEeej6WWsWDOfhLZnne0a5R6oc=; b=uMYbeuNlLZuUIf8gnigonY2mAH8zVwEIPt9ityZJ5MSpHEJ+22Dyb5lxeEhljsZ5vS 97LhZdUOklij/t87IM2RPrurWz0SmYOpzglRAoET58aZoV/MbfGHCeacfro78B/cx5P3 3QUFyai/gH5OubzqBFVjUEaN+W4u7lAHcHVIXO0jt4CT4tJfpJN1yWSU3+zFVWOU6l3/ Dn9h4WAOHBy94EK7RBSNqGJ9P4psI01D3EeW3mPVpbgAS9VuYOL+pmO1qVhuipx8YrBZ TGFZI0WIUXPt22MnJTP9GO8Ql2JLi9DWT2erR7UTM9Mz07dvRHIp9beZ7HvQMmFlmJXi QJRg== 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 j13si19454526qtk.228.2017.12.21.15.08.45; Thu, 21 Dec 2017 15:08:45 -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 4BF17616EF; Thu, 21 Dec 2017 23:08:45 +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, 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 E78CB61524; Thu, 21 Dec 2017 23:02:53 +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 9997261524; Thu, 21 Dec 2017 23:02:50 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 4637B61524 for ; Thu, 21 Dec 2017 23:00:43 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward101p.mail.yandex.net (Yandex) with ESMTP id F3BE36A82362 for ; Fri, 22 Dec 2017 02:00:41 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6b05x0aajv-0fcGJT3b; Fri, 22 Dec 2017 02:00:41 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eIQBj3oT7q-0fm4XtVM; Fri, 22 Dec 2017 02:00:41 +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: Fri, 22 Dec 2017 02:00:40 +0300 Message-Id: <1513897240-21266-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513897240-21266-1-git-send-email-odpbot@yandex.ru> References: <1513897240-21266-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v3 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 generation of this error is controlled by inline_tfc_packets_drop config field. Support for dropping or delivering TFC packets in INLINE mode is reported to application via inline_tfc_packets_drop and inline_tfc_packets_deliver capabilities. 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: 177eeff39e19289e771119cfdffc515cb16f9db5 ** Merge commit sha: b3c4632b8d6f0fb1635f4ec9eedd9862b727f5a5 **/ include/odp/api/spec/ipsec.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index a6a622f13..447d0c933 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -146,6 +146,13 @@ typedef struct odp_ipsec_inbound_config_t { */ odp_proto_chksums_t chksums; + /** Drop TFC dummy packets (NH=59) instead of reporting it via + * @tfc_dummy_packet error bit. + * + * @see tfc_dummy_packets_drop + */ + odp_bool_t tfc_dummy_packets_drop; + } odp_ipsec_inbound_config_t; /** @@ -242,6 +249,11 @@ typedef struct odp_ipsec_capability_t { * packets */ odp_bool_t tfc_padding_truncate; + /** + * Support dropping TFC dummy packets + */ + odp_support_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 +914,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