From patchwork Wed Sep 27 22:00:07 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: 114378 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5544062qgf; Wed, 27 Sep 2017 15:00:56 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCLEDCoiZ3TEBHkgn6hTOOypvNzzYhkASn82VKkrwZKbP+A7ZXqid7rMcRMeHMh/0y/jk7f X-Received: by 10.107.180.70 with SMTP id d67mr4116549iof.150.1506549656503; Wed, 27 Sep 2017 15:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506549656; cv=none; d=google.com; s=arc-20160816; b=Gd5jfP8h2aSPtQ4LwaKplau5hFrXpLEBv8bpyvrHlhTI6tXyA/OS2GCeCu2IXxE+LK FfSSLLJIMqLfBFR5U4ocDrra5rQf3QYJxJCRK/2hydKMUF7PXtPizGvNnLPndNFk8sOB VN31F0vR16rDgYZRdem5iSCH+AXAnWSh3qQbIYuXFGbsYeu1D94vceEaeVg8EptrhhMT NF/4nZbRkUOZcoEwiS9zPaRPBfaoTbZaD3yzup4mjg7yAQFeUB4vcK0uKXdePCrB4e3s UxGMf55HSBMX0CyVgHZUXYL7SXjYMoR/8H6XOuRw+7zGicdKEOEh4V7V19o+CFpPCrcp Lc9Q== 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=/vPfV0KfPRFLC0Z1E7sorx0msRFa672gKXleyGzVP9A=; b=P+bpamp8v3ehcgQTHUVE8D+yOHgYVnd3BJThxWMd1w0jj2Wun09lQvZkQ0bSOp9/SC U38A16neDYRANGl2cY1PJ2LOd0s9GL4XC2MiiE/0IPsb9NWV+anniEQCNqVGz+OjDoZ6 jgQ0+/fP38KxO6OTOMhAB2pHCRtpusmi8XHNfiKrPhLpyO7XxxRarGzBeGpJK8Uxk+Vm nabgu//arn0H9xtaLj1Dn5JgQxghXb/1hC6lEQ3EInFmTWyqjkxVHpgoagf7/iogF5P7 Zt7DprrwyUFmLr9xYePe5uN6VKlomQ3VruyavlBWMZ13lMGzCCI+ZLfe62BUGGU37IXC wxfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s10si10439048iod.201.2017.09.27.15.00.56; Wed, 27 Sep 2017 15:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 DB2D560C2C; Wed, 27 Sep 2017 22:00: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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 22CDA60C11; Wed, 27 Sep 2017 22:00: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 2C6C5609DA; Wed, 27 Sep 2017 22:00:21 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 4A8E26067B for ; Wed, 27 Sep 2017 22:00:19 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward100j.mail.yandex.net (Yandex) with ESMTP id EFFE85D8325D for ; Thu, 28 Sep 2017 01:00:16 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Gv16Qttsr5-0GqKnp4t; Thu, 28 Sep 2017 01:00:16 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id na3VtmAeJG-0GwenW1e; Thu, 28 Sep 2017 01:00:16 +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: Thu, 28 Sep 2017 01:00:07 +0300 Message-Id: <1506549607-14913-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506549607-14913-1-git-send-email-odpbot@yandex.ru> References: <1506549607-14913-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 197 Subject: [lng-odp] [PATCH API-NEXT v2 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: e04e5f90df69e3031622b77fb5273b85d47eb966 ** Merge commit sha: c1d876d980198dbe01269d43937fdb5b5a3a9792 **/ 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 5631989fc..846b18ebf 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -837,8 +837,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. * @@ -921,7 +923,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 { @@ -932,6 +939,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 */ @@ -1127,26 +1137,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;