From patchwork Wed Jan 31 15:00:17 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: 126361 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp812493ljc; Wed, 31 Jan 2018 07:04:56 -0800 (PST) X-Google-Smtp-Source: AH8x225lrJgMD+yGpUrtZMdRz+kmr0NjI/E/nYavX4bOrU0pD2ZQd+sGkqiuixnZFFm+zCQIms+B X-Received: by 10.200.41.220 with SMTP id 28mr28033885qtt.159.1517411096221; Wed, 31 Jan 2018 07:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411096; cv=none; d=google.com; s=arc-20160816; b=Ls9gOx7TdasW+hTLO7VSdxjJm8gvz/g0a3omrlLVheq0TW8aD+0Znv1j65btvZnlhr A+vYqb9LHOLFuutRRFXPOBC2BQTevB036Uf9f8e0Rhz8VjU7+Gun89iSZ314px3zQn+I tj69akMWz7/ZM6pDMwnIS/iNyQratuXTdNA1HkDtH3I11O6PxDRrNhzJM2KhsGHzADOO iqLy7yPXI+ed/bP5/4ovWYe3XSkOsGHij7n3HQrjMRBGozEq65p0VrPMSJ5VtmtAlxOK 27L4mnzX4vqpldSzuKnaiMVSE6PeY9P0ucvD6/aRP0HGh6A3Fs9JYHonA5/WXZDU99Ti tY1Q== 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=fu+p7gS7cX5CVAS4l0KNcyjf8FwL6GeYQWX2niuWvr8=; b=wG9j+uk2BNtR4tSds6oej6gipaMsLAXAQilPgXNee29zFbSb7mI1RegUvvjFP72pbA /o6fTcMGuQEmiHlJGytrLYTqM7kH6Yyl2ZB0X4Ni14f+vW5vgQT05UPwKATDv4hu7sV0 AS95blSgvSjC2XS8oNlxBB2l29Og6HFLjfsB4vAcipVIyKUnfsa0+6pbkfzZzy3Xw3rX Bem4vmHVm0bhW6LnIEfWupSUl9Do2zTlZIqzTFho0oJYEKK8qOnkF+jw3phEvfs7tnf7 n3q+nvc+RQBH+yIYC0ZMyd/7cOuIRNtPaDFXCUSte6pR229zSYDLg/xX1TOYbj6zkGnB VsCw== 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 j128si2434066qkf.377.2018.01.31.07.04.55; Wed, 31 Jan 2018 07:04:56 -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 D05256174D; Wed, 31 Jan 2018 15:04:55 +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 A14776150B; Wed, 31 Jan 2018 15:01:00 +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 6055960956; Wed, 31 Jan 2018 15:00:36 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 3D00D6083D for ; Wed, 31 Jan 2018 15:00:24 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 19DF14083290 for ; Wed, 31 Jan 2018 18:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id wGBloTGP1O-0M9iuI6c; Wed, 31 Jan 2018 18:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0Mhm6hFW; Wed, 31 Jan 2018 18:00: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: Wed, 31 Jan 2018 18:00:17 +0300 Message-Id: <1517410819-24732-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 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: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ 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 *