From patchwork Thu Mar 1 21:00:46 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: 130418 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp522667lja; Thu, 1 Mar 2018 13:04:42 -0800 (PST) X-Google-Smtp-Source: AG47ELvcy9RLJfS+fwK/0ulKsaQ2TssFotMLwb6fJbEdbPZ1Sy4OXV+7CBAN2TXMaY+RZA+gfSJ5 X-Received: by 10.129.181.65 with SMTP id c1mr2279003ywk.156.1519938282533; Thu, 01 Mar 2018 13:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519938282; cv=none; d=google.com; s=arc-20160816; b=Hj0k5liYcsTSHcW19OVsjyPY1kiDpBfB/zxfBv3Z698DxvnNXMq7G2+IiCy519O0Ij YA1FV+rbwjPchrlOWY1tGXyWEr3Qm8Hjm2V4pgLn0r9/HLiz50xGTkkHhr3lWjFlYPNv XcVezsVhahAz05yMgCTO9Ewmy1uFNDle1L5Ng5E8+YJ14oTbUUUe+U5r9I8fnlFFf+fB bJdz7eWFo5U70ylWZQesfG41xpAqGZBdv1E9pAGyLNtf2nEDKkZPHlPdV7hUQJsbkuOE Jv2yGtF7BPKTiC1NMYgTM1dKRjxgQW5sSlOjIhz4VU1VY97qkWUiWAvDPYtgApD9KoKl fmsA== 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=J5CMzErpiXSmlzGJcL9sYGrq+a0mWXxBqbsCJjeoEwI=; b=WCmIrnBByghmX/kwfZa+Ut2t8n9mVqxoi/8ETQB7JaVgqHdUdy17XniWt3Wp70tvTx 074TOhtMA7GmtpZwMwO9n/9s7Jb+P0Jhg/g7/yduNrNJSSkrDjr0H7lXEst1sySglqiY 8B1Pbeeb4lYLIxIksCPTDBMNGEtFdFclieBuLNe+ED/x54SRhlV3jc7vDtE6REdvO5V1 a+4UEjW020Siw8FJ/tNmvvxsVppL0xaZxGboqNRn1lAM7rsHRSdwdnec9S23nz6omXbB 44c4B4g8Fs4UuZmdD2jVuQXJFxINUIujBWGCi3U3MbFq5vIbbsp0KkY0fie0SS5anVr+ bbcg== 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 l132si4908857qke.30.2018.03.01.13.04.42; Thu, 01 Mar 2018 13:04:42 -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 E3E4D627C7; Thu, 1 Mar 2018 21:04:41 +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 51CE562797; Thu, 1 Mar 2018 21:01: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 81DE061769; Thu, 1 Mar 2018 21:01:17 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 502326278D for ; Thu, 1 Mar 2018 21:01:04 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward106j.mail.yandex.net (Yandex) with ESMTP id E94D0180435C for ; Fri, 2 Mar 2018 00:01:02 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ArVW5zyspf-12uG42lt; Fri, 02 Mar 2018 00:01:02 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BpjAadXdWb-122epiEY; Fri, 02 Mar 2018 00:01:02 +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: Fri, 2 Mar 2018 00:00:46 +0300 Message-Id: <1519938053-24031-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519938053-24031-1-git-send-email-odpbot@yandex.ru> References: <1519938053-24031-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 505 Subject: [lng-odp] [PATCH v2 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: 5da68bf06572d3d0651c37cbba03aa91995ec465 **/ 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; +}