From patchwork Wed Jan 31 14:00:32 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: 126346 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp773416ljc; Wed, 31 Jan 2018 06:19:07 -0800 (PST) X-Google-Smtp-Source: AH8x2265RMWS3aoPdjhF1Ls993RhfatUaTbeJdOLDgRx4libwawM53yQ14e/83yF0rjKHx6wjHL6 X-Received: by 10.13.212.9 with SMTP id w9mr22633821ywd.483.1517408346988; Wed, 31 Jan 2018 06:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408346; cv=none; d=google.com; s=arc-20160816; b=IfuvW0J/XOzsYxvMOc3h56XBanbMX8cp2sdSfsPlu71sM6ulWgPLOFYoJryIARKYjA 4rV60MU0fWIfD6HRS1Xs4t57BKw6njVxnjLjtZOiwvh+kUOChZGwiEsRjRhL6UgfnW8q hCyOoVLUFf2WJyDq8dEQa9doTg/AQ83HMjhEdDVf/SZcwRNGUdCaUL9K6FVUGIgsC5Pm lLvOqtLOYpmVnRQ1cjdTu4GY6wGrpybiXPLKP5BWmsIDISZcbo9yjnX3Pjfe4YgzEN84 O1CA+UlnyjHxOJW0G4AfHFgPuEzlLKvGkNNY/GDUZPEhkj12zEMLAxK25xJMjYZBkRa+ DAwA== 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=aeEZMJbhcH4rOctKzMfk8q8AyIdm5vg9BzpRO1Y1KDU=; b=XyEEbuv1SqGrDsjTzOAqsd6zFy67KSYEbZQhV698dzFOeaNs6UoDQmcBF106txZ0zd 4dLDBMSUeaRYYrPhca1dtYAP4LhKGtFxDoChhsa9zcKmgpiD6WBBPUYhFbsoKDClFpOP AlXoUM7omjdGVynalBhtEOQPRDdG99bq93d0a2vSuBWeZ4bz6EDj5XVd+wZt3FgoNoUp 9u8yH5liP+5ccJzwcSF/R6KX+Bk3DTie1rBHgY2FyUzZCJTyyQxyDom+YNUq2JZFhg83 vpcgm8Qxyw+4Qje9jyFyhmkny3um278o2RPvpwPnP7MRCxH9xeOIYGd50aER8Czx2znp RaTA== 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 o14si2518373qke.428.2018.01.31.06.19.06; Wed, 31 Jan 2018 06:19:06 -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 950346176F; Wed, 31 Jan 2018 14:19:06 +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 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 957556179C; Wed, 31 Jan 2018 14:04:13 +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 7EAA9617F2; Wed, 31 Jan 2018 14:04:04 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 8005961799 for ; Wed, 31 Jan 2018 14:00:43 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 5E7B734C2D8D for ; Wed, 31 Jan 2018 17:00:38 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IfXdCFdcXG-0ciGP71E; Wed, 31 Jan 2018 17:00:38 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0bqGJ6fJ; Wed, 31 Jan 2018 17:00:37 +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 17:00:32 +0300 Message-Id: <1517407234-19273-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 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: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ 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 *