From patchwork Tue Sep 26 22:00:06 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: 114295 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321479qgf; Tue, 26 Sep 2017 15:00:50 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDstAUaNnSnYICMQey1M03qrGzkL8/VF85+mO9qKnWgG+5lzImYYrWXwIU++X9mZdCjOpwl X-Received: by 10.36.176.70 with SMTP id b6mr8595031itj.26.1506463249804; Tue, 26 Sep 2017 15:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506463249; cv=none; d=google.com; s=arc-20160816; b=J57XtlN1d/W9LjrQSbELQo/ZWAC+zwBUXyCJ/aWg4nj/MjgtlxlWwuYa4eCs93wVjY 1uaabyKJGpA6h8ri0NenEc7HE9SwZwskIcD+U4gQZ1ddLDYE3OYdtS15XcwWzFWNwohm FiXp27LIwVNbreO57poMIMlu7sS7t/TLIu1scK6Mv0GpWbTKAubR4oVvR3qoyv9Edk5Z Mw21IPLh5xDPEAO+GL24WhBoiPrKcWUUOmuc4GvJUlgUVtp6n2XMZZB93+eDwU4vCpPJ RYvl+GdB2Pq8LtG0bB56VzIIrgdj/CSIhejO4vjklDKvlg7L+8lU5VXPwPdd5PmmTOqx /Vmw== 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=dJ+Wj9q+WYFDEp2aICPzRfvY4E8b50RRlNHS4qScIHg=; b=RUr3bdpvDlwoG3+m5h+GcJ0I+mCmC/oXWZYpDxOpOmfGNZsnka1S53uuf1VfMl+T+X PLImxc7QOS6M9D3+Tvvqarp956T/Q7HEwjY6yYMQJSwq7/MdL2EgMwdw3T1ZA/+l2Z0+ CbE1y1y0xpxfoWjsYbgevpmQbyObeXpm0rgVjaUOnQl+sCP6sLx4CcB2kWKYm0jYSIbl ajtcB0dmsh/F80vt7v4nKmPRFFy2lRH83ofqalUF8Xq2tsyt9eMet3s/YBnwffOkip32 dctFwWnDLFKs8kNzolOwa4in44yNJyFR86K0vd8SDvyP0b0Hz0BoHAQu5/5QRvx7P2KB xqBQ== 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 j6si2873724itg.123.2017.09.26.15.00.49; Tue, 26 Sep 2017 15:00:49 -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 58C5460AF8; Tue, 26 Sep 2017 22:00:49 +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,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 8929D60BF6; Tue, 26 Sep 2017 22:00:22 +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 5AB2F60BDB; Tue, 26 Sep 2017 22:00:19 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 5CA6D60A6F for ; Tue, 26 Sep 2017 22:00:13 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward106o.mail.yandex.net (Yandex) with ESMTP id B670D78506F for ; Wed, 27 Sep 2017 01:00:11 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id h3BDW0XZkV-0BLOwsJs; Wed, 27 Sep 2017 01:00:11 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id O8uW9Opcrx-0AE8soTf; Wed, 27 Sep 2017 01:00:10 +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, 27 Sep 2017 01:00:06 +0300 Message-Id: <1506463206-24370-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506463206-24370-1-git-send-email-odpbot@yandex.ru> References: <1506463206-24370-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 197 Subject: [lng-odp] [PATCH API-NEXT v1 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 --- /** 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: 95819aa488cc663c581240ea06626badf5321bd7 **/ include/odp/api/spec/ipsec.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 5631989fc..3e5f119c2 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. * @@ -932,6 +934,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,15 +1132,6 @@ 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 @@ -1146,7 +1142,7 @@ typedef enum odp_ipsec_status_id_t { * 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;