From patchwork Tue Jan 24 17:48:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 92373 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1788376obz; Tue, 24 Jan 2017 08:49:01 -0800 (PST) X-Received: by 10.55.127.7 with SMTP id a7mr28565578qkd.111.1485276540942; Tue, 24 Jan 2017 08:49:00 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j3si13538021qkd.212.2017.01.24.08.49.00; Tue, 24 Jan 2017 08:49:00 -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 5648B608FF; Tue, 24 Jan 2017 16:49:00 +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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 A0EDC6081B; Tue, 24 Jan 2017 16:48: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 011AF60804; Tue, 24 Jan 2017 16:48:51 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 7B0AB6075E for ; Tue, 24 Jan 2017 16:48:50 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id z134so114450645lff.3 for ; Tue, 24 Jan 2017 08:48:50 -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=xQQBlK7L490wz1zXK21XULROjrZYxvVAMzZDWXgmPtQ=; b=HPkDNvT7BWm8Gk57Im84KZULJcTbGeI8bJW+7v8kuWjGLz/bD055wwJxCyHPBZ1bSC gvGQxTwRp1RvNBDhYb05j3lizEPuPel19y9v57/Tio5qhjWYQv7Uz6IO54z0BdSTh4rt aU3GH8WcCJ1YnPOgu5SNFf7Rur05d1rvhuzA2X7alpxQH0p18DeqXGk89rlxRNsRILTH fIA09M2XaZ0bF1hOpHOcy2JfV9nEuVRlZlq/9C7KKJDhTtQwzQMByNoq0RkBGmDOrrLt 8mP+TcVH7i6GsrDX+Md8jobkcux3s1Hx1ElOJQ9frU0ItTxCbqznYYTYXtoFjDahX4Wi rzrA== X-Gm-Message-State: AIkVDXKn6xZnJtNR1x5tUNk92pTtTttEN3LWOZ/xeeJlwNQ1BAYlSDNJ5gy+Roa7W04JWlG58M0= X-Received: by 10.25.16.96 with SMTP id f93mr9385992lfi.81.1485276528989; Tue, 24 Jan 2017 08:48:48 -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 y10sm7605276lja.22.2017.01.24.08.48.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jan 2017 08:48:48 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Tue, 24 Jan 2017 18:48:01 +0100 Message-Id: <1485280086-3958-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [lng-odp] [API-NEXT PATCHv11 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 V10: -fixed distcheck (Maxim) 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 | 5 + 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, 727 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