From patchwork Tue Oct 17 14:00:30 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: 116122 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4954481qgn; Tue, 17 Oct 2017 07:17:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCUUWbLBna9PebfJgEhIFqaUz2N3p1HrP70fcKtzaTtH46WzB+YVxZa6h8JLLA7MkA6H+6u X-Received: by 10.237.60.3 with SMTP id t3mr18322442qte.138.1508249834399; Tue, 17 Oct 2017 07:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508249834; cv=none; d=google.com; s=arc-20160816; b=XivMW/LGr9G8dEo1SIxyNNfgbFlG0Cl4oiplY7qKtPKXFsGB7ok3bomsIUCPQ8MFUQ OttNR+4KnaWzNBRAkunJUbcNI6guB7+RFQU/BArMCsbPUYw3KQ/zqwilRoJ8mFuXA4Ez 5oC+4fmqsU0Odnz3rJTmVsUhOZ8BYdenJsCGs3fJDFP54tU1hX+eyht4VLahHiodgnTp 5hZodQ6BuIUBlka7hsq/vtqczCMEKHEmEEpe3/kG6GHB+dIecmZ+vHuAJSL6fdfKChkv pcJ9TGd4IFBzZxYZ/vr1PFLvAn9XbIZ8csyoKpKSIiK7xeL30rGB5gSoIOafqDDESROS oQNg== 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=AG/MUbafRKZsCoYALEfY11ohL6Nxq5Y2nEitz+k/hsk=; b=Evt5z+xfBsKJuUednvSD7G1xnxrhUhxbdASM+g6RPZSIVJgshnJLjc0IQAEPWbVfcZ ZKm8vxAzRCpMdmOIAA2HMMgUrwIktWBbk4iWhSBvXZAf38wJdI0mXGB+5Ab8B6GpZdO2 8SW4RLhzx/vnh8+JzPcbZZv0k9vil6y0iavInXWld9dK5cA4OcGpQ1NUybNQGFM3eC/b FeLGCDb8X2dHyeuAQ7f83Cwx/aJ5sXEMFbXiOIQyR7fHzFMJqGgRIkW7yzL9hWSW8DZM 4J17zuR05ssfCVQeOn/R76szo1g2ACm/QwjYgmiBUWhDU8IFxe+TrP4zAnPhDczC7D5I 8YRg== 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 u127si698656qkf.280.2017.10.17.07.17.14; Tue, 17 Oct 2017 07:17:14 -0700 (PDT) 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 0A64762A9A; Tue, 17 Oct 2017 14:17:14 +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=-5.4 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 ECE7A62A43; Tue, 17 Oct 2017 14:02:24 +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 1A964628C2; Tue, 17 Oct 2017 14:02:01 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 8104D628BE for ; Tue, 17 Oct 2017 14:00:36 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 445111831C6 for ; Tue, 17 Oct 2017 17:00:35 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bnv9sinVC3-0ZvOdqiP; Tue, 17 Oct 2017 17:00:35 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id CaFu0Gwfbs-0YhCgMB0; Tue, 17 Oct 2017 17:00:34 +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, 17 Oct 2017 17:00:30 +0300 Message-Id: <1508248830-5010-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508248830-5010-1-git-send-email-odpbot@yandex.ru> References: <1508248830-5010-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 197 Subject: [lng-odp] [PATCH API-NEXT v7 1/1] api: ipsec: rework ODP_IPSEC_SA_DISABLE into warning bit 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 expected that platforms that are not able to support odp_ipsec_sa_disable() status result in a form of separate event will set SA hard expiry time to 0, submit a dummy packet to that SA. Then after receiving this packet after IPsec processing (which should result in hard expiry breach) odp_ipsec_result() will detect this packet through the combination of hard_expiry, size, contents, etc and will report it as a packet with odp_ipsec_warn_t->sa_disabled bit set. Signed-off-by: Dmitry Eremin-Solenikov Cc: Nikhil Agarwal Cc: Balasubramanian Manoharan Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 197 (lumag:ipsec_sa_disable_proposal) ** https://github.com/Linaro/odp/pull/197 ** Patch: https://github.com/Linaro/odp/pull/197.patch ** Base sha: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: 1a28502e0eea3c3c02d58f69ae46bb8b2818b5c0 **/ include/odp/api/spec/ipsec.h | 45 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 3bd80b266..f13a810ef 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -839,10 +839,16 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param); * * When in synchronous operation mode, the call will return when it's possible * to destroy the SA. In asynchronous mode, the same is indicated by an - * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. The - * status event is guaranteed to be the last event for the SA, i.e. all - * in-progress operations have completed and resulting events (including status - * events) have been enqueued before it. + * sa_disabled bit in odp_ipsec_warn_t. Warning can be delivered either by an + * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA or by a + * packet having this bit set in corresponding odp_ipsec_result_t instance, + * which is also sent to the SA queue. Which of the event types is used to + * deliver completion depends on the exact implementation details. This warning + * is guaranteed to be the last event for the SA, i.e. all in-progress + * operations have completed and resulting events (including status events) + * have been enqueued before it. The will be no more packets coming from SA + * queue. If the packet is used to deliver sa_disabled warning, there will be + * only one packet with this bit set. * * @param sa IPSEC SA to be disabled * @@ -923,7 +929,12 @@ typedef struct odp_ipsec_error_t { } odp_ipsec_error_t; -/** IPSEC warnings */ +/** IPSEC warnings + * + * For outbound SAs in ODP_IPSEC_OP_MODE_INLINE mode warnings can be reported + * only as status events. In all other cases warnings can be reported either as + * a part of packet result or via separate ODP status event. + */ typedef struct odp_ipsec_warn_t { /** IPSEC warnings */ union { @@ -934,6 +945,9 @@ typedef struct odp_ipsec_warn_t { /** Soft lifetime expired: packets */ uint32_t soft_exp_packets : 1; + + /** SA was disabled */ + uint32_t sa_disabled : 1; }; /** All warnings bits */ @@ -1129,26 +1143,14 @@ typedef struct odp_ipsec_packet_result_t { * IPSEC status ID */ typedef enum odp_ipsec_status_id_t { - /** Response to SA disable command - * - * Following status event (odp_ipsec_status_t) fields have valid - * content, other fields must be ignored: - * - sa: The SA that was requested to be disabled - * - result: Operation result - */ - ODP_IPSEC_STATUS_SA_DISABLE = 0, - /** Warning from inline IPSEC processing * * Following status event (odp_ipsec_status_t) fields have valid * content, other fields must be ignored: * - sa: The SA that caused the warning * - warn: The warning(s) reported by this event - * - * This status event is generated only for outbound SAs in - * ODP_IPSEC_OP_MODE_INLINE mode. */ - ODP_IPSEC_STATUS_WARN + ODP_IPSEC_STATUS_WARN = 0, } odp_ipsec_status_id_t; @@ -1162,13 +1164,6 @@ typedef struct odp_ipsec_status_t { /** IPSEC SA that was target of the operation */ odp_ipsec_sa_t sa; - /** Result of the operation - * - * 0: Success - * <0: Failure - */ - int result; - /** Warnings of an ODP_IPSEC_STATUS_WARN status event */ odp_ipsec_warn_t warn;