From patchwork Thu Jan 19 16:54:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 91962 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp331353obz; Thu, 19 Jan 2017 07:55:10 -0800 (PST) X-Received: by 10.55.38.200 with SMTP id m69mr8926822qkm.100.1484841310709; Thu, 19 Jan 2017 07:55:10 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x54si2865810qtc.110.2017.01.19.07.55.10; Thu, 19 Jan 2017 07:55:10 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3CE816074E; Thu, 19 Jan 2017 15:55:10 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 0BA9C6064F; Thu, 19 Jan 2017 15:55:06 +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 E7A606064D; Thu, 19 Jan 2017 15:55:02 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 108FB60513 for ; Thu, 19 Jan 2017 15:55:00 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id n124so39676349lfd.2 for ; Thu, 19 Jan 2017 07:55:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eGzZBu2p1aBdq6MkxkiK67xksVhORFB9PbV4R0ZumP4=; b=XqiCAF8Tv1jkTPVPM8tvgC8lm6f7ZkUeJnl6izd9v5L7x9uFG0SWL1gV7Wm/D1cVEN szSORxuYXEL+RDUvck9sY56FKziQmXmsJZ+mGxEkWTnB7yF3A9rEhb+rlEJo4n56cIp+ LGIKKKbQp+yTwvkxOywOzQJMS8KHmZBtMszJxbw3Qu8OhKtuYlxa/dMINnk81teS2J8u OO5XDmM7gxwtWr9HzD/PaGA0K8Zh8iFyly9cAbDWUHnwANR2Brf8oOkHicyymfwPy/NW Jp4br5qdtjIgFJqNa3V7rnoXOWtMurTRseGmn2+coBT5UEv7dxiqijeM+RCcYNf6sZ/u Hqvw== X-Gm-Message-State: AIkVDXJn4v+b7utH2XuKpLheyO+Ftfnd9Y4hYJ5NRpSqC49UmL2ywEgM2c7kx6Sx3fZQ9yoGqaU= X-Received: by 10.46.72.9 with SMTP id v9mr4427942lja.67.1484841298476; Thu, 19 Jan 2017 07:54:58 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id b7sm927770lfe.33.2017.01.19.07.54.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 07:54:57 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, bill.fischofer@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Thu, 19 Jan 2017 17:54:16 +0100 Message-Id: <1484844861-1302-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [lng-odp] [API-NEXT PATCHv10 0/5] driver initialisation framework 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" Since V9: -driver interface reworked to be more consistent with the mem allocator which is now merged. (more handle based) -rebased Since V8: -fixed corrupt V8 -copyright updates: 2017 (BTW: Happy new year) Since V7: -changed include order in drv_driver.c (Anders) -correction of package name for Fedora install in DEPENDENCIES (Anders) -user config file changed from ./odp.conf to ~/.odp.conf: then the user config file and the usage of the environment variable are clearly distinct (Anders) -fixed typo (Christophe) -module loading separated from driver file as modules are more general (i.e. can be used for other plugins such as schedulers...) (Anders) -Fix variable name to remove the "drv" prefix when handling modules Since V6: -more inforamtion added in the DEPENDENCIES file for libconf installation (Maxim) Since V5: -name and comment changes as suggested by Maxim in https://lists.linaro.org/pipermail/lng-odp/2016-December/027400.html -update .travis.yml Since V4: -typo fix (Thanks Yi!) -rebased. Since V3: -minor interface simplification and name change (Christophe) -Fix for clang (Bill) -Google doc describing the driver and device frameworks structure: https://docs.google.com/document/d/1eCKPJF6uSlOllXi_sKDvRwUD2BXm-ZzxZoKT0nVEsl4/edit#heading=h.osxoshqj1bj Since V2: -function odp_load_driver removed. replaced by config file. (Petri, FF) -configuration file "odp.conf" added. Configuration file is: 1) as specified in env variable ODP_SYSCONFIG_FILE (which can be "none"). 2) ./odp.conf 3) $(prefix)/etc/odp.conf -test removed: will be sent in a separate patch as many questions remains. -All libdl tests removed: libdl is assumed to always be on linux (Maxim) Since V1: -enum names prefixed by ODPDRV (Yi) -better commit message for last patch (Christophe) -typo fix (Christophe) This patch series puts the driver initialisation framework in place: Loadable modules (*.so) are given in the odp.conf file added here. Once loaded, the drivers module init function (declared as __constructor__) calls the ODP odp_*_register() intialialisation function which, at this stage does nothing (just print an error message). odp_*_register() is of course part of the driver interface (south). Christophe Milard (5): drv: adding driver registration interface (stub) linux-gen: adding enum, devio and driver registration interface (stub) linux-gen: init: adding configuration file parsing test: preventing odp.conf loading for tests linux-gen: modules: adding initial file to load modules .travis.yml | 2 +- DEPENDENCIES | 8 +- configure.ac | 4 +- include/odp/drv/spec/driver.h | 389 +++++++++++++++++++++ include/odp_drv.h | 1 + platform/Makefile.inc | 1 + platform/linux-generic/Makefile.am | 4 + platform/linux-generic/_modules.c | 53 +++ platform/linux-generic/drv_driver.c | 64 ++++ platform/linux-generic/include/odp/drv/driver.h | 37 ++ .../include/odp/drv/plat/driver_types.h | 52 +++ platform/linux-generic/include/odp_internal.h | 5 + platform/linux-generic/m4/configure.m4 | 12 + platform/linux-generic/m4/odp_modules.m4 | 11 + platform/linux-generic/odp_init.c | 87 +++++ test/Makefile.inc | 4 +- 16 files changed, 726 insertions(+), 8 deletions(-) create mode 100644 include/odp/drv/spec/driver.h create mode 100644 platform/linux-generic/_modules.c create mode 100644 platform/linux-generic/drv_driver.c create mode 100644 platform/linux-generic/include/odp/drv/driver.h create mode 100644 platform/linux-generic/include/odp/drv/plat/driver_types.h create mode 100644 platform/linux-generic/m4/odp_modules.m4 -- 2.7.4