From patchwork Wed Oct 11 02:00:11 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: 115482 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp221441qgn; Tue, 10 Oct 2017 19:01:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCiHa+5tOjGsX7UObmxisLAZU84L/FFwRrISaFSBT3o3knYUbbPP2j7awLCS9vSVMvdyywg X-Received: by 10.31.208.196 with SMTP id h187mr7979020vkg.61.1507687283232; Tue, 10 Oct 2017 19:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507687283; cv=none; d=google.com; s=arc-20160816; b=qhQgGepRHRJz1ANzbEXNhGEAJMhldPXITsw341VDWwr2qc4JNwYgcFkokD3VepaZTZ QF3TbJ9VJE/Yk8xwvgV9YBP0lm7ND9FIBxab4xlXrybfydqXPTbsrVyhKLp28GayMPIr DIDvA1HGafRGtm3H5zNSo07OKgqUQpTfLqk1d+/Ig862GV4d8z2bnqvdYZJb7qDrSLBx KnUGHMHo9RNkM/yvhTem/yx6l/HUjPorklZnMKdchkS3gV2GK3/gAkUhQrm/vs83DiiH GnQIPU9u+4+Lb14rVFz8WQzzUTuALwhCVcDZ4l95ZBsRzRFh3ISHBDXMAMye5lbIY9nK MbQA== 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=K4bDLYW4NPG+PThR3s3aFWzyV6dHXBXTngzuPM4RFZs=; b=fmwBktZNBsPQEIETrAtla15x/9Sgjz37y1Nt3dS1AtyC4/7SBe6NeEkz8rIwCe7LiL 287yOrsePoa5UXmD8AlpmALdEmiFxegUuewkWNU8mMtUcHXFSr64si2JLXYxUSeJMYLn +VpP4/42C83DCKkqIIdyU51wKWVOVb208x/ejM9iM4d351LaxCtdrsGOBGbfrsuIZMN0 tm4DmmlZLQ31olQfY01LcrP+ZJPjz5Ax0ZcahaivPuKUENdeLvkQ9pLWCMnMoAue7rAV fOR63/17juDVldFUhLVysuOaQd+Rg6eEOgC0HK6IVfUrOKkRq74i0Dh/kzeeFpzyCXcv CVYg== 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 f69si3231443vka.184.2017.10.10.19.01.21; Tue, 10 Oct 2017 19:01:23 -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 285A160C18; Wed, 11 Oct 2017 02:01:20 +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 B3A8B60973; Wed, 11 Oct 2017 02:00:48 +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 BDBDE607B9; Wed, 11 Oct 2017 02:00:45 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 15AD96080D for ; Wed, 11 Oct 2017 02:00:44 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 4A218588361A for ; Wed, 11 Oct 2017 05:00:42 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WXSqjWuk5K-0goOvoXF; Wed, 11 Oct 2017 05:00:42 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wuTwjgHInr-0fH4kNG4; Wed, 11 Oct 2017 05:00:41 +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, 11 Oct 2017 05:00:11 +0300 Message-Id: <1507687211-32147-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507687211-32147-1-git-send-email-odpbot@yandex.ru> References: <1507687211-32147-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 197 Subject: [lng-odp] [PATCH API-NEXT v5 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: bf803098eb1518dfb9e719071256fe22700b8c72 ** Merge commit sha: 3a4b74654b98e9189d8d81ac7cc7ff68e629a7c5 **/ include/odp/api/spec/ipsec.h | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 3bd80b266..bd62875ef 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -839,8 +839,10 @@ 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 + * 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. + * 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. * @@ -923,7 +925,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 +941,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 +1139,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;