From patchwork Tue Jan 23 15:00:23 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: 125535 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1811131ljf; Tue, 23 Jan 2018 07:07:47 -0800 (PST) X-Google-Smtp-Source: AH8x226fuf2HBkaSZQQI7d9cLz778L82D9MLgQX8iZb9phkXW25gv7m9jjo/+qOy0Gilief8cS1W X-Received: by 10.129.27.12 with SMTP id b12mr2644976ywb.489.1516720067573; Tue, 23 Jan 2018 07:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516720067; cv=none; d=google.com; s=arc-20160816; b=Ist1Rwqiiv9kiMeo9wlN2ATdnZF9YtulX6X9RxBpX2c1Y0fTWhjVPJiZtUxGG0tUIF TXJcyeeFzLLq5745JM9kH2C0ZNTwDCbfjnLm3Tnjw4pPbYc/KQZyplcbIu0LOlm88EoO 5X/QrhMNxOuPk6nEq2F5PT7sNk3Y0Va4303R3ktMR43AlE5yDNxuNFQCmS9KQ0Rx3b15 Ddj6mAxRDLGfQqtGE8wlS8mz+ZCSoFXpBsZa7uJslfQGkOHiNIlHsf/mJTqYjw0lgyHb VuVi+TnEim+EyVrJXZVPMS/lPfQMsg1jXMw7+dW8TCTgjuJpN0Ya9Ob+V3q/DbTgyoC3 Niug== 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=atVRCaPXp66BQQAitf+f65ht2l8/tlp/i0yGJYZegs0=; b=0TRBkzb261OX+vXCtfAPUYzjSM+m+LkgvwZL2qgaKhWHaeFW6qz5EWf0VWvx0UgVoD 0LrS0JUujiT412rhAjn4peKI8uvbkIeoSoV0fC+nTepRZRRzpTog2ABLXEHBVsox4dn9 LnkVd8LeLof6hfkcSo43HS/x9HV5a1IFjKdJqQ9n17uyKbJzPPV20a8zOmyLjLQ1lHDy t9Sf1N4cXgAlvbIq2Cf2BoKKaZx1CTrzMgLq3lktClet5XR8xrAcG3YQrrQ/aW32NVCZ lFK6AVa/irk/3DejU5ZSwKr6de8pvxaEqggOmH/5uaP9bAeZ9fQsUUQQUC7iG4g8NYWK cQag== 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 a193si2461782qkg.40.2018.01.23.07.07.47; Tue, 23 Jan 2018 07:07:47 -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 33DF9617D8; Tue, 23 Jan 2018 15:07: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 EAFDF617DF; Tue, 23 Jan 2018 15:02:43 +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 6543B617A5; Tue, 23 Jan 2018 15:02:17 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 9A2836176E for ; Tue, 23 Jan 2018 15:00:29 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 2B6D870388C for ; Tue, 23 Jan 2018 18:00:28 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4R10aCYZkH-0SWWW8H4; Tue, 23 Jan 2018 18:00:28 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IwkpSe7BuA-0Rdqdeg7; Tue, 23 Jan 2018 18:00:27 +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: Tue, 23 Jan 2018 18:00:23 +0300 Message-Id: <1516719624-9914-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516719624-9914-1-git-send-email-odpbot@yandex.ru> References: <1516719624-9914-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v2 5/6] api: ipsec: outbound 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 request TFC padding and dummy packet creation at output. Application can use odp_ipsec_out_opt_t options to reguest addition of TFC padding, or creation of a TFC dummy packet (next header = 59). IP parameter override options are needed for tunnel mode dummy packet creation as there's no IP header to copy e.g. DSCP or flow label values to tunnel IP header. 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: 44974a09b01c79adb9637a5dff38539598a76737 ** Merge commit sha: 537da7cd2083945c4673ac0dd7b29beb6825bce7 **/ include/odp/api/spec/ipsec.h | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 27ff16691..217447060 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -991,6 +991,21 @@ typedef struct odp_ipsec_out_opt_t { /** Use fragmentation mode option */ uint32_t frag_mode: 1; + /** Use IP parameters option */ + uint32_t ip_param: 1; + + /** Use TFC padding length option */ + uint32_t tfc_pad: 1; + + /** Tunnel mode TFC dummy packet. This can be used only + * in tunnel mode. When the flag is set, packet length + * and content is ignore and instead a TFC dummy packet + * is created during IPSEC operation. The dummy packet + * length is defined by 'tfc_pad_len' option. If the SA + * is configured to copy IP header fields from inner + * IP packet, those fields must be passed with + * IP parameters option. */ + uint32_t tfc_dummy: 1; } flag; /** All flag bits */ @@ -1000,6 +1015,24 @@ typedef struct odp_ipsec_out_opt_t { /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; + /** Union of IP parameters */ + union { + /** Override IPv4 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv4_param_t ipv4; + + /** Override IPv6 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv6_param_t ipv6; + }; + + /** TFC padding length + * + * Number of TFC padding bytes added to the packet during IPSEC + * processing. Implementation guarantees that the padding does not + * contain any confidential information. */ + uint32_t tfc_pad_len; + } odp_ipsec_out_opt_t; /** @@ -1297,7 +1330,13 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * The operation does packet transformation according to IPSEC standards (see * e.g. RFC 4302 and 4303). Resulting packets are well formed IP packets * with IPSEC, etc headers constructed according to the standards. The amount - * and content of packet data before the IP header is undefined. + * and content of packet data before the IP header is undefined. Use outbound + * operation parameters to specify the amount of TFC padding appended to + * the packet during IPSEC transformation. Options can be used also to create + * TFC dummy packets. Packet data content is ignored in tunnel mode TFC dummy + * packet creation as tfc_pad_len option defines solely the packet length. + * In all other cases, payload length for the IPSEC transformation is specified + * by odp_packet_len() minus odp_packet_l3_offset() plus tfc_pad_len option. * * Each successfully transformed packet has a valid value for these metadata: * - L3 offset: Offset to the first byte of the (outmost) IP header