From patchwork Thu Nov 15 15:47:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 48125 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 259124CB5; Thu, 15 Nov 2018 16:47:28 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 179894C95 for ; Thu, 15 Nov 2018 16:47:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2018 07:47:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,236,1539673200"; d="scan'208";a="249967027" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 15 Nov 2018 07:47:21 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wAFFlLWG024789; Thu, 15 Nov 2018 15:47:21 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id wAFFlLu4028092; Thu, 15 Nov 2018 15:47:21 GMT Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id wAFFlLDO028088; Thu, 15 Nov 2018 15:47:21 GMT From: Anatoly Burakov To: dev@dpdk.org Cc: john.mcnamara@intel.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, david.hunt@intel.com, mohammad.abdul.awal@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com Date: Thu, 15 Nov 2018 15:47:12 +0000 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-dev] [RFC v2 0/9] Modularize and enhance DPDK Python scripts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patchset attempts to create a library out of Python scripts that come with DPDK, with a goal of enabling external tools to get the same information about the system DPDK has, and perhaps configure DPDK. Potential applications include: * Better setup.sh script (it's long overdue, and you know it!) * Easier development of better tools for developers (see hugepage-info example) * Easier gathering of DPDK-centric system information, has potential applications in troubleshooting tools * Reduce code duplication for internal (e.g. quickstart [1], setup.sh) and external tools seeking to use the same functionality * Add cross-platform support for our scripts (see cpu-layout example now working on FreeBSD) There are a few things to mention. First of all, it's an RFC, so the fact that it's unfinished and maybe awkward comes with the territory. I am also aware of the fact that it's a Python library, that it's outside the scope of DPDK and that it's somewhat a Not-Invented-Here kind of proposition where there are a lot of externally available (which are much better designed and implemented) tools that do the same thing. So the first question i would like to ask is, is the community at all interested in something like this? Does it have to be part of DPDK repository? Can it be maintained in a separate repository? How do we handle updates and dependencies? An alternative approach to something like this would be to acknowledge the fact that we cannot do everything on our own, and pull in additional dependencies (preferably automatically - this can be done through pip, everyone has it and it's not that hard!) instead of relying on hacky scripts we currently have. The point is - we do need better tooling, better setup scripts and better OS/machine logging/troubleshooting tools. I should also mention that it is *not* intended to be a replacement for udev or any other method of device binding - if anything, it's the opposite, in that it takes the whole issue out of the question and thus would make switching to udev or any other device binding easier since both internal and external tools can utilize the same Python API. [1] http://patches.dpdk.org/patch/47475/ RFC v2: - Rebased on latest 18.11 master (rc3) - Added compressdev support in DevInfo library Anatoly Burakov (9): usertools: add DPDK config lib python library usertools/lib: add platform info library usertools/cpu_layout: rewrite to use DPDKConfigLib usertools/lib: support FreeBSD for platform info usertools/lib: add device information library usertools/devbind: switch to using DPDKConfigLib usertools/lib: add hugepage information library usertools: add hugepage info script usertools/lib: add GRUB utility library for hugepage config usertools/DPDKConfigLib/DevInfo.py | 424 +++++++++++++++++++ usertools/DPDKConfigLib/DevUtil.py | 242 +++++++++++ usertools/DPDKConfigLib/GrubHugeUtil.py | 175 ++++++++ usertools/DPDKConfigLib/HugeUtil.py | 309 ++++++++++++++ usertools/DPDKConfigLib/PlatformInfo.py | 205 +++++++++ usertools/DPDKConfigLib/Util.py | 84 ++++ usertools/DPDKConfigLib/__init__.py | 0 usertools/cpu_layout.py | 53 +-- usertools/dpdk-devbind.py | 533 ++++-------------------- usertools/hugepage-info.py | 32 ++ 10 files changed, 1558 insertions(+), 499 deletions(-) create mode 100755 usertools/DPDKConfigLib/DevInfo.py create mode 100755 usertools/DPDKConfigLib/DevUtil.py create mode 100755 usertools/DPDKConfigLib/GrubHugeUtil.py create mode 100755 usertools/DPDKConfigLib/HugeUtil.py create mode 100755 usertools/DPDKConfigLib/PlatformInfo.py create mode 100755 usertools/DPDKConfigLib/Util.py create mode 100644 usertools/DPDKConfigLib/__init__.py create mode 100755 usertools/hugepage-info.py Signed-off-by: Anatoly Burakov