From patchwork Wed Feb 21 16:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129107 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp840825ljc; Wed, 21 Feb 2018 09:04:02 -0800 (PST) X-Google-Smtp-Source: AH8x227MpD+FWr1LaStH3cYNO0ncfuVjK17tJQ0fQiNPMV0aXY3S1kHN/P3rRdE4i2yZeFSBOQ6a X-Received: by 10.200.56.249 with SMTP id g54mr5879716qtc.245.1519232641924; Wed, 21 Feb 2018 09:04:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519232641; cv=none; d=google.com; s=arc-20160816; b=tG8QJcBAeHmExXSyM3xuFC6Y7evD4pFHTuoZP3x+tscoja7D0IyF+ts5PfxOaRn2w9 wfEr20vfKcO5rA1LLrxlbW8kdzzZpNxnrk4pkqcr4wN9d2ZnqcyVIgFB2Zs+D/qzoGvh O9zOHmsVjYc1NSb1xW6kTA0cwp740QzZuVhtQx/yynXLy6QevEZhe0GDzui/chO605Y7 PSvw7xQxYhrNIa/3Xiuvsl4/7Wnu0V0tkNFZeiCIobpSASGc1HPHQ0ljOCI/2hEu0LNa pURVDT2m5DveaITowTC+sAmT82x/gVv0cvM5QKho6GUReDo+sbYOrmuMNe1i2YzPPPUY j8bw== 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=3mMQn8Bvg9/E05l4BZg5JILJewIZVN+gzoukc9/W1LE=; b=yhMXj+gPu1tyej3TvpPxlCgTmUBrtRvtbwWTl+3T5QUVGP+QDt5pYJ5Ejx8OYOiALL WT+TtblYht2Daaqr/vAKQdwbsRlsGn28PCuaJ77I2dLgOr5BzvTgfMJA7v9fSOnjvjJ4 ulDJ8L/Je3TPsNx2M8PTsjH7PHs42TdskkNoEayXSOhDlUWSVPGQa8ZcP+SuBg9h7dyp lNMN07D/rKPcsgW8q48pyzoJN32Eeczid6BtueTRgicstQS/JsynRnXX1TCBuUKApq1D 64apeV8Nj226fRxZDntQgo6W5maHjnwiTWgBFgq9e4WjcIwOdEYIlm57NuHz8pBXYn8Y AsAA== 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 o3si2044430qtc.7.2018.02.21.09.03.58; Wed, 21 Feb 2018 09:04:01 -0800 (PST) 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 3387E617B5; Wed, 21 Feb 2018 17:03:58 +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 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 A3FC461781; Wed, 21 Feb 2018 17:00:34 +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 E01F8617B7; Wed, 21 Feb 2018 17:00:20 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id EFED26179D for ; Wed, 21 Feb 2018 17:00:16 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 945271242BDF for ; Wed, 21 Feb 2018 20:00:15 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rLN1giSveG-0FOefslb; Wed, 21 Feb 2018 20:00:15 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yTStk9eEsG-0EuqeUpT; Wed, 21 Feb 2018 20:00:14 +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, 21 Feb 2018 19:59:59 +0300 Message-Id: <1519232408-28445-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519232408-28445-1-git-send-email-odpbot@yandex.ru> References: <1519232408-28445-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 494 Subject: [lng-odp] [PATCH API-NEXT v1 6/15] linux-gen: ipsec: provide global init/term functions 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 Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 494 (lumag:ipsec-tfc-imp) ** https://github.com/Linaro/odp/pull/494 ** Patch: https://github.com/Linaro/odp/pull/494.patch ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88 ** Merge commit sha: 7bc900650676584bfb99c8a92c3d8812b458f172 **/ platform/linux-generic/include/odp_internal.h | 4 ++++ platform/linux-generic/odp_init.c | 13 +++++++++++++ platform/linux-generic/odp_ipsec.c | 13 +++++++++++++ 3 files changed, 30 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 444e1163b..fcf7d1109 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -76,6 +76,7 @@ enum init_stage { NAME_TABLE_INIT, IPSEC_EVENTS_INIT, IPSEC_SAD_INIT, + IPSEC_INIT, ALL_INIT /* All init stages completed */ }; @@ -136,6 +137,9 @@ int _odp_ishm_init_local(void); int _odp_ishm_term_global(void); int _odp_ishm_term_local(void); +int _odp_ipsec_init_global(void); +int _odp_ipsec_term_global(void); + int _odp_ipsec_sad_init_global(void); int _odp_ipsec_sad_term_global(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index a2d9d52ff..0da1a5d11 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -150,6 +150,12 @@ int odp_init_global(odp_instance_t *instance, } stage = IPSEC_SAD_INIT; + if (_odp_ipsec_init_global()) { + ODP_ERR("ODP IPsec init failed.\n"); + goto init_failed; + } + stage = IPSEC_INIT; + *instance = (odp_instance_t)odp_global_data.main_pid; return 0; @@ -174,6 +180,13 @@ int _odp_term_global(enum init_stage stage) switch (stage) { case ALL_INIT: + case IPSEC_INIT: + if (_odp_ipsec_term_global()) { + ODP_ERR("ODP IPsec term failed.\n"); + rc = -1; + } + /* Fall through */ + case IPSEC_SAD_INIT: if (_odp_ipsec_sad_term_global()) { ODP_ERR("ODP IPsec SAD term failed.\n"); diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 3e6a80987..8c3d6cd63 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1796,3 +1796,16 @@ odp_event_t odp_ipsec_packet_to_event(odp_packet_t pkt) { return odp_packet_to_event(pkt); } + +int _odp_ipsec_init_global(void) +{ + odp_ipsec_config_init(&ipsec_config); + + return 0; +} + +int _odp_ipsec_term_global(void) +{ + /* Do nothing for now */ + return 0; +}