From patchwork Thu Jul 2 10:37:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72813 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C78A0A00C5; Thu, 2 Jul 2020 12:37:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C2391D912; Thu, 2 Jul 2020 12:37:21 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 23D581D6F3 for ; Thu, 2 Jul 2020 12:37:19 +0200 (CEST) IronPort-SDR: GfURVaZuSKnWtbhN/J4Piuqh7dmRhdNmXQ0sME+QWWqP1gtsELqxpzDwFVpTnxxW8St1+V4jv3 ZkDDvEedHfGA== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374773" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374773" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:19 -0700 IronPort-SDR: PPlXs4FYQEv5jC8jY/olW9qF2FBrR22C4Ez1WLn04qLwwEprtX88pTGXhYq5ZMvv9nnjYRsXXf un9y/BGoiKoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204625" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:18 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Nicolas Chautru Date: Thu, 2 Jul 2020 11:37:04 +0100 Message-Id: <20200702103712.13992-2-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 1/9] app/test-bbdev: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Cc: Nicolas Chautru Signed-off-by: Louise Kilheeney Acked-by: Nicolas Chautru Acked-by: Anatoly Burakov --- v3: removed extra white space --- app/test-bbdev/test-bbdev.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py index 0194be046..0d41c743d 100755 --- a/app/test-bbdev/test-bbdev.py +++ b/app/test-bbdev/test-bbdev.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python - +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation @@ -12,7 +11,7 @@ from threading import Timer def kill(process): - print "ERROR: Test app timed out" + print("ERROR: Test app timed out") process.kill() if "RTE_SDK" in os.environ: @@ -66,7 +65,7 @@ def kill(process): args = parser.parse_args() if not os.path.exists(args.testapp_path): - print "No such file: " + args.testapp_path + print("No such file: " + args.testapp_path) sys.exit(1) params = [args.testapp_path] From patchwork Thu Jul 2 10:37:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72814 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 93B5DA00C5; Thu, 2 Jul 2020 12:37:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BC5B1D937; Thu, 2 Jul 2020 12:37:23 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 922671D916 for ; Thu, 2 Jul 2020 12:37:21 +0200 (CEST) IronPort-SDR: Rz3sIA0jm73E8RFRNLtzpwk3ZEE/NMJpIKsjORSbkES+Ni4c3UiaG4kJcmiroHwPch9Hm1opti aXqMKvQ9IiKQ== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374779" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374779" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:21 -0700 IronPort-SDR: GjYx7Wd5VB1TfpE0sbDUrwOAYIBoeKIEtnLNChbRBww6nVAOtS7Urceez0IAheIinBlD6k7OLL +gmr7fAWwouQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204632" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:20 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney Date: Thu, 2 Jul 2020 11:37:05 +0100 Message-Id: <20200702103712.13992-3-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 2/9] usertools/dpdk-devbind: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Signed-off-by: Louise Kilheeney Reviewed-by: Anatoly Burakov --- v3: removed extra white space v2: removed check_output function as not required for python3. --- usertools/dpdk-devbind.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index dc008823f..3e7d525e8 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -1,9 +1,8 @@ -#! /usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # -from __future__ import print_function import sys import os import getopt @@ -143,14 +142,6 @@ def usage(): """ % locals()) # replace items from local variables - -# This is roughly compatible with check_output function in subprocess module -# which is only available in python 2.7. -def check_output(args, stderr=None): - '''Run a command and capture its output''' - return subprocess.Popen(args, stdout=subprocess.PIPE, - stderr=stderr).communicate()[0] - # check if a specific kernel module is loaded def module_is_loaded(module): global loaded_modules @@ -207,7 +198,7 @@ def get_pci_device_details(dev_id, probe_lspci): device = {} if probe_lspci: - extra_info = check_output(["lspci", "-vmmks", dev_id]).splitlines() + extra_info = subprocess.check_output(["lspci", "-vmmks", dev_id]).splitlines() # parse lspci details for line in extra_info: @@ -244,7 +235,7 @@ def get_device_details(devices_type): # first loop through and read details for all devices # request machine readable format, with numeric IDs and String dev = {} - dev_lines = check_output(["lspci", "-Dvmmnnk"]).splitlines() + dev_lines = subprocess.check_output(["lspci", "-Dvmmnnk"]).splitlines() for dev_line in dev_lines: if len(dev_line) == 0: if device_type_match(dev, devices_type): @@ -272,7 +263,7 @@ def get_device_details(devices_type): # check what is the interface if any for an ssh connection if # any to this host, so we can mark it later. ssh_if = [] - route = check_output(["ip", "-o", "route"]) + route = subprocess.check_output(["ip", "-o", "route"]) # filter out all lines for 169.254 routes route = "\n".join(filter(lambda ln: not ln.startswith("169.254"), route.decode().splitlines())) From patchwork Thu Jul 2 10:37:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72815 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CCB97A00C5; Thu, 2 Jul 2020 12:37:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 902EA1D93E; Thu, 2 Jul 2020 12:37:25 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1F5BE1D931 for ; Thu, 2 Jul 2020 12:37:22 +0200 (CEST) IronPort-SDR: f/VLZJhcPh89eK3pr3I0E6t8nYACbmgFVr3+mC+BLb9JjCSyh+YorCIm293ADZY8Io8eW4/j0D Uzi24oNdWqGg== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374788" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374788" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:22 -0700 IronPort-SDR: uQ1dzDFtihc+bWf3ygBBam05ZbWxNHCrkaIB7iTkAcQv9tdYumKjfYatWPMPJvMy+jOTij73b5 xJUIiCes3JQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204638" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:21 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Kevin Laatz Date: Thu, 2 Jul 2020 11:37:06 +0100 Message-Id: <20200702103712.13992-4-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 3/9] usertools/dpdk-telemetry-client: support python3 only 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" Changed script to explicitly use python3 only to avoid maaintaining python 2. Cc: Kevin Laatz Signed-off-by: Louise Kilheeney Acked-by: Anatoly Burakov --- usertools/dpdk-telemetry-client.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py index 35edb7cd2..fa599046a 100755 --- a/usertools/dpdk-telemetry-client.py +++ b/usertools/dpdk-telemetry-client.py @@ -1,10 +1,7 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -from __future__ import print_function -from __future__ import unicode_literals - import socket import os import sys @@ -18,11 +15,6 @@ GLOBAL_METRICS_REQ = "{\"action\":0,\"command\":\"global_stat_values\",\"data\":null}" DEFAULT_FP = "/var/run/dpdk/default_client" -try: - raw_input # Python 2 -except NameError: - raw_input = input # Python 3 - class Socket: def __init__(self): @@ -49,7 +41,7 @@ def __init__(self): # Creates a client instance def __del__(self): try: if self.unregistered == 0: - self.unregister(); + self.unregister() except: print("Error - Client could not be destroyed") @@ -82,7 +74,7 @@ def requestMetrics(self): # Requests metrics for given client def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests metrics for given client print("\nPlease enter the number of times you'd like to continuously request Metrics:") - n_requests = int(raw_input("\n:")) + n_requests = int(input("\n:")) print("\033[F") #Removes the user input from screen, cleans it up print("\033[K") for i in range(n_requests): @@ -103,7 +95,7 @@ def interactiveMenu(self, sleep_time): # Creates Interactive menu within the scr print("[4] Unregister client") try: - self.choice = int(raw_input("\n:")) + self.choice = int(input("\n:")) print("\033[F") #Removes the user input for screen, cleans it up print("\033[K") if self.choice == 1: From patchwork Thu Jul 2 10:37:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72816 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7095A00C5; Thu, 2 Jul 2020 12:37:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC0A81D94A; Thu, 2 Jul 2020 12:37:26 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id B6C271D93E for ; Thu, 2 Jul 2020 12:37:24 +0200 (CEST) IronPort-SDR: lSavT6O0L+QJohekKaAaixyhRzo+YN66zQaK3mVhpwDqbbzNF8z25UAiagXfq7t2d0P4Os3F9q 572j9iHTeofg== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374792" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374792" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:24 -0700 IronPort-SDR: KH77KqsAjNcwdNUS93B7oPYukXdci45oTznigZU2bhsP9vUQKs1LnT/4NWBlJcxiE8NqSyfrDy KaDvKINRXO3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204646" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:23 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Neil Horman Date: Thu, 2 Jul 2020 11:37:07 +0100 Message-Id: <20200702103712.13992-5-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 4/9] usertools/dpdk-pmdinfo: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Cc: Neil Horman Signed-off-by: Louise Kilheeney Acked-by: Neil Horman --- usertools/dpdk-pmdinfo.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index 12f20735e..f5cd077f5 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2016 Neil Horman @@ -7,8 +7,6 @@ # Utility to dump PMD_INFO_STRING support from an object file # # ------------------------------------------------------------------------- -from __future__ import print_function -from __future__ import unicode_literals import json import io import os From patchwork Thu Jul 2 10:37:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72817 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CBC4A00C5; Thu, 2 Jul 2020 12:38:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AAA6D1D954; Thu, 2 Jul 2020 12:37:28 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 35C221D942 for ; Thu, 2 Jul 2020 12:37:26 +0200 (CEST) IronPort-SDR: Pvlz+UpP9zGz1uxxSeMPMiixnA6XEEWsSThTdJUzmL4ICDevoGp7iQwnnuX3y5auop/WlwTwpp GDrBavAXGaRw== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374794" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374794" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:25 -0700 IronPort-SDR: bi3/unMkAo7793ngnjGVS6issNuAz0GqrsufTiMAPAX3rDIZVWEMJae9P203Gw875r8hpFBWpj wuQNfSK3o9Iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204651" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:24 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney Date: Thu, 2 Jul 2020 11:37:08 +0100 Message-Id: <20200702103712.13992-6-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 5/9] usertools/cpu_layout: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Signed-off-by: Louise Kilheeney Acked-by: Anatoly Burakov --- usertools/cpu_layout.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py index 6f129b1db..89a48cec4 100755 --- a/usertools/cpu_layout.py +++ b/usertools/cpu_layout.py @@ -1,14 +1,9 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # Copyright(c) 2017 Cavium, Inc. All rights reserved. -from __future__ import print_function import sys -try: - xrange # Python 2 -except NameError: - xrange = range # Python 3 sockets = [] cores = [] @@ -17,7 +12,7 @@ fd = open("{}/kernel_max".format(base_path)) max_cpus = int(fd.read()) fd.close() -for cpu in xrange(max_cpus + 1): +for cpu in range(max_cpus + 1): try: fd = open("{}/cpu{}/topology/core_id".format(base_path, cpu)) except IOError: From patchwork Thu Jul 2 10:37:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72818 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6783EA00C5; Thu, 2 Jul 2020 12:38:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C93E1D958; Thu, 2 Jul 2020 12:37:30 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id AE33E1D952 for ; Thu, 2 Jul 2020 12:37:27 +0200 (CEST) IronPort-SDR: rdwhvoONPzANvOED0D6Q2R+JMwMHW+p+MxW7c4peV2oRIgBqIqr4vn89pQ+t9jEYj6npgd3QEO CkHykl6V3RjA== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374797" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374797" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:27 -0700 IronPort-SDR: on177CamiDL7jL/6BARiJ715gArsd+Ykfblv+QPk+Y6BFXWbBudHpH50ITvdMAV5IDy6U90L0R wVD5NSlW7obw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204657" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:26 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Olivier Matz Date: Thu, 2 Jul 2020 11:37:09 +0100 Message-Id: <20200702103712.13992-7-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 6/9] app/test-cmdline: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Cc: Olivier Matz Signed-off-by: Louise Kilheeney Acked-by: Anatoly Burakov --- app/test-cmdline/cmdline_test.py | 3 +-- app/test-cmdline/cmdline_test_data.py | 1 + mk/rte.sdktest.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-cmdline/cmdline_test.py b/app/test-cmdline/cmdline_test.py index 3a8fac426..0e7c72459 100755 --- a/app/test-cmdline/cmdline_test.py +++ b/app/test-cmdline/cmdline_test.py @@ -1,9 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # Script that runs cmdline_test app and feeds keystrokes into it. -from __future__ import print_function import cmdline_test_data import os import pexpect diff --git a/app/test-cmdline/cmdline_test_data.py b/app/test-cmdline/cmdline_test_data.py index 114d2cb6a..2d9b3262a 100644 --- a/app/test-cmdline/cmdline_test_data.py +++ b/app/test-cmdline/cmdline_test_data.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation diff --git a/mk/rte.sdktest.mk b/mk/rte.sdktest.mk index 803018ba3..ad7ef138f 100644 --- a/mk/rte.sdktest.mk +++ b/mk/rte.sdktest.mk @@ -63,7 +63,7 @@ coverage: @mkdir -p $(AUTOTEST_DIR) ; \ cd $(AUTOTEST_DIR) ; \ if [ -f $(RTE_OUTPUT)/app/test ]; then \ - python $(RTE_SDK)/test/cmdline_test/cmdline_test.py \ + python3 $(RTE_SDK)/test/cmdline_test/cmdline_test.py \ $(RTE_OUTPUT)/app/cmdline_test; \ ulimit -S -n 100 ; \ python $(RTE_SDK)/app/test/autotest.py \ From patchwork Thu Jul 2 10:37:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72819 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A4DBA00C5; Thu, 2 Jul 2020 12:38:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A04B1D963; Thu, 2 Jul 2020 12:37:31 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 342231D922 for ; Thu, 2 Jul 2020 12:37:29 +0200 (CEST) IronPort-SDR: 8zVoFnw17HnGX2rmSTpML8aLw6CE38b0as829e5I8sCSIuhPxtlORJtzMWj8GvOW5CzG3RX2r4 4zCO2Ws6BZZQ== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374798" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374798" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:28 -0700 IronPort-SDR: rhjpNARAnbt4E5kAY7hkQO/BgXcAhoG0pHkPh/kj2ZwK6Xtth1z7K8HeEtkHwRuGH0SUz+u4Mi gKGIXjqJcidw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204661" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:27 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney Date: Thu, 2 Jul 2020 11:37:10 +0100 Message-Id: <20200702103712.13992-8-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 7/9] app/test: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Signed-off-by: Louise Kilheeney Reviewed-by: Anatoly Burakov --- v2: removed use of iter function as not needed for python3. --- app/test/autotest.py | 3 +-- app/test/autotest_data.py | 1 + app/test/autotest_runner.py | 19 ++++++++----------- app/test/autotest_test_funcs.py | 1 + mk/rte.sdktest.mk | 4 ++-- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/test/autotest.py b/app/test/autotest.py index b42f48879..9eef1efbe 100644 --- a/app/test/autotest.py +++ b/app/test/autotest.py @@ -1,9 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # Script that uses either test app or qemu controlled by python-pexpect -from __future__ import print_function import autotest_data import autotest_runner import sys diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index 7b1d01389..e33258026 100644 --- a/app/test/autotest_data.py +++ b/app/test/autotest_data.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index 95e74c760..b50469dac 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -1,10 +1,10 @@ +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # The main logic behind running autotests in parallel -from __future__ import print_function -import StringIO +import io import csv from multiprocessing import Pool, Queue import pexpect @@ -50,10 +50,7 @@ def first_cpu_on_node(node_nr): map(os.path.basename, cpu_path) ) ) - # for compatibility between python 3 and 2 we need to make interable out - # of filter return as it returns list in python 2 and a generator in 3 - m = next(iter(cpu_name)) - return int(m.group(1)) + return int(next(cpu_name).group(1)) pool_child = None # per-process child @@ -78,7 +75,7 @@ def pool_init(queue, result_queue): cmdline = "%s %s" % (cmdline, prefix_cmdline) # prepare logging of init - startuplog = StringIO.StringIO() + startuplog = io.StringIO() # run test app try: @@ -86,7 +83,7 @@ def pool_init(queue, result_queue): print("\n%s %s\n" % ("=" * 20, prefix), file=startuplog) print("\ncmdline=%s" % cmdline, file=startuplog) - pool_child = pexpect.spawn(cmdline, logfile=startuplog) + pool_child = pexpect.spawn(cmdline, logfile=startuplog, encoding='utf-8') # wait for target to boot if not wait_prompt(pool_child): @@ -138,7 +135,7 @@ def run_test(target, test): # create log buffer for each test # in multiprocessing environment, the logging would be # interleaved and will create a mess, hence the buffering - logfile = StringIO.StringIO() + logfile = io.StringIO() pool_child.logfile = logfile # make a note when the test started @@ -210,9 +207,9 @@ def __init__(self, cmdline, target, blacklist, whitelist, n_processes): # parse the binary for available test commands binary = cmdline.split()[0] stripped = 'not stripped' not in \ - subprocess.check_output(['file', binary]) + subprocess.check_output(['file', binary]).decode() if not stripped: - symbols = subprocess.check_output(['nm', binary]).decode('utf-8') + symbols = subprocess.check_output(['nm', binary]).decode() self.avail_cmds = re.findall('test_register_(\w+)', symbols) else: self.avail_cmds = None diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py index 26688b713..775dfd1dc 100644 --- a/app/test/autotest_test_funcs.py +++ b/app/test/autotest_test_funcs.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation diff --git a/mk/rte.sdktest.mk b/mk/rte.sdktest.mk index ad7ef138f..81eff0c08 100644 --- a/mk/rte.sdktest.mk +++ b/mk/rte.sdktest.mk @@ -49,7 +49,7 @@ test test-fast test-perf test-drivers test-dump: @mkdir -p $(AUTOTEST_DIR) ; \ cd $(AUTOTEST_DIR) ; \ if [ -f $(RTE_OUTPUT)/app/test ]; then \ - python $(RTE_SDK)/app/test/autotest.py \ + python3 $(RTE_SDK)/app/test/autotest.py \ $(RTE_OUTPUT)/app/test \ $(RTE_TARGET) \ $(BLACKLIST) $(WHITELIST); \ @@ -66,7 +66,7 @@ coverage: python3 $(RTE_SDK)/test/cmdline_test/cmdline_test.py \ $(RTE_OUTPUT)/app/cmdline_test; \ ulimit -S -n 100 ; \ - python $(RTE_SDK)/app/test/autotest.py \ + python3 $(RTE_SDK)/app/test/autotest.py \ $(RTE_OUTPUT)/app/test \ $(RTE_TARGET) \ $(BLACKLIST) $(WHITELIST) ; \ From patchwork Thu Jul 2 10:37:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72820 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69B4AA00C5; Thu, 2 Jul 2020 12:38:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B77581D96B; Thu, 2 Jul 2020 12:37:32 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 047EE1D95F for ; Thu, 2 Jul 2020 12:37:30 +0200 (CEST) IronPort-SDR: t3+RTSi44XcXdohkN66YbOMt5c+Jx7OUNaAWRP2wJCgrdrSbT32DzO6Y/V3QCaOVRKhTc46Op1 qvtm/wv+H21Q== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374802" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374802" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:30 -0700 IronPort-SDR: G/diSPghaKEeIo6Ah+P6o6jOyq7AdSpTNGTPA2132hlCVKD0iIhFqrN4proAlYV+85382cSCNp h0d1gXbvesyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204664" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:29 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Neil Horman , Ray Kinsella Date: Thu, 2 Jul 2020 11:37:11 +0100 Message-Id: <20200702103712.13992-9-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 8/9] devtools: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Cc: Neil Horman Cc: Ray Kinsella Signed-off-by: Louise Kilheeney Acked-by: Ray Kinsella --- devtools/update_version_map_abi.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devtools/update_version_map_abi.py b/devtools/update_version_map_abi.py index e2104e61e..830e6c58c 100755 --- a/devtools/update_version_map_abi.py +++ b/devtools/update_version_map_abi.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation @@ -9,7 +9,6 @@ from the devtools/update-abi.sh utility. """ -from __future__ import print_function import argparse import sys import re From patchwork Thu Jul 2 10:37:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louise Kilheeney X-Patchwork-Id: 72821 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19C55A00C5; Thu, 2 Jul 2020 12:38:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDFCE1D972; Thu, 2 Jul 2020 12:37:33 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id AAF0E1D968 for ; Thu, 2 Jul 2020 12:37:32 +0200 (CEST) IronPort-SDR: cGL39m2j2OfSs8FHOAZmooEy1vkKnwnYmrqrsk0slX1x/7XBMQjxb3BeozZSVc9JJZiFDDLYBQ kZOaLM6fqsiw== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="144374804" X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="144374804" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 03:37:32 -0700 IronPort-SDR: soSPSK/PvnWbn3PRpaYjsx+a45qg8Rc5oREJwbkN+AMbyxxTYgJjXPzw/N9DsBe/t+6KPYBZvc Gm+eSe+DnW9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,304,1589266800"; d="scan'208";a="304204669" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2020 03:37:31 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: robin.jarry@6wind.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, Louise Kilheeney , Thomas Monjalon Date: Thu, 2 Jul 2020 11:37:12 +0100 Message-Id: <20200702103712.13992-10-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702103712.13992-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> <20200702103712.13992-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH v3 9/9] config/arm: support python3 only 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" Changed script to explicitly use python3 only to avoid maintaining python 2. Cc: Thomas Monjalon Signed-off-by: Louise Kilheeney Acked-by: Anatoly Burakov Tested-by: Harman Kalra --- v2: fixed python3 path. --- config/arm/armv8_machine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/arm/armv8_machine.py b/config/arm/armv8_machine.py index 404866d2f..1f689d9a8 100755 --- a/config/arm/armv8_machine.py +++ b/config/arm/armv8_machine.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Cavium, Inc