From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9AB4041D9D; Tue, 28 Feb 2023 15:51:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3090B410D4; Tue, 28 Feb 2023 15:51:56 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E33C04021F for ; Tue, 28 Feb 2023 15:51:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677595914; x=1709131914; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wBGoG1PCpTSEwkcrL5F9bB/+AQeHx/OZdzRnjwnM6Lg=; b=N9kIcoW82WZCl6SDakiy8HAwHKE95OGY4L/8Kp3CYhuZgnVB7VaZJiml 7iROQIGmBauVoPuaaEV6Yvh+c82gDwGNH6L+KSrl3cWggCUWZcTPY3Nqy LDhKoZC0L27kr2JOpce1x5DFOQu1PqA+UNkkuya3FB98esIF1HxNh2LKT r+4G7xwe3yyGv/13PNg1IKsM1IEkywOlhyf9HXEL3kNQj5bCDewW41qHk R9LMhIhU+Lzj2PJo1iakmkFvG3f9FxKRBDZas+ekT5XM6hDiQzWq8q8ZA fb6MJfd3kW38IKhm4AxYshacd6rfQsSHeL19/jNZvOJYekDgvssS30ezE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="396718767" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="396718767" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 06:51:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="706584085" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="706584085" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.152]) by orsmga001.jf.intel.com with ESMTP; 28 Feb 2023 06:51:51 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Kevin Laatz Subject: [PATCH] dma/idxd: add verbose option to config script Date: Tue, 28 Feb 2023 14:50:36 +0000 Message-Id: <20230228145035.11828-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In case there are issues when configuring a device instance using the dpdk_idxd_cfg.py script, add a "verbose" mode option to it. This allows the user to see what changes are being made, and therefore which operation, if any, within the config fails. Signed-off-by: Bruce Richardson --- drivers/dma/idxd/dpdk_idxd_cfg.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dma/idxd/dpdk_idxd_cfg.py b/drivers/dma/idxd/dpdk_idxd_cfg.py index 41b4d13b9c..c0c833ade9 100755 --- a/drivers/dma/idxd/dpdk_idxd_cfg.py +++ b/drivers/dma/idxd/dpdk_idxd_cfg.py @@ -13,18 +13,24 @@ class SysfsDir: + verbose = False + "Used to read/write paths in a sysfs directory" def __init__(self, path): self.path = path def read_int(self, filename): "Return a value from sysfs file" + if SysfsDir.verbose: + print(f"Reading '{filename}' in {self.path}") with open(os.path.join(self.path, filename)) as f: return int(f.readline()) def write_values(self, values): "write dictionary, where key is filename and value is value to write" for filename, contents in values.items(): + if SysfsDir.verbose: + print(f"Writing '{contents}' to '{filename}' in {self.path}") with open(os.path.join(self.path, filename), "w") as f: f.write(str(contents)) @@ -124,12 +130,16 @@ def main(args): help="Prefix for workqueue name to mark for DPDK use [default: 'dpdk']") arg_p.add_argument('--wq-option', action='append', default=[], help="Provide additional config option for queues (format 'x=y')") + arg_p.add_argument('--verbose', '-v', action='store_true', + help="Provide addition info on tasks being performed") arg_p.add_argument('--reset', action='store_true', help="Reset DSA device and its queues") parsed_args = arg_p.parse_args(args[1:]) dsa_id = parsed_args.dsa_id dsa_id = get_dsa_id(dsa_id) if ':' in dsa_id else dsa_id + + SysfsDir.verbose = parsed_args.verbose if parsed_args.reset: reset_device(dsa_id) else: -- 2.37.2