From patchwork Thu Mar 1 17:00:02 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: 130344 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3046551edc; Thu, 1 Mar 2018 09:03:47 -0800 (PST) X-Google-Smtp-Source: AG47ELv5HmdtHB2XjpLSi3n++b+y5mTE2xv6vfcAEunOlhKSSWitepUQLEl/iiSsHTssHn0jB/Ua X-Received: by 10.129.161.16 with SMTP id y16mr1678963ywg.168.1519923826807; Thu, 01 Mar 2018 09:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519923826; cv=none; d=google.com; s=arc-20160816; b=QYrASRIWH0cKF1e2gGvkUbCtXVNEvzTzzVtf0mEE7ioexbaQyt/IwyuWSQdaoEZOrV RMn5myjb5pQeVpwbTdZ3VvmRCBot1N36p5FDtn0r39/Tg7hsygAc8cYPiyur3wnf5XXr kS4pRNg06IqFeIErdCNyTmQkRpXX9j6ojBSVhDebDz8OPpsMTgGgIX/cgquQ5IZkDAMT JuYmb+OLBpBgNHu7nAPaVHu823+yeDa/ejEgYRoBlhAPFTaqYNS1JP/HTwzLoaV3V0iv ln8RLqbqPvmlPhFoB5KYqhHNT2rdsPyT7JZnBG+rlH7HQfgVKSRkJSs3XzrEvn/Cye+/ peSg== 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=9yYnmcy/B7O+ieUSkliUveg7LZkwjuemMvXGvNEATQE=; b=JqeWEMLrRhlnQee0USGb2xMdOJ5xlV5EnL6XoJXEzGiQ35ka0cLQ0VdVlB06VLn20J dBeYq/JglTmXs4Z5m897POUUackVIXWhh6VHYN0I+0oFysQeHtxklnFa4XLM9jVRFTL+ vk7YUM3Trqq0KZ+mo8CoQyROQcJdhG4gqUG4JCU4PCNTf+NVLU29FRNKj00WvX6KAdVS 1UroeITNCJeB6SL16gQuLfRDylwKb98dtJLWMac3s01M1hjMKKXF5IFmyWXkdsEaeQtZ DIHpy89PoRo2Vuxyy8g3XmOH5QN+k+c7wf2mvUeEqojJadN9Jj01BJ0uYP5u/+cEpw7P U4/Q== 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 m124-v6si720438ybb.725.2018.03.01.09.03.46; Thu, 01 Mar 2018 09:03:46 -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 6C60B60632; Thu, 1 Mar 2018 17:03:46 +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_H2 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 1D3F461750; Thu, 1 Mar 2018 17: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 2269761789; Thu, 1 Mar 2018 17:00:23 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id CAD5E607B9 for ; Thu, 1 Mar 2018 17:00:19 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward105p.mail.yandex.net (Yandex) with ESMTP id D62BA4082846 for ; Thu, 1 Mar 2018 20:00:17 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GcIYGvobuW-0HuK4EbP; Thu, 01 Mar 2018 20:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7MkXJ9JJAA-0GCeVqQY; Thu, 01 Mar 2018 20: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, 1 Mar 2018 20:00:02 +0300 Message-Id: <1519923609-31634-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> References: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 505 Subject: [lng-odp] [PATCH v1 6/13] 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 Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 505 (muvarov:devel/master_merge_api-next) ** https://github.com/Linaro/odp/pull/505 ** Patch: https://github.com/Linaro/odp/pull/505.patch ** Base sha: 284f52d72ec19df3774c7409780f1f9eea33b8e6 ** Merge commit sha: e8f50fefcd57a92e0971dc1172c5402c56b8370a **/ 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 c21228982..ff8e4176f 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 */ }; @@ -142,6 +143,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 325c1fb92..19003b6a2 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; +}