From patchwork Thu Jan 18 21:01:04 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: 125047 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp297396lja; Thu, 18 Jan 2018 13:06:48 -0800 (PST) X-Google-Smtp-Source: ACJfBosDH+cmoQ6fc5S3wqNe+Oon3XI76cNpK7DTMdQDoPrRCIdp9k8qau5shhLH1zt+GxgAQOcd X-Received: by 10.200.65.16 with SMTP id q16mr64607391qtl.4.1516309608280; Thu, 18 Jan 2018 13:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516309608; cv=none; d=google.com; s=arc-20160816; b=wbFsOfVcSrvJXt01z9uJSOeNrDY/z60xkVEkoRfl9HjtnMVeKLgN9q77Zr3ztRIvht WXaB38iYzON0YO/S7se6rjysm4ky43NeX76NWeWSetNk4XIZ9jrn7+BHsM2y+fAFbgqM ol2qorgLcDLiQ+mudoFk/qBLcK45rzGvLVHE3vQMQWIjsoktTrj5jw5GwHbShRDuX3jg 4+WNpwSdtzE9QmMznIdZMKMIS6LKgfwb0f3RUl2pWQ9pyF54bZ1CNBfwQzNElm17kRzI jMiBdVkrsoZXPLKPwp7kqXOOO4N7xxbso9bQXuVYn4BelzI7FXfE5wduTNoIyatMSQrk H8Ww== 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=UEXGkNKqpimq8mvTnNi47SLoZSsU8mo948dHs1N56k8=; b=sFkWIygL6ckh6VYuLQNmSLHChjVbOfkPSreZfo7GNzxNYwXo8iiepnoIKCyrcEATdd Z1y6nlIj0NYKki4m0rIk5b0hkMQfGZbxt+wXVQW2rDhetD3r2fCjloJ7GUpNx2MBO4/L 9WNzajQ1w4dg/1NY/JyvQsZHIg3877H4y3TbxJr7dptmgnfjZGzHicxSQRYygYcd/a/I mCjoAXNaf28ZngQhhDXhzGFLjNi7TYVgNuFxVaPBJB51McKYgV5Vpf+hI3TkAnESjybY aGqZzg68QTKE6Kb6Q3R751S5LCrG/KJKrBzGIzg1Mjstb9ikgvVXXKvFbVgNike37/UX IRqg== 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 d9si6899340qti.285.2018.01.18.13.06.48; Thu, 18 Jan 2018 13: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 F06376282A; Thu, 18 Jan 2018 21:06:47 +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 F0AF5627E6; Thu, 18 Jan 2018 21:06:23 +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 DE3C3617A2; Thu, 18 Jan 2018 21:01:32 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 562F06177C for ; Thu, 18 Jan 2018 21:01:23 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 137975A02018 for ; Fri, 19 Jan 2018 00:01:22 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id oibAdFfegf-1LxKMrp4; Fri, 19 Jan 2018 00:01:21 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Vpf07sbqyH-1L28gjtF; Fri, 19 Jan 2018 00:01:21 +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, 19 Jan 2018 00:01:04 +0300 Message-Id: <1516309265-14238-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516309265-14238-1-git-send-email-odpbot@yandex.ru> References: <1516309265-14238-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v9 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: e77675624b9cfcd6ea83d11804ed0715b7fad2ec ** Merge commit sha: 826bb522f15d045761edd504aebd310a81b4b238 **/ include/odp/api/spec/ipsec.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..bf278d73e 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1206,6 +1206,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 unless IKEv2 + * ESP_TFC_PADDING_NOT_SUPPORTED notification was used. The resulting ODP + * packet will extend beyond the end of the IP packet it contains or the + * resulting IP packet will extend beyond the end of the IP payload protocol + * (for tunnel or transport cases respectively). An ODP application can detect + * and remove such padding by inspecting the length fields of the relevant + * protocol headers in the result packet. + * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): @@ -1258,9 +1266,11 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * - L3 offset: Offset to the first byte of the (outmost) IP header * - L4 offset: Offset to the L4 header if L4 checksum offload is requested * - * Additionally, input IP packet length (odp_packet_len() minus - * odp_packet_l3_offset()) must match values in protocol headers. Otherwise - * results are undefined. + * Additionally, input L3 packet length (odp_packet_len() minus + * odp_packet_l3_offset()) must not be smaller than the IP packet lenght + * indicated by the IP header. Otherwise results are undefined. If the input L3 + * packet length is bigger than the IP packet length, the additional packet + * data is used as TFC padding. * * Packets are processed in the input order. Packet order is maintained from * input 'pkt' array to output 'pkt' array. Packet order is not guaranteed @@ -1271,6 +1281,12 @@ 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) unless + * ESP_TFC_PADDING_NOT_SUPPORTED notification was used. Such padding 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 Jan 18 21:01:05 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: 125052 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp298128lja; Thu, 18 Jan 2018 13:08:39 -0800 (PST) X-Google-Smtp-Source: ACJfBouFCpTGta0ryKNilP3rTeDWpgOA2qU43XLJNTt6ZKxCG4F6Sc/CBbF8QwNZdeuaw736i8jE X-Received: by 10.200.43.193 with SMTP id n1mr14195424qtn.20.1516309719198; Thu, 18 Jan 2018 13:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516309719; cv=none; d=google.com; s=arc-20160816; b=j1XOebGf+HDtXCXpNiZ+rGqZLMKfycADO+h95lJ0EWbehKh4g3W37pqnbAoxtBOUVz 3W43g7PPwMfM+K1qAqS6XNP2roiGHewQtL3mLAj7cJEse/5CeYGCSok9x4heLLlVRGVo zSC3zNkQYnGYXmXTArp7b3L0b24G6jMSlJlMJ5Cw9QoJk9ey+ueiFSKlhvKUwHUSHKlm +gtnpFpBVlixDiZFqnQbeq2Af44lpvur+ou9umiPWgJo6Klj1A0c2Sg+sjoaSosyYg/z 5wAkYCWZ9W7WaWqLdjiCKggiUmOqjBNoGz/Vb5seyf+PDFZfUWJKDo4pPkl+iJ8lZo60 HbkQ== 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=e8VWNoOR9CBNrjaf07Lf6BQLP+dxeX5hubnDgBxJbiM=; b=EgXERwM/j490UCbNRlaSjOe34woOVo6cBg2eDr7wcijFUnhv/I3baQuEDwK+CxTb4f PJV0R0rUAq1/8id+gRY8QAAYxqGUlHHtjcqTt7W9sIJ+r0Qt1nLq1z8/EjoECrsmMnpN gLye3Ue3yn/xcOddnTxt1mMw9mpizBlIHCJYe9uOs0WpVQv5QHBY2eVQ0v7TiO1U7I82 jhLtkduEOyiPkQvmcmn7hmPmDB1kYs2atiMD3cq0WUcwPZgOonW9UW1Os5OrE8qwq5iP R9fEq1N+vQS2rFCzPbcpVC/RnAIg24QONdxisMLGJL8o0wrykIJwMXMyhBtgXRfY64wX F2vA== 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 k3si143319qth.125.2018.01.18.13.08.38; Thu, 18 Jan 2018 13:08:39 -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 D2AA16284C; Thu, 18 Jan 2018 21:08:38 +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 E6ADE6283F; Thu, 18 Jan 2018 21:07: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 9C04B6151E; Thu, 18 Jan 2018 21:01:50 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 4A95560C5E for ; Thu, 18 Jan 2018 21:01:36 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward104p.mail.yandex.net (Yandex) with ESMTP id AC8BE185414 for ; Fri, 19 Jan 2018 00:01:22 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WC8M9KHEmn-1MMe9CkS; Fri, 19 Jan 2018 00:01:22 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Vpf07sbqyH-1M2i2qRZ; Fri, 19 Jan 2018 00:01:22 +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, 19 Jan 2018 00:01:05 +0300 Message-Id: <1516309265-14238-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516309265-14238-1-git-send-email-odpbot@yandex.ru> References: <1516309265-14238-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v9 2/2] api: ipsec: document usage of IPv4/IPv6 flags on inbound 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: Dmitry Eremin-Solenikov Document usage of IPv4/IPv6 flags on inbound packets. Provide special case for TFC dummy packets, which are marked by both flags being cleared. 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: e77675624b9cfcd6ea83d11804ed0715b7fad2ec ** Merge commit sha: 826bb522f15d045761edd504aebd310a81b4b238 **/ include/odp/api/spec/ipsec.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index bf278d73e..b44320137 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1217,9 +1217,12 @@ typedef struct odp_ipsec_status_t { * 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 (outmost) IP header + * - IPv4/IPv6 flags: These flags can be used to determine packet contents. + * If neither IPv4 nor IPv6 flag are set, received packet is + * TFC dummy packet and should be dropped by an application + * - 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).