From patchwork Tue Feb 27 20: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: 129847 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp210871lja; Tue, 27 Feb 2018 12:02:42 -0800 (PST) X-Google-Smtp-Source: AG47ELvmBK8kIp6t5TTQ1MNSsKD37BqrWHA1C4E3s0M5nUBB90N8aa11jjYXZeVC7yS0rWzuCBTT X-Received: by 10.200.6.205 with SMTP id j13mr13991480qth.102.1519761761130; Tue, 27 Feb 2018 12:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519761761; cv=none; d=google.com; s=arc-20160816; b=n9sHUyVYlgOyC5O30C0eoiNE51k0AM6Ycmr8PRxO/BrEIwuIfxLxUu6PkmGlXXvFcT B0in0fwfv5bqgGoLWnUc4KcHqrgTcYmpotmuWTJ/Z717Vl29L++8xdfbAHZGBmB7hemY zj9JNFNiUkjWBUvq0+A1EeVNNSh0XCJS4ZuamjhVmUpwDmLf999w9+DLA7EfMH5nv8W9 WTRuUIW4TR82pMQEw6B0CA/M9ptMuXa/rO1V+Up+HbbQ4f+wVtMbugGMbJlPOzD++dFh pGOrgV7WfL+Wm9kz1/vMkxN6XJDpIZWit0ioYDw179WI6ZokISanGGAc93A6gSLNtFxs XxGw== 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=6dhJ4QQfA9O4xWPY9vF/nKN98xtp4Ty6X/1JSSvHiNM=; b=ZAneKwml6z9Aebi6YFvbfI6W1FoI0wa8oGTTF6frlMcl4XHOOL7Iuci2IkCt45l4g6 xQpoE587eSYKbFCnxN8zL/Nu2RU1I63V7UlifgN06WkjEP4QAoF9ELS3N3Dj/rNkGKhE HtF2ZlulaYz4UXQU+W3Cs81MFkBwDFVL8KMibX+JoX6EObhjLWbs+RHCB+w8AosB4TBm EGxgcUuh7VvUN+WviHlfCJ+7STdGU7O20UdsHerjb0CNMGFhzezWzEWz1jIwRs8w51XG CqfZ6+GwfS2qL+/Twm5Ood+MPKlZoqp3C+0ry/s2PHMSchi++e4rygAZr1KGbZaHte/Y B7+g== 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 q26si1369192qtl.157.2018.02.27.12.02.40; Tue, 27 Feb 2018 12:02:41 -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 2F792617CC; Tue, 27 Feb 2018 20:02:40 +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 29E6F60656; Tue, 27 Feb 2018 20:00:33 +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 04BBC6174B; Tue, 27 Feb 2018 20:00:19 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 32A546038A for ; Tue, 27 Feb 2018 20:00:16 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward105o.mail.yandex.net (Yandex) with ESMTP id A1EDF4444ED9 for ; Tue, 27 Feb 2018 23:00:14 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Kr2gXGnGDs-0E58g8Wd; Tue, 27 Feb 2018 23:00:14 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Upcczghx1N-0DQKSgqe; Tue, 27 Feb 2018 23:00:13 +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: Tue, 27 Feb 2018 23:00:02 +0300 Message-Id: <1519761609-20848-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> References: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 502 Subject: [lng-odp] [PATCH API-NEXT v3 4/11] 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 502 (lumag:ipsec-imp-upd) ** https://github.com/Linaro/odp/pull/502 ** Patch: https://github.com/Linaro/odp/pull/502.patch ** Base sha: ce5c4f9e7ce9fe504451c29429b9ae9fb68083ae ** Merge commit sha: fcd6960c97fe9a0a399be4f3418ba3dd83134544 **/ 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; +}