From patchwork Thu Dec 21 17:01:00 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: 122595 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1165241qgn; Thu, 21 Dec 2017 09:15:09 -0800 (PST) X-Google-Smtp-Source: ACJfBou60JeFamtDNS9iMJgmXlu1946qv/sG48j19GEUV+zdr6r4J7HLypRVm5T2K97fZzBnPz5r X-Received: by 10.200.20.19 with SMTP id k19mr15266372qtj.189.1513876509056; Thu, 21 Dec 2017 09:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513876509; cv=none; d=google.com; s=arc-20160816; b=nhNLEw9YjGo1E0BSAXd+1lE9IH2AEv4BYR9x69hV2lApN3aZjjO8Ee1m863FrCnFWA ljmT0qruxdQX85x1bVW6AswLzAOrNI6HQoyfbh7oPgAeU+Fgp+hEYEW1QTzaX9mvt1QK nGHfk2ENfNIK6+wImwyvIyUniPr0pus+SEtffk6o0bLPHa+qT7dbKmMixHBxgL4opY/H W7un0+5iXS+KfYhArKDP9i1u7iWVBcuPnbTb6TQUEk/XrmaUjh9XpvulxT2ohPTAgbsD gxnUHadFUAD93I+w8wJTj+gYEPcSo7F4wY8Ni77qCvfFnspVIsMdaiW0sDC3FDCkIKR1 zXmg== 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=clE8LZ6IPLndMfXnYmAT/+PhbXDKEPX9DqDRZrI/t/8=; b=D4MCRz8ZDellQUiWeZBQoIJorgUUmob/AffcRIXp7hVwaFyJc1oqbLFY15FvmZMpnA k4soDpJOK7sLXg1+8XJ51b/UM4ElNPBxjr79V8e4FHIyYpdBWWO3achFIrzgdaWQDgqc dRYwnENOxiOt+AJgGRbLjfHjle6QqYkymTFSlcEZjn4nVi0sNmJ8g0XaptWwX09MXaUq 3LpG0owRKsgMLJBjvAXMro4bwSilkkNew/vO6tnQV8+7+77n19BV72Ek2d0ux8zcB9bE MxRn4QUclzVWCdRMIYfnNibE3O3U1GPbEQAASD+1YCqCfVT/EXR9IBfxRzvhI62Wsq3N yE4Q== 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 g64si7489030qkc.206.2017.12.21.09.15.08; Thu, 21 Dec 2017 09:15:09 -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 C519E61523; Thu, 21 Dec 2017 17:15:08 +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 48F6060A6E; Thu, 21 Dec 2017 17:03: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 281E960960; Thu, 21 Dec 2017 17:03:38 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 219BE60C5E for ; Thu, 21 Dec 2017 17:01:04 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward106j.mail.yandex.net (Yandex) with ESMTP id E4D2A180465C for ; Thu, 21 Dec 2017 20:01:02 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pIj5CO43gK-12O4A30A; Thu, 21 Dec 2017 20:01:02 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7SZIOcAQPz-12leto9T; Thu, 21 Dec 2017 20:01:02 +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, 21 Dec 2017 20:01:00 +0300 Message-Id: <1513875661-25412-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513875661-25412-1-git-send-email-odpbot@yandex.ru> References: <1513875661-25412-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v2 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: c38fc105f0e9a88dd4ebb4d9e7ac9e1160466322 ** Merge commit sha: d554b8508bc74d27b4459a1d4cbb3cd84fc1f1eb **/ 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 538472a5e..3e11e09f1 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -259,6 +259,10 @@ typedef struct odp_ipsec_capability_t { */ odp_support_t retain_header; + /** Implementation will automatically truncate TFC padding in received + * packets */ + odp_bool 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. @@ -1209,6 +1213,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): @@ -1274,6 +1284,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 17:01:01 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: 122594 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1164526qgn; Thu, 21 Dec 2017 09:14:30 -0800 (PST) X-Google-Smtp-Source: ACJfBotNnBilVgAO5bLYXfAr8ku3QT+A1+paI/nqR0aNNXpkDsuqddU6tIjZ34HUH4LUpvz38D0M X-Received: by 10.237.34.202 with SMTP id q10mr16371496qtc.341.1513876470301; Thu, 21 Dec 2017 09:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513876470; cv=none; d=google.com; s=arc-20160816; b=ZX4zewDHF5OpSB5nHTSrzT8gREajH5BDKC4Kxv/8WexNCz172vkBLSVXuIiExyYW0t yyCdMx9zYwgj5I3E1jhU8LMQJ6yWPkgAkw317RegFmmIeYFT9Qhi8nEvoJfgu9g9ty9T nqX5kE4KhHrCsw3ZpveIIB6IrgBj1YNi8gN1Jrczs0FIWl6/6sXNwaPScpwbhb0Gyb3t mKRLOh/071zuTUcJt5L6ScahVA3z+uQgSmIhqdGhdf33kZsesexkWnlkvLyi4zr220Mi SnwELAyzv1dU3p31Rt7MZhlazhjH15yp0ZyvGd4a278TN6RjoDAW95azyqcOLI+zMbw9 R/0A== 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=jZYgDJsu2svFeMpCyJ86pMOSJWLl8ulfp76DplxcvyU=; b=hZJMgMOSPXL1D4+8wDcHWbAFYrqWhVGE6rxG3udSHKlCjN2Zt7JWLaWun76eqDb/tF x2WaAB3LWpfbEqEM0VE6ySSr1r1CkSy5BoYzdHhK/rfzMTzUoypelOsGVuc6hSlM3BU4 Qk73ZzhLf4DULxOnlBi2yUe6ccX+WzUvwKSET3/pe4mmlm/Z+PXMUnCfKIKoBZpYH3Bb UqHHuNxtFaUnEskJFuvUloFcDeeCkEyhBYhhfD1eD80nF6jCNorsGdhU0BpRzv4c12Ay zUP1p+W6Vh1vectz/cjje5XTZxJY2AIrr0tkQNCiKLCtaGA9vwgI/hFpocztw2KZ6n/m qJlw== 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 x35si1856455qte.182.2017.12.21.09.14.30; Thu, 21 Dec 2017 09:14:30 -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 EF374616EA; Thu, 21 Dec 2017 17:14:29 +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 0813B616F8; Thu, 21 Dec 2017 17:03:50 +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 EA69D61508; Thu, 21 Dec 2017 17:03:35 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 962DF6150F for ; Thu, 21 Dec 2017 17:01:08 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 977E32184943 for ; Thu, 21 Dec 2017 20:01:03 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id F1fryIJu2b-13mGlrTG; Thu, 21 Dec 2017 20:01:03 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7SZIOcAQPz-12lu1t5H; Thu, 21 Dec 2017 20:01:02 +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, 21 Dec 2017 20:01:01 +0300 Message-Id: <1513875661-25412-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513875661-25412-1-git-send-email-odpbot@yandex.ru> References: <1513875661-25412-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v2 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: c38fc105f0e9a88dd4ebb4d9e7ac9e1160466322 ** Merge commit sha: d554b8508bc74d27b4459a1d4cbb3cd84fc1f1eb **/ 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 3e11e09f1..e20935c02 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -167,6 +167,13 @@ typedef struct odp_ipsec_inbound_config_t { */ odp_proto_chksums_t chksums; + /** Drop dummy packets (NH=59) instead of reporting it via + * @dummy_packet error bit. + * + * @see dummy_packets_drop + */ + odp_bool_t dummy_packets_drop; + } odp_ipsec_inbound_config_t; /** @@ -263,6 +270,11 @@ typedef struct odp_ipsec_capability_t { * packets */ odp_bool tfc_padding_truncate; + /** + * Support dropping dummy packets + */ + odp_support_t 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. @@ -905,6 +917,9 @@ typedef struct odp_ipsec_error_t { /** Hard lifetime expired: packets */ uint32_t hard_exp_packets : 1; + + /** TFC dummy packet (NextHeader = 59) */ + uint32_t dummy_packet : 1; }; /** All error bits