From patchwork Fri Dec 6 13:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13897256 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2048.outbound.protection.outlook.com [40.107.212.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 806F320764E for ; Fri, 6 Dec 2024 13:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733493121; cv=fail; b=uMSZH/x9GstFqK4Qr+8tBhIXlT4va2Oo8QrDVfYxH24K5wc+iY4B5XgtMdIPXAKY3X4XRNS4eCwZ0SswwMLuk3urNOHPUMW0F1eiKC+mB4X2X818fhL8CLxXWjyg2yzRnvnvmXnyNyEBoNGlLt2YDsGjDZC/W/Kmug4U4Amq77M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733493121; c=relaxed/simple; bh=qD6DEvVMwX0Felrq4VLQZyXkccyE0ON/5jb2PJv+2xE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=h/6JK1F7yZ+sysc9xTFVAKXPzUFglujLX5PcpTzVHOrZ/kGqfAVKyTHs32wLrAmdooZKtCTIQzW+umRlM7U8VkbdUvuRxew/06SIbtR+Q9zdUJpEIE1qMfkSJziAJgAygJ/Saj9sNN3nEaen7P165tI8xU5tsaCsPlPYoMXp9Zc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=oUZdiBgf; arc=fail smtp.client-ip=40.107.212.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="oUZdiBgf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ty4ovDEi+aCg/aiWenlO/zsvclqSezw4RT3LU5Dmw1n12wCcfAWo/ZRjwGPUMfjRABnOjz+rBOKgSxAhT89crE/BBR0XaFv+foiNG1Ljn8oPBAmbJXvwE1JeD8mLQv+lrbrI2X1F/A21r27Ws7t3lxUH+PJnCmV+JWH/l6rKrX/+xpf/LHS8Ja+quYkdsZ4knx/HtFg+sLNQR2evnfF/ql6qDFNz+z84/z+300ItQnH5BDSTydggy7HxPJyR2LZAYPIjl1TmmKOIDcoszf41MeMkujAFomQ4qf6/skWP5iY6Dp1+WRVuD/1vHZEqAZhrNegpV09mh/fRL2qSSR4ioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O0jB3iFC7HdxiCP7MJ8rxsJPEWyC+PI7oPlcclDFtjo=; b=IMdQSzheWKeSCBNZ1sm7I6NyAHRRGzbssPsdtnozMSge1O10z3lHjc8OHD45e4QWXR7yCYl1S70NXbBofCy/qrmSs+UmQWnjNLqlDAOgtMLdNRSjKWTQfNiaVV04pprjVEDpj+6jNKoxwQNNbxVfTXyhR4JbNsydRPSHG5UNJhsXGT+X+LfPC+FDQQqCqNrraOTsuztt/Bqk50yyW+oIScpM/TiPzB/nKbnPuntlNTTECQWxe6YwKnNdm0enq/2aBAiSXvftWACjXBANKncIVoVfv1uVa2o1z+SG/GX3Fr64fMz+POasntnn1JwF7yGE4KkN0YzHx7FNat+pinKtxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O0jB3iFC7HdxiCP7MJ8rxsJPEWyC+PI7oPlcclDFtjo=; b=oUZdiBgfWeddJ+M2Ajp9tPkZC7pdRF7Wfs2TA6TdzrF8I51wnJPSIe/jX41Qki6SHG4FfYL4C0XoUaO7Ri/uAyEHdeDhjFq0/6hb6T72qqdLgzME62WhWVk13stmaXrmYtOve0qhfbq/u06AZOH6WNd8tbmZgSk7jafxM33Cmfq4J5VrC1RkjiDP49wMgn59n45hD0af3wpeU+9P6OVLTpNyP4WuFK5AzFpOZBIkHjDpU3zh+SC4fvRUXfLiscfkA6h3SsFgTVIqaFUm9Pe1macJG34K8ZM8AfTtzJ9ZgRyDpXJl1pjO+4IF0uKNx7RKHKCRpJqmyGrjjMigDR2GKA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SJ2PR12MB8943.namprd12.prod.outlook.com (2603:10b6:a03:547::17) by BY5PR12MB4209.namprd12.prod.outlook.com (2603:10b6:a03:20d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Fri, 6 Dec 2024 13:51:56 +0000 Received: from SJ2PR12MB8943.namprd12.prod.outlook.com ([fe80::7577:f32f:798c:87cc]) by SJ2PR12MB8943.namprd12.prod.outlook.com ([fe80::7577:f32f:798c:87cc%7]) with mapi id 15.20.8230.010; Fri, 6 Dec 2024 13:51:56 +0000 From: Aurelien Aptel To: aaptel@nvidia.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Daniel Wagner , Chaitanya Kulkarni , Shai Malin , Shin'ichiro Kawasaki Subject: [PATCH blktests v5 4/5] contrib: add remote target setup/cleanup script Date: Fri, 6 Dec 2024 15:51:19 +0200 Message-Id: <20241206135120.5141-5-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241206135120.5141-1-aaptel@nvidia.com> References: <20241206135120.5141-1-aaptel@nvidia.com> X-ClientProxiedBy: YT4PR01CA0423.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::7) To SJ2PR12MB8943.namprd12.prod.outlook.com (2603:10b6:a03:547::17) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8943:EE_|BY5PR12MB4209:EE_ X-MS-Office365-Filtering-Correlation-Id: 91ca9066-0a79-4faa-49df-08dd15fd25b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: OszKlb53I69Q28AEU9c8P6CwlcXOt22Z5VDAGKJHoP4+GMNl6kMFd1C4rb7oMOK1lAEu5JXFY8LGCwGZwps4spcWDqk4fPC5YL8qqY1dtMy/BRxCcpd9pcQBwCm3NScNk5tSk1iE91ckeTQ1pb0S8tX7xjR6Rr8i4xj0AjLCF25y3uB1ARXtqbSaGMC1jNOHpwJzmQVOfgSuW9xONTcMpm54rXC0OBPi3hrTSWBDeI2HPUkocrVLgpkAJtPbzFtFmrvc2dSoOJKPTKUg2XaTLyEgy+ynoWFZgxIsCzpXcBnFw0UVD1cGzx2jEnHjWdYz7msUMKZInr6QoGDO65yFzWQw6npaHw+pFEiqQd/Tcpb9Pj2r960cAP177xld6lq/XXy7uNWCeJJ3mOl54ko5QxKXgPDWHTNExNHaiG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PGbySCN6UPfCX/XHcz02JdWWL/PD3oE2SIjnmHr17gcaUODa/KGLCnvT5ej5fyUnXnQ6oQ5tutmi3ncmSPFsxwH6NVb6+wuLDiSJQe5lTaw4bdxv0P3Wd5BDaovoSYoiqzJINsXnEUIAJtDVn+TYdvhuYrLUc4HKb728Ubet94v6GQQmLFfkSlaLpi5yKVmHgB9bYTjLaqYknNnLACVNbbXISvOqHhkppBoq1PE+t+ct276xjC6iE4KHfl7sCwcw6iThFNzasZjXtl9Hxvs7Fgjjw3xV2MJ9YRiwSFqV+XtFDbPGZFWkBkbRqFqcsTd/c2ihnZpQqAnJCrL6ZGdt3dTqyCtlUGRWcDO4zs/Rrj3oAl1T5Yd9VJThmxbjytdD/yrdJLqrR7yhoPBgpjwSLmiV6VuzdCwhhO/KApMkMWi88G1FMxuao9Ubm8oeCDhHX+8LvkN8iAbLz7WIkZ/wogZD0oNxV/HLggzk4BqH8RmS+xDxh1vnQGsT8Y20wgMdptvy9X1WLKx0v5lvJUhLjtNkADsWj4BfEM44SpZWj9AZ26y1nlhf4lAOfEudaw4LTpbvK8lUmWQmbUfKMpMTQdqKYuLypE+1lDUtIk6u X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91ca9066-0a79-4faa-49df-08dd15fd25b5 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2024 13:51:56.1208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lySVD6USenz9tJk/c74Jdwd/53MLp7it0+rkMAAj0em+7CbWtQr60if19rKvLGNYaAK3j2iR9xAv/+yK2B9TBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4209 From: Daniel Wagner Use nvmetcli to setup/cleanup a remote soft target. Signed-off-by: Daniel Wagner Signed-off-by: Aurelien Aptel Reviewed-by: Chaitanya Kulkarni --- contrib/nvme_target_control.py | 190 +++++++++++++++++++++++++++++++++ contrib/nvmet-subsys.jinja2 | 71 ++++++++++++ 2 files changed, 261 insertions(+) create mode 100755 contrib/nvme_target_control.py create mode 100644 contrib/nvmet-subsys.jinja2 diff --git a/contrib/nvme_target_control.py b/contrib/nvme_target_control.py new file mode 100755 index 0000000..db77fe3 --- /dev/null +++ b/contrib/nvme_target_control.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0+ + +# blktests calls this script to setup/teardown remote targets. blktests passes +# all relevant information via the command line, e.g. --hostnqn. +# +# This script uses nvmetcli to setup the remote target (it depends on the REST +# API feature [1]). There is not technical need for nvmetcli to use but it makes +# it simple to setup a remote Linux box. If you want to setup someting else +# you should to replace this part. +# +# There are couple of global configuration options which need to be set. +# Add ~/.config/blktests/nvme_target_control.toml file with something like: +# +# [main] +# skip_setup_cleanup=false +# nvmetcli='/usr/bin/nvmetcli' +# remote='http://nvmet.local:5000' +# +# [host] +# blkdev_type='device' +# trtype='tcp' +# hostnqn='nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349' +# hostid='0f01fb42-9f7f-4856-b0b3-51e60b8de349' +# host_traddr='192.168.154.187' +# +# [subsys_0] +# traddr='192.168.19.189' +# trsvid='4420' +# subsysnqn='blktests-subsystem-1' +# subsys_uuid='91fdba0d-f87b-4c25-b80f-db7be1418b9e' +# +# This expects nvmetcli with the restapi service running on target. +# +# Alternatively, you can skip the the target setup/cleanup completely +# (skip_setup_cleanup) and run against a previously configured target. +# +# [main] +# skip_setup_cleanup=true +# nvmetcli='/usr/bin/nvmetcli' +# remote='http://nvmet.local:5000' +# +# [host] +# blkdev_type='device' +# trtype='tcp' +# hostnqn='nqn.2014-08.org.nvmexpress:uuid:1a9e23dd-466e-45ca-9f43-a29aaf47cb21' +# hostid='1a9e23dd-466e-45ca-9f43-a29aaf47cb21' +# host_traddr='10.161.16.48' +# +# [subsys_0] +# traddr='10.162.198.45' +# trsvid='4420' +# subsysnqn='nqn.1988-11.com.dell:powerstore:00:f03028e73ef7D032D81E' +# subsys_uuid='3a5c104c-ee41-38a1-8ccf-0968003d54e7' +# blkdev='/dev/nullb0' +# +# nvmetcli uses JSON configuration, thus this script creates a JSON configuration +# using a jinja2 template. After this step we simple have to set the blktests +# variable correctly and start blktests. +# +# NVME_TARGET_CONTROL=~/blktests/contrib/nvme_target_control.py ./check nvme +# +# [1] https://github.com/hreinecke/nvmetcli/tree/restapi + +import os + +# workaround for python<3.11 +TOML_OPEN_MODE="rb" +try: + import tomllib +except ModuleNotFoundError: + import pip._vendor.tomli as tomllib + TOML_OPEN_MODE="r" + +import argparse +import subprocess +from jinja2 import Environment, FileSystemLoader + + +XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME") +if not XDG_CONFIG_HOME: + XDG_CONFIG_HOME = os.environ.get('HOME') + '/.config' + + +with open(f'{XDG_CONFIG_HOME}/blktests/nvme_target_control.toml', TOML_OPEN_MODE) as f: + config = tomllib.load(f) + nvmetcli = config['main']['nvmetcli'] + remote = config['main']['remote'] + + +def gen_conf(conf): + basepath = os.path.dirname(__file__) + environment = Environment(loader=FileSystemLoader(basepath)) + template = environment.get_template('nvmet-subsys.jinja2') + filename = f'{conf["subsysnqn"]}.json' + content = template.render(conf) + with open(filename, mode='w', encoding='utf-8') as outfile: + outfile.write(content) + + +def target_setup(args): + if config['main']['skip_setup_cleanup']: + return + + conf = { + 'subsysnqn': args.subsysnqn, + 'subsys_uuid': args.subsys_uuid, + 'hostnqn': args.hostnqn, + 'allowed_hosts': args.hostnqn, + 'ctrlkey': args.ctrlkey, + 'hostkey': args.hostkey, + 'blkdev': config['subsys_0']['blkdev'], + } + + gen_conf(conf) + + subprocess.call(['python3', nvmetcli, '--remote=' + remote, + 'restore', args.subsysnqn + '.json']) + + +def target_cleanup(args): + if config['main']['skip_setup_cleanup']: + return + + subprocess.call(['python3', nvmetcli, '--remote=' + remote, + 'clear', args.subsysnqn + '.json']) + + +def target_config(args): + if args.show_blkdev_type: + print(config['host']['blkdev_type']) + elif args.show_trtype: + print(config['host']['trtype']) + elif args.show_hostnqn: + print(config['host']['hostnqn']) + elif args.show_hostid: + print(config['host']['hostid']) + elif args.show_host_traddr: + print(config['host']['host_traddr']) + elif args.show_traddr: + print(config['subsys_0']['traddr']) + elif args.show_trsvid: + print(config['subsys_0']['trsvid']) + elif args.show_subsysnqn: + print(config['subsys_0']['subsysnqn']) + elif args.show_subsys_uuid: + print(config['subsys_0']['subsys_uuid']) + + +def build_parser(): + parser = argparse.ArgumentParser() + sub = parser.add_subparsers(required=True) + + setup = sub.add_parser('setup') + setup.add_argument('--subsysnqn', required=True) + setup.add_argument('--subsys-uuid', required=True) + setup.add_argument('--hostnqn', required=True) + setup.add_argument('--ctrlkey', default='') + setup.add_argument('--hostkey', default='') + setup.set_defaults(func=target_setup) + + cleanup = sub.add_parser('cleanup') + cleanup.add_argument('--subsysnqn', required=True) + cleanup.set_defaults(func=target_cleanup) + + config = sub.add_parser('config') + config.add_argument('--show-blkdev-type', action='store_true') + config.add_argument('--show-trtype', action='store_true') + config.add_argument('--show-hostnqn', action='store_true') + config.add_argument('--show-hostid', action='store_true') + config.add_argument('--show-host-traddr', action='store_true') + config.add_argument('--show-traddr', action='store_true') + config.add_argument('--show-trsvid', action='store_true') + config.add_argument('--show-subsys-uuid', action='store_true') + config.add_argument('--show-subsysnqn', action='store_true') + config.set_defaults(func=target_config) + + return parser + + +def main(): + import sys + + parser = build_parser() + args = parser.parse_args() + args.func(args) + + +if __name__ == '__main__': + main() diff --git a/contrib/nvmet-subsys.jinja2 b/contrib/nvmet-subsys.jinja2 new file mode 100644 index 0000000..a446fbd --- /dev/null +++ b/contrib/nvmet-subsys.jinja2 @@ -0,0 +1,71 @@ +{ + "hosts": [ + { + "nqn": "{{ hostnqn }}" + } + ], + "ports": [ + { + "addr": { + "adrfam": "ipv4", + "traddr": "0.0.0.0", + "treq": "not specified", + "trsvcid": "4420", + "trtype": "tcp", + "tsas": "none" + }, + "ana_groups": [ + { + "ana": { + "state": "optimized" + }, + "grpid": 1 + } + ], + "param": { + "inline_data_size": "16384", + "pi_enable": "0" + }, + "portid": 0, + "referrals": [], + "subsystems": [ + "{{ subsysnqn }}" + ] + } + ], + "subsystems": [ + { + "allowed_hosts": [ + "{{ allowed_hosts }}" + ], + "attr": { + "allow_any_host": "0", + "cntlid_max": "65519", + "cntlid_min": "1", + "firmware": "yada", + "ieee_oui": "0x000000", + "model": "Linux", + "pi_enable": "0", + "qid_max": "128", + "serial": "0c74361069d9db6c65ef", + "version": "1.3" + }, + "namespaces": [ + { + "ana": { + "grpid": "1" + }, + "ana_grpid": 1, + "device": { + "nguid": "00000000-0000-0000-0000-000000000000", + "path": "{{ blkdev }}", + "uuid": "{{ subsys_uuid }}" + }, + "enable": 1, + "nsid": 1 + } + ], + "nqn": "{{ subsysnqn }}" + } + ] +}