From patchwork Mon Mar 2 18:46:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 45306 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 71C1A214B5 for ; Mon, 2 Mar 2015 18:48:01 +0000 (UTC) Received: by lbiv13 with SMTP id v13sf8302408lbi.1 for ; Mon, 02 Mar 2015 10:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=syRI7Hg/5juzgRs3IpoHCDAOVosG7/0oAx8kXbMYOYU=; b=Lwk58fp5V4YyN057ExZyxCCJ1fps6QwZzRhzRY8uoDgw16el+FfRZcWsX52AT4wQr1 NBFLtXB7lGOSgKZNT3QWN3+7E51Z+NSumxexYefBoD5U5G4dc8rMHNAUbyCxFofNfPcv ENvfmTifqSOqkQ2JsDHL5Zyq5tJ8RIKxVXH2zJBLLsNKjtCeTNd9nDf9j80uP9HDwCUJ R8/Gx1vH6ue+QzWU0eAeW9dSxE94td9vgY57mIOP/38qNQAc7pvjXj0hOvvnrAgT1Hm1 5fbdOgxwW1HAJv7ft2B2FgLAuIPNWurn0+GjuzbYaB0h5meYjcfMffceQM7B/rbCXsi3 76eA== X-Gm-Message-State: ALoCoQkafFOA+dzIFSCZCJih3GK/7Bnk+wUO8VYMvvpUdmZIxuyy2CqOwNyG/GLhaJuQLWB/tsLF X-Received: by 10.112.214.234 with SMTP id od10mr3967413lbc.3.1425322080424; Mon, 02 Mar 2015 10:48:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.104 with SMTP id r8ls443284lar.48.gmail; Mon, 02 Mar 2015 10:48:00 -0800 (PST) X-Received: by 10.152.26.201 with SMTP id n9mr8029653lag.29.1425322080276; Mon, 02 Mar 2015 10:48:00 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id da11si9441267lad.115.2015.03.02.10.48.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 10:48:00 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labgd6 with SMTP id gd6so32414892lab.7 for ; Mon, 02 Mar 2015 10:48:00 -0800 (PST) X-Received: by 10.112.147.104 with SMTP id tj8mr10965052lbb.106.1425322080178; Mon, 02 Mar 2015 10:48:00 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp90159lbj; Mon, 2 Mar 2015 10:47:59 -0800 (PST) X-Received: by 10.140.93.199 with SMTP id d65mr50319168qge.104.1425322075408; Mon, 02 Mar 2015 10:47:55 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id e75si12336064qhc.124.2015.03.02.10.47.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 02 Mar 2015 10:47:55 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YSVNg-0008Fo-G3; Mon, 02 Mar 2015 18:47:52 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YSVN9-0008A4-O9 for lng-odp@lists.linaro.org; Mon, 02 Mar 2015 18:47:19 +0000 Received: by lbiz11 with SMTP id z11so6132683lbi.13 for ; Mon, 02 Mar 2015 10:47:14 -0800 (PST) X-Received: by 10.152.7.162 with SMTP id k2mr24893647laa.92.1425322034188; Mon, 02 Mar 2015 10:47:14 -0800 (PST) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id i13sm2696725lab.38.2015.03.02.10.47.11 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Mar 2015 10:47:12 -0800 (PST) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Mon, 2 Mar 2015 20:46:52 +0200 Message-Id: <1425322017-14636-8-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425322017-14636-1-git-send-email-ciprian.barbu@linaro.org> References: <1425322017-14636-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH NETMAP 07/12] linux-netmap: add odp_netmap_init_global X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ciprian.barbu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Ciprian Barbu --- platform/linux-netmap/Makefile.am | 2 +- platform/linux-netmap/include/odp_internal.h | 51 +++++++++++++++ platform/linux-netmap/odp_init.c | 96 ++++++++++++++++++++++++++++ platform/linux-netmap/odp_packet_netmap.c | 6 ++ 4 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 platform/linux-netmap/include/odp_internal.h create mode 100644 platform/linux-netmap/odp_init.c diff --git a/platform/linux-netmap/Makefile.am b/platform/linux-netmap/Makefile.am index 0b08cad..98e0962 100644 --- a/platform/linux-netmap/Makefile.am +++ b/platform/linux-netmap/Makefile.am @@ -67,7 +67,7 @@ __LIB__libodp_la_SOURCES = \ ../linux-generic/odp_classification.c \ ../linux-generic/odp_coremask.c \ ../linux-generic/odp_crypto.c \ - ../linux-generic/odp_init.c \ + odp_init.c \ ../linux-generic/odp_linux.c \ ../linux-generic/odp_packet.c \ ../linux-generic/odp_packet_flags.c \ diff --git a/platform/linux-netmap/include/odp_internal.h b/platform/linux-netmap/include/odp_internal.h new file mode 100644 index 0000000..b2592c6 --- /dev/null +++ b/platform/linux-netmap/include/odp_internal.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP HW system information + */ + +#ifndef ODP_INTERNAL_H_ +#define ODP_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +int odp_system_info_init(void); + +int odp_thread_init_global(void); +int odp_thread_init_local(void); + +int odp_shm_init_global(void); +int odp_shm_init_local(void); + +int odp_buffer_pool_init_global(void); + +int odp_pktio_init_global(void); +int odp_pktio_init_local(void); + +int odp_queue_init_global(void); + +int odp_crypto_init_global(void); + +int odp_schedule_init_global(void); +int odp_schedule_init_local(void); + +int odp_timer_init_global(void); +int odp_timer_disarm_all(void); + +int odp_netmap_init_global(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-netmap/odp_init.c b/platform/linux-netmap/odp_init.c new file mode 100644 index 0000000..22c52b4 --- /dev/null +++ b/platform/linux-netmap/odp_init.c @@ -0,0 +1,96 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include + + +int odp_init_global(odp_init_t *params ODP_UNUSED, + odp_platform_init_t *platform_params ODP_UNUSED) +{ + odp_system_info_init(); + + if (odp_shm_init_global()) { + ODP_ERR("ODP shm init failed.\n"); + return -1; + } + + if (odp_thread_init_global()) { + ODP_ERR("ODP thread init failed.\n"); + return -1; + } + + if (odp_buffer_pool_init_global()) { + ODP_ERR("ODP buffer pool init failed.\n"); + return -1; + } + + if (odp_queue_init_global()) { + ODP_ERR("ODP queue init failed.\n"); + return -1; + } + + if (odp_schedule_init_global()) { + ODP_ERR("ODP schedule init failed.\n"); + return -1; + } + + if (odp_pktio_init_global()) { + ODP_ERR("ODP packet io init failed.\n"); + return -1; + } + + if (odp_timer_init_global()) { + ODP_ERR("ODP timer init failed.\n"); + return -1; + } + + if (odp_crypto_init_global()) { + ODP_ERR("ODP crypto init failed.\n"); + return -1; + } + + if (odp_netmap_init_global()) { + ODP_ERR("ODP netmap global init failed.\n"); + return -1; + } + + return 0; +} + +int odp_term_global(void) +{ + ODP_UNIMPLEMENTED(); + return 0; +} + +int odp_init_local(void) +{ + if (odp_thread_init_local()) { + ODP_ERR("ODP thread local init failed.\n"); + return -1; + } + + if (odp_pktio_init_local()) { + ODP_ERR("ODP packet io local init failed.\n"); + return -1; + } + + if (odp_schedule_init_local()) { + ODP_ERR("ODP schedule local init failed.\n"); + return -1; + } + + return 0; +} + +int odp_term_local(void) +{ + ODP_UNIMPLEMENTED(); + return 0; +} diff --git a/platform/linux-netmap/odp_packet_netmap.c b/platform/linux-netmap/odp_packet_netmap.c index bd864b5..361f639 100644 --- a/platform/linux-netmap/odp_packet_netmap.c +++ b/platform/linux-netmap/odp_packet_netmap.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,11 @@ #define WAITLINK_TMO 2 #define POLL_TMO 0 +int odp_netmap_init_global(void) +{ + return 0; +} + static int nm_do_ioctl(pkt_netmap_t * const pkt_nm, unsigned long cmd, int subcmd) {