From patchwork Thu Oct 12 01: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: 115576 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1358705qgn; Wed, 11 Oct 2017 18:01:27 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCmrFwRTrbeBoNET2hEqm4nLjfh9CPB+DVhzA/9areMLVOjUt50Ui4g79YiXzcT5Xy6vG8H X-Received: by 10.107.131.147 with SMTP id n19mr1103413ioi.87.1507770087675; Wed, 11 Oct 2017 18:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507770087; cv=none; d=google.com; s=arc-20160816; b=qhfp4fzSGFrhINH/K+jnY893RUyFFHn91qJuWhY7tufYxOLlDlArHxBqWdJ/aqCGkV KNZVfvjHFGeiRd4VabgueiQy6gs1Ofx2uG7BYe7STNJagLkgOF3F7trmE9JQbY6qUZ1X rQg78XJBqopgzP+3touYELKyFn3a02O8U5apNBSFA1XZFjE+klH6Fg50aFmzL09dH5vx C6QbMjq3Dzl5Yyt+21OvbuNdICfV+H/pRe4es3dJdolhBY3tkxjQmcKgxdIJCwG5qPPk vl4+XID81q1HErtqNJxv6PRw5kwdVIPLWmfNXg0Lo1669F/Gb0ESxV1LCAeMyoy/fiUM d6gw== 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=WOXYBsNGUBWi8SucSZtS64EwOMNc8GRaFvJKSOK2hWQ=; b=0Hj+SX5avbyDJMoayiiw9Nhm/32HbAS0EdJI6Nf1dHZ33rHrDd7OjKkjXoAlc7R/aU n3rgvbfD75q4eiy8UDY0UQbYLG5Q24xJFfo2QMsK/O6h9S9ySMgBgsFp/l/UQ7IyK2L0 mmvjayy5+fbVnQDRInrdkglUodgbbjkdtemKMwvOqhU12APAdUfDcDdEXMgT4DxfQYiL U9MAztS4gt267kbx4xfKAbxUlHt7V0GNe45GtsK8OsDExeP8Ni+wTjX8tWcRdwmxg6wg 5Jq1FrNQagz6TkuBg5ZGixbaRD1+MzqV8wocSffw2n3r7ig2tOXj7faggJxJ44/OWm8v j03g== 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 y6si11739709itd.183.2017.10.11.18.01.26; Wed, 11 Oct 2017 18:01:27 -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 36E2560A0A; Thu, 12 Oct 2017 01:01:26 +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,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 233C76092C; Thu, 12 Oct 2017 01:00:54 +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 EC0C660856; Thu, 12 Oct 2017 01:00:51 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 5DADC6084F for ; Thu, 12 Oct 2017 01:00:50 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward101o.mail.yandex.net (Yandex) with ESMTP id D18F2134242C for ; Thu, 12 Oct 2017 04:00:48 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rnnIzkhcSu-0m1aQnoi; Thu, 12 Oct 2017 04:00:48 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id z4ggOo7tKw-0mm4CLFh; Thu, 12 Oct 2017 04:00:48 +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, 12 Oct 2017 04:00:07 +0300 Message-Id: <1507770007-15957-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507770007-15957-1-git-send-email-odpbot@yandex.ru> References: <1507770007-15957-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 197 Subject: [lng-odp] [PATCH API-NEXT v6 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: 60a1a4f1cc531d7f0117cd79daf1cbe4206e12ef ** Merge commit sha: d9f4c01b8bc64ca94b5efee6e33be711c423b766 **/ 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;