From patchwork Tue Nov 26 20:38:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13886346 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2078.outbound.protection.outlook.com [40.107.237.78]) (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 18DA68831 for ; Tue, 26 Nov 2024 20:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653565; cv=fail; b=Hxpn+T1UopbT/Bc7Ic5Oe7c2C9U/lUwPxekE9EJmv4AWaEh9Og1JYLlw2+bZd2OMXMERGf+/Y2yESMnFia6TnLJ2U6BkwqYkWRfjS0PR5AOOBc9xdyKbPUfbSd5Tfso+0p3A3quyc7wnk7jQiai2wedMqiHe1vQtg+HORe5rRDE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653565; c=relaxed/simple; bh=HkswKXsX4n/TV3/4xFI1A/Yhn7Pg4XYpt1k1vKOiInM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=jZdi2SAQ928G2fnUeTiKhPuqgDpPw3NwLt27Xg05V9PxAHAZ5dkgeGKgHzjrOddKeUVmFSWuzEmgTb/lu0lXsDD/VN9aBjzmtH0TGQOIi42kZCYG4i0bewQrAUSF8Te6Sd+qQI22+NXpY3mYN5DdtmBJmLQjfjjWkfnyI5f/MFc= 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=fRduTeck; arc=fail smtp.client-ip=40.107.237.78 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="fRduTeck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fx6BTj/3LgpGgGTSDskURPykwbTv5o4E9cB3xzNqNfYL4YfPQLBATj9i8k70E8NaoasRGIYO8YNPBgbkppzHADTutqWPBtKogAjs8xEqP23ePkXTv0Er0mxlXZyiTfEjIdZZk3KrSUKks6Q7Azxkhk8eYyhyJnUvz04/yTM7NnL7i3ZGBNZMNAxqEDjSdDiJD6Zk+RhRuXZYtzmMyCO97OefDe5nxOIbeWsNJ8h3tIw9eMfAv4ZnoOYE0dUyX/SlBGcWZw1VEj74lgtuovZC7V7YprA0DLvU5ma1SKeBIQEVpcW27+RlSPMRRxBGYUwwNd5H84TYZdSJsu1pe0lnAw== 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=xxKygBA0P/LeMs5Z6lamze6bcYNcPYtoc6VfKYwVbg0=; b=hcqubHDQTNgR3RsQ2ByroDWm2GXjUyNibVEYC9PE7HxDfwdmxbuU6iEjLj9O+7vwnwR/2bP2TrYqd/fXPhYo6rE7AMrjU9Y9OSx7UfaB0/22ktIBgkx5ToQTp9ulUe+Jj9rK80nAGONOiV5j5tBiwF3HIY7W5iF8TSu1eaK8VcCs3RGZdrXKjA2zP6I9iESsDHPFw/8xAR4+C0WE+8TwspQMjolVebglFM3FC6+qFAuxxvyAnphEL+k2IHPGUSUpQ1eBSzBHe57utQ+NOVVAbk9Xe+UupP6VPjcINQByCMFki2LUf2J5y6CadpegE08e6qo+z0kPmIo8SBIMqexHbA== 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=xxKygBA0P/LeMs5Z6lamze6bcYNcPYtoc6VfKYwVbg0=; b=fRduTeck32wje+63V+QZBy3iCk/qArv5jl2kPNRlNynV/VgdzQSyJHhROZuEGNS/eqsaWyUif1PLHEi1hUWdjlUgH+aziBiB5idqILTjaaJWP4mF17JgtWEbFuneUI+xykvcxGQ+cqsg2IpSeAmLbQ9sCoIK1KJkHEMRCIgKRHgFCwv0RSuvjmuSEZTQMngWumUY1o2TwYsC/OYD+c7Ng/dmW3eJH4nB9oRBDmQ9vxbgqQw7ulZ1XwiR3hOqdHkuVUmpFixVrZgBS62YuwuEUG7ZUYAPdhaIDS4Yg0FUX+0Fu8HEeww5KFt+VxXt6qRFM4Jv/J8oYuXDIZi+bfvIsg== 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 SA3PR12MB7859.namprd12.prod.outlook.com (2603:10b6:806:305::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Tue, 26 Nov 2024 20:39:20 +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.8182.019; Tue, 26 Nov 2024 20:39:20 +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 v4 1/5] nvme/rc: introduce remote target support Date: Tue, 26 Nov 2024 22:38:52 +0200 Message-Id: <20241126203857.27210-2-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241126203857.27210-1-aaptel@nvidia.com> References: <20241126203857.27210-1-aaptel@nvidia.com> X-ClientProxiedBy: FR0P281CA0193.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ab::19) 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_|SA3PR12MB7859:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d254c41-873a-476d-f851-08dd0e5a6797 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: y20xE3Qwe7D4pFO0OoyWLY2ccCrreDyNpTksZGgClSZG3mGaTmqt25RQwXy0R2bMa9PnJPJbmJOI5WE855LMW7fotG00BxyQApjnnFD9JSxUbFgyc2KJl4LpbyaUr5FE05vr0wp2aV6MjEZuaQcFEymjHwaBChTwuKyMAWe3JGcqJ3qJxiqMI7zs3oKc/73Q2MOC+/ER8k/53FVly1iypbmAA3Tqr0DbZyci3M/4XG5XOOSyOoRIjKqXKuttamNP534itbCWjuUSiEMbBYTLAuArHLUb+NFHJ2xpPg6I4IPliJl9krX6cA4J8hRwIt6hIZThsrjf2Ne2pzGJAoBP8TTymyOMQPV9wH4Hvs8Ew1sdux4p0H8tiQiqwgapClyXzlFYiMNa3cqYpphCCq21C808SLRDfu2sPXVo1F1nCR1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3lRmS758DAunbw1k2OE8V7+tmK8dj1ZE7+nr5MzfU4AGgNJkcDNTNFFAix4ep2w9ovgfTzy1gV6mkxW3ukURu65nqiGdcUWgnYyfZpGpUI86cELpYIJJo7F5ScuJUZUtybfOa2o9L5OcSSMTJkPr8/NkC/pYheLkkHQ9TfJpL1NrsY+tjXJobgS0+O9IbNW3h3hh2YN5zzaEbYibYwKiFgRCd/f9duObee0y6CexDyULhVAzFjk4t2ZmWxmVl2I8syGfIg6pryGpG9yPx6RllSXBTQyGAJZhQ82Fc46whoxZ1eIgD7LX2wSlFKf4uaRnc2CL+OI1tKhbuybUbgUulXnMuSlw27BPnnhEGXKg4nBsjd3slRNCzpw3EyAMaq2qfvgaAwecj8pGAt2RAzb9ovWs5Oe1uS30LVQrlNwiOoxOLZYMdD7sC22XMGlWercD4G7MdiUkN3JoBxbkVr2eKazIWhdxigpmPi9Zxn+tTgc3xlEYfJe1JVq/TaSJJJcHssWdPUUoO7uSZ99NxrgN7Xu1jpZWo8/nZJMxhpMjDkdxSzw8ZBwqAaPcdrciQe4GFsJYd2wXdcx5TygG0Mv/zhdeg4045stWt8f X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d254c41-873a-476d-f851-08dd0e5a6797 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:39:20.7510 (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: sRoBOFUr2ATCsW9NLyFLRAVQoV+P7h1w9wwZtbQrxeVue5Ovd+6Jd7knl7Pd6xeQKQHpfW/F0iGlZ3Y1vS9IHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7859 From: Daniel Wagner Most of the NVMEeoF tests are exercising the host code of the nvme subsystem. There is no real reason not to run these against an arbitrary target. We just have to skip the soft target setup and make it possible to setup a remote target. Because all tests use now the common setup/cleanup helpers we just need to intercept this call and forward it to an external component. As we already have various nvme variables to setup the target which we should allow to overwrite. Also introduce a NVME_TARGET_CONTROL variable which points to a script which gets executed whenever a targets needs to be created/destroyed. Signed-off-by: Daniel Wagner Signed-off-by: Aurelien Aptel --- Documentation/running-tests.md | 33 ++++++++++++++++ check | 4 ++ common/nvme | 71 ++++++++++++++++++++++++++++++---- tests/nvme/rc | 14 +++++++ 4 files changed, 114 insertions(+), 8 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 968702e..fe4f729 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -120,6 +120,9 @@ The NVMe tests can be additionally parameterized via environment variables. - NVME_NUM_ITER: 1000 (default) The number of iterations a test should do. This parameter had an old name 'nvme_num_iter'. The old name is still usable, but not recommended. +- NVME_TARGET_CONTROL: When defined, the generic target setup/cleanup code will + be skipped and this script gets called. This makes it possible to run + the fabric nvme tests against a real target. ### Running nvme-rdma and SRP tests @@ -167,3 +170,33 @@ if ! findmnt -t configfs /sys/kernel/config > /dev/null; then mount -t configfs configfs /sys/kernel/config fi ``` +### NVME_TARGET_CONTROL + +When NVME_TARGET_CONTROL is set, blktests will call the script which the +environment variable points to, to fetch the configuration values to be used for +the runs, e.g subsysnqn or hostnqn. This allows the blktest to be run against +external configured/setup targets. + +The blktests expects that the script interface implements following +commands: + +config: + --show-blkdev-type + --show-trtype + --show-hostnqn + --show-hostid + --show-host-traddr + --show-traddr + --show-trsvid + --show-subsys-uuid + --show-subsysnqn + +setup: + --subsysnqn SUBSYSNQN + --subsys-uuid SUBSYS_UUID + --hostnqn HOSTNQN + --ctrlkey CTRLKEY + --hostkey HOSTKEY + +cleanup: + --subsysnqn SUBSYSNQN diff --git a/check b/check index 7f43a31..dad5e70 100755 --- a/check +++ b/check @@ -603,6 +603,10 @@ _run_group() { # shellcheck disable=SC1090 . "tests/${group}/rc" + if declare -fF group_setup >/dev/null; then + group_setup + fi + if declare -fF group_requires >/dev/null; then group_requires if [[ -v SKIP_REASONS ]]; then diff --git a/common/nvme b/common/nvme index fd472fe..f99af5a 100644 --- a/common/nvme +++ b/common/nvme @@ -22,6 +22,7 @@ _check_conflict_and_set_default NVME_IMG_SIZE nvme_img_size 1G _check_conflict_and_set_default NVME_NUM_ITER nvme_num_iter 1000 nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} NVMET_BLKDEV_TYPES=${NVMET_BLKDEV_TYPES:-"device file"} +nvme_target_control="${NVME_TARGET_CONTROL:-}" NVMET_CFS="/sys/kernel/config/nvmet/" nvme_trtype=${nvme_trtype:-} nvme_adrfam=${nvme_adrfam:-} @@ -157,6 +158,10 @@ _cleanup_nvmet() { fi done + if [[ -n "${nvme_target_control}" ]]; then + return + fi + for port in "${NVMET_CFS}"/ports/*; do name=$(basename "${port}") echo "WARNING: Test did not clean up port: ${name}" @@ -208,6 +213,18 @@ _cleanup_nvmet() { _setup_nvmet() { _register_test_cleanup _cleanup_nvmet + + if [[ -n "${nvme_target_control}" ]]; then + def_hostnqn="$(${nvme_target_control} config --show-hostnqn)" + def_hostid="$(${nvme_target_control} config --show-hostid)" + def_host_traddr="$(${nvme_target_control} config --show-host-traddr)" + def_traddr="$(${nvme_target_control} config --show-traddr)" + def_trsvcid="$(${nvme_target_control} config --show-trsvid)" + def_subsys_uuid="$(${nvme_target_control} config --show-subsys-uuid)" + def_subsysnqn="$(${nvme_target_control} config --show-subsysnqn)" + return + fi + modprobe -q nvmet if [[ "${nvme_trtype}" != "loop" ]]; then modprobe -q nvmet-"${nvme_trtype}" @@ -320,17 +337,23 @@ _nvme_connect_subsys() { esac done - if [[ -z "${port}" ]]; then - local ports - - _get_nvmet_ports "${subsysnqn}" ports - port="${ports[0]##*/}" + if [[ -n "${nvme_target_control}" && -z "${port}" ]]; then + ARGS+=(--transport "$(${nvme_target_control} config --show-trtype)") + ARGS+=(--traddr "${def_traddr}") + ARGS+=(--trsvcid "${def_trsvcid}") + else if [[ -z "${port}" ]]; then - echo "WARNING: no port found" - return 1 + local ports + + _get_nvmet_ports "${subsysnqn}" ports + port="${ports[0]##*/}" + if [[ -z "${port}" ]]; then + echo "WARNING: no port found" + return 1 + fi fi + _get_nvmet_port_params "${port}" ARGS fi - _get_nvmet_port_params "${port}" ARGS ARGS+=(--nqn "${subsysnqn}") ARGS+=(--hostnqn="${hostnqn}") ARGS+=(--hostid="${hostid}") @@ -762,11 +785,13 @@ _find_nvme_ns() { _nvmet_target_setup() { local blkdev_type="${nvmet_blkdev_type}" local blkdev + local ARGS=() local ctrlkey="" local hostkey="" local subsysnqn="${def_subsysnqn}" local subsys_uuid local port + local resv_enable="" local -a ARGS while [[ $# -gt 0 ]]; do @@ -811,6 +836,29 @@ _nvmet_target_setup() { fi fi + if [[ -n "${hostkey}" ]]; then + ARGS+=(--hostkey "${hostkey}") + fi + if [[ -n "${ctrlkey}" ]]; then + ARGS+=(--ctrkey "${ctrlkey}") + fi + + if [[ -n "${nvme_target_control}" ]]; then + eval "${nvme_target_control}" setup \ + --subsysnqn "${subsysnqn}" \ + --subsys-uuid "${subsys_uuid:-$def_subsys_uuid}" \ + --hostnqn "${def_hostnqn}" \ + "${ARGS[@]}" &> /dev/null + return + fi + + truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)" + if [[ "${blkdev_type}" == "device" ]]; then + blkdev="$(losetup -f --show "$(_nvme_def_file_path)")" + else + blkdev="$(_nvme_def_file_path)" + fi + ARGS=(--subsysnqn "${subsysnqn}") if [[ -n "${blkdev}" ]]; then ARGS+=(--blkdev "${blkdev}") @@ -853,6 +901,13 @@ _nvmet_target_cleanup() { esac done + if [[ -n "${nvme_target_control}" ]]; then + eval "${nvme_target_control}" cleanup \ + --subsysnqn "${subsysnqn}" \ + > /dev/null + return + fi + _get_nvmet_ports "${subsysnqn}" ports for port in "${ports[@]}"; do diff --git a/tests/nvme/rc b/tests/nvme/rc index d63afd1..9ad9a52 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -113,6 +113,13 @@ _nvme_requires() { return 0 } +group_setup() { + if [[ -n "${nvme_target_control}" ]]; then + NVMET_TRTYPES="$(${nvme_target_control} config --show-trtype)" + NVMET_BLKDEV_TYPES="$(${nvme_target_control} config --show-blkdev-type)" + fi +} + group_requires() { _have_root _NVMET_TRTYPES_is_valid @@ -392,6 +399,13 @@ _nvmet_passthru_target_cleanup() { esac done + if [[ -n "${nvme_target_control}" ]]; then + eval "${nvme_target_control}" cleanup \ + --subsysnqn "${subsysnqn}" \ + > /dev/null + return + fi + _get_nvmet_ports "${subsysnqn}" ports for port in "${ports[@]}"; do From patchwork Tue Nov 26 20:38:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13886347 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060.outbound.protection.outlook.com [40.107.237.60]) (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 4C5F88831 for ; Tue, 26 Nov 2024 20:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653579; cv=fail; b=NDJyxB+WE6fK0goIHz3WeQHs4du0ZSxZXPWN4hvOfhhFeYlz1Cb/WdgFibIge5CPiHZ89eB1WINGbGtuSaIOKFnsDK9wGvfLu7n7MAWMtWb+g+x2ooFMZ3PhwusPsBdqETEWwN5wQm1TSLVvuVPFIP4TlegR1vq/8kLtPnaOBZM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653579; c=relaxed/simple; bh=gHCcTM/t6ZN2gyS2olcrQN5cOX/MakN3jmv4TIK9KdM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=H9kmcqoFOryHULzT+/JtpL33PslXH2AwIatciCUWSFJTxkbuNK8G8e4QDXVg0zaxCbJScxanqRuHLR6oKDhCVHv2jXm3B9yWk8qVCF7+kL49oSOQX1e1yLFBPX4vCWEQKS2ketqmNuf1vxPPqAjfHtoIRxWi1IeE6Ezo5IWr5K8= 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=cfCsWTA2; arc=fail smtp.client-ip=40.107.237.60 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="cfCsWTA2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ivk6w13h7Y7XI8Qh058/aX7R71+6UGIJ/DNFvTaq4h+CuuRur7S+Fl3vQ66swnEcpLCWP7beezO3dwgWhWm3FtaxbUix6Ba0yRp6dOGylf+LI5+H+fFsfWt2zohVpOtDQQNuX3lil1uFk/oyHRXtRxbRHUGawiornKKp9i5JH5TvZxoCuPIW7Iy/MgXocvPLFkoE89h1yzD4BjMQTgRDsaA7Iq8hdg/1higxKvbM2xlD7GruVVpjYl6mg5f8CMQomh9QvCaYrxxBT/E5XbXwQjcno/HGZ+l4ZLJe4ZfRxfrSs5jixqjCUbK2O/JDEeoFykOfnQJdqtlHx/xOouNW0w== 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=u8kKWnfCJ9VW2smK9l8627N9zkaZ49KFZoR8iWBxeZA=; b=dR82ZkFzL/J/Z0F6EjcztzaBkSJ9eLKA9+z2TO9Ea2xVKTBbDBe9jqdVFEYyIsWHPONK1mGgGo3M37dhSk0Zebq5ICV7V0vznhuHAgjJE+VMSTkzldyohxaqsnLFZygIppUUmLqakAbzV4OOIIOAvO6jPwx7REMQqTjo4AtAKq4RBhi/KYiTsMgSiba8u7cTHfYvQMKaQ19SBV6fH5Tqd20M3TnZUODypmMxBk9EA+9uwuVhcyDeKUW2H+ybMsIEdZoLD6+hf/4YwwI7es6sfOiWCpVuW8jmhLAvKeWnw87vr9PKaCD3riY6sOpUau9eNUoxD2rVuFxLJkcHMimksA== 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=u8kKWnfCJ9VW2smK9l8627N9zkaZ49KFZoR8iWBxeZA=; b=cfCsWTA2QVknvisK/4+3zA9iZ5toePdUfiOydYHFtTsE1s+X5uRKMLxEsELXavBa3UkXucaANQoij/4ptr4vN0pzvBgsxIu7uh+2pZ7nadPUxwg0WeqcojDrkoxeZCjDjuET/oOr5bZayI4yBgTwWQvge+g2H97JkTLAZeAdKYuX1NGXKJ6EwVRjlTIUxpgb72wMC/hzIg43eYrL0+YsPY1K78KCVRm/2Q+dcU/4ymHHVpe0163MS8OO/ZEcMk7yMxsBnHkdgM0/d0VNpfkdFwP2eJ8ylAvY1XWt8JzAwLXi+mudpN3hBGpguPFDNszfD/oulKDQGZvpDHSusRGLmg== 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 SA3PR12MB7859.namprd12.prod.outlook.com (2603:10b6:806:305::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Tue, 26 Nov 2024 20:39:31 +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.8182.019; Tue, 26 Nov 2024 20:39:31 +0000 From: Aurelien Aptel To: aaptel@nvidia.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Chaitanya Kulkarni , Daniel Wagner , Shai Malin , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 2/5] common/nvme: add digest options to __nvme_connect_subsys() Date: Tue, 26 Nov 2024 22:38:53 +0200 Message-Id: <20241126203857.27210-3-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241126203857.27210-1-aaptel@nvidia.com> References: <20241126203857.27210-1-aaptel@nvidia.com> X-ClientProxiedBy: FR4P281CA0067.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ce::18) 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_|SA3PR12MB7859:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ff2bff5-ee35-4747-744d-08dd0e5a6e4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Ant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ukq+gPBSzzeQuURs/8iVdNZVeyjpljkv5nTBaZK+STAvSGNmqa55aBeDhHDvVt8MyKLI3SJzwBWZeWC/2Sw7siYWXIf8GH0YXWmGXK1EherrIQrA2LOr2xsvpP/l8jY7nIx0y3MFRnzWObgJcqSytcntA/K2wHA/kWPPncelGPeeypjVaREbsCNNomT+0M965PN7Pg223L2nrO4jyghaVsqmRfVki8CglMEBe12TPr6aNd4HA7sJpvOnF4VdN6lJIBa0+PsJupvpVyqaf/Z0pzprg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8943.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7ZNJjIidEbaQZTAc35RCu0j74EbBwhNtJtEhNci+Clelk3kmSDi6MkSYQc5ufWxUJKgbA/XfODJoLyD2RMp6623nZu663m/ECl7QZItxCyMrrh5NK0ebpzyDy02QYUE1qzEZGHuW7JCGjY+KWP4+VfMmlbANKfbFF9GVJ93u2RN8xy8Bz4YvnZLp902st9wA27wzugsh+gA+71hSCuuqHO6L0J6mxHJ8R9M3//ZE4NPSKzTgk0dUg+QKq/1snOZDJA3nwRdXBlgEURbl3IGCI7yTQ6PYqfTzY+uyMYndHxxnZXRSeVoywqcPyNjWUj0Ov/FWspgVSuVWERU8OtSgdk/S/6NesKVByj6S8LbkAMOekgFlncDVSEhj9HL/xK/OAg6xjR6Fijmzs1DGobNnh0d+T+Q8w/V8FWTWD5ulfSsx5lfxOhxyotHpcgdMVOMJChgky13pB8UT0HJhNOAG2ILsV0/xiN8un/ZrXnLkDDAxDyHLVZ7/bwZM9kfKpbMr02xTbcDlMrOaHOTAl6AAkPxmfH3eSdSNHyaFYR7krhWp8TWQj3cu8f6xgFbm0hpL4C7KsJfFKLJ557Z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d0e5a6e4e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:39:31.7883 (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: vVJ8jIe52NeJD1Ha2wG+jWEzH8Y0EnLrBdjXHZazvMF5uSgc6+PKdvPCADx6zIHZIifHewDjN7bMZ3+NfaN6bA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7859 This commit lets tests connect nvme subsystems with data and header digest. Signed-off-by: Aurelien Aptel Reviewed-by: Daniel Wagner --- common/nvme | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/common/nvme b/common/nvme index f99af5a..e5e5344 100644 --- a/common/nvme +++ b/common/nvme @@ -272,6 +272,8 @@ _nvme_connect_subsys() { local reconnect_delay="" local ctrl_loss_tmo="" local no_wait=false + local hdr_digest=false + local data_digest=false local port local i local -a ARGS @@ -330,6 +332,14 @@ _nvme_connect_subsys() { no_wait=true shift 1 ;; + --hdr-digest) + hdr_digest=true + shift 1 + ;; + --data-digest) + data_digest=true + shift 1 + ;; *) echo "WARNING: unknown argument: $1" shift @@ -381,6 +391,12 @@ _nvme_connect_subsys() { if [[ -n "${ctrl_loss_tmo}" ]]; then ARGS+=(--ctrl-loss-tmo="${ctrl_loss_tmo}") fi + if [[ ${hdr_digest} = true ]]; then + ARGS+=(--hdr-digest) + fi + if [[ ${data_digest} = true ]]; then + ARGS+=(--data-digest) + fi ARGS+=(-o json) connect=$(nvme connect "${ARGS[@]}" 2> /dev/null) From patchwork Tue Nov 26 20:38:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13886348 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) (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 B24ED8831 for ; Tue, 26 Nov 2024 20:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653583; cv=fail; b=PlsopgtN2fNW8hRHdWP37M/vbqtfLF6mnoM8IKQ15g7MrAHA/CGCIbUPumu99xxlApX52uBBuBzROPnT9T6jKG2VWXieiWH5Mt+S4kZJB+m9BAPGsnelnA8Wld0AgdiKQ4MCT7Mp6IYNnSWwJ7wsfMd/28a0bbvLSS9+jkrfRWE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653583; c=relaxed/simple; bh=RLCnhaXNJjacmqyj6sJgmUy9o/OtD4y1V6IobTtbty8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=nR9LF8vAc665X1WcIfSLX0fdqkEls7ZQoRZZ6gDUMLA5PIPbnH88CNLC8sxwy4b1ZFppQEOdFaL2QJf73yvEsyD2wX626iU+7qUfidMEFI2xgKme30H7/NbuSzv4sCW7APQNY/DJZ73JEL+ry4Tg8HkTSranMLeanuUoe38so3o= 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=VZY74kjo; arc=fail smtp.client-ip=40.107.243.46 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="VZY74kjo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j9QLGaFCAkuUavEwDMc8Y2r4VnQtumPvvuJVw8u/c/Y8Mz9D+Q8WBPQSImGPbQkfbtbneIxri0v792+du0jl31WIYMQXIEW5tmsVrLd/2RLio3SM/eNEff0jslaKvj/t2LvAYHyDp8U0UEakuSISGZi594N9AzUMFHoqRqqHaM1DtrHAI4IY5J1VzmbmH3jB7C/LeZZc1DoAGsCjw3bUo1Tf68LwQddwaILBX395ZHxXFQPRAG8WLArByTBtcc3wAa70mrUIW3uRM5petnAChCzxn9qSgA7vgJ5CQYFmSwsGkkvhpvHLLM98oHll+WxP1bNLesE6IEA99TiKX/hGSg== 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=hEkjaBFN6bFN0SYaBG9boKuGJbuRL2X5cdHeCjirrSc=; b=ibw6WqSnzZnU5SQ2UQSzzHIBu+lbc73lTL4o9XyPUBwbF6YZYbTQCrLtcXib2cvIMMkwzXJJQeUWv9uHdC9JmYQn5G6zALnZ/WylIOlKVH21jmxcRWoWyR0pMc01fAEH3vmftI6zts31sVJuQzW9spcf70jqeRNhQBKu3Og1Cp2qsU1oXVh6zmc9nV0Q1KFH7qrQ8DfECtbAYU3XBqOLWDbS1YZH8cVE6gYbJHX97u8rgvqwkwlM8pVcdw3bmrjaDutXn4LDxl4SNYIThIrPfqNIrRQ0FR8mcdLW9DPliYeHc6MDPFzM8z661gnvbrAEbYERxcjzQ2R+baNLMz45eA== 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=hEkjaBFN6bFN0SYaBG9boKuGJbuRL2X5cdHeCjirrSc=; b=VZY74kjokH+3cGoTTE1PvWDIjpU+XQv4uT6NtSClKiCcA1qBAS54DqKRkD+0cRIz0qoImGmOa/Pm5yS71qC62q499BN8vNXVQK7I0NdmjRfN86h2ND7Z6EGBrp9bnmAKS47xVh5DZaBrUwZS2M4xcemOqJPzrJQlUIIOw8TB5JObOxyTr1CY7MWfedFaEUNujnnUHeLFfi/hC6rKIdDVWLdiSSk0qxc4wk23gfEo88nIoq5WbfZOhPDOomyzOC93zuskyUwDj5MvKlgHipoZQF/lU84jPdwb5PtBoSQGx7XAiqa8o0xMw8zTXoRxhFN9/LgjH2Qrjask256E6T4AMA== 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 SA3PR12MB7859.namprd12.prod.outlook.com (2603:10b6:806:305::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Tue, 26 Nov 2024 20:39:38 +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.8182.019; Tue, 26 Nov 2024 20:39:38 +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 v4 3/5] nvme/030: only run against kernel soft target Date: Tue, 26 Nov 2024 22:38:54 +0200 Message-Id: <20241126203857.27210-4-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241126203857.27210-1-aaptel@nvidia.com> References: <20241126203857.27210-1-aaptel@nvidia.com> X-ClientProxiedBy: FR4P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c8::16) 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_|SA3PR12MB7859:EE_ X-MS-Office365-Filtering-Correlation-Id: 75d2130c-646e-45f3-22aa-08dd0e5a727b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: HyF7JAszEy9U1CAO9AcE0evPg4fpCyAvPM6uVkGRbn5BQs52emq3NioNvVOTBcia3jSrMO9DWKH+7sRi4kdDbga3lnkCQe8zRntcuMpONL20jiAe7t+yaEPFlmKe6D/Rqe0D8JPBeWOBPJL6xpUWt2a6j6f0BL0xP8ypKCEUEQHjRhtwaN7Xfs+VxfXiNvKEu8pq+lrGAgc8fAKEYR9ckPeZvmYtkYu6njud+TFeiZTeHBcvtfAYBZPp2Q++RW4mWMOEW3dWWH3LOEHu15PzIIgPu+aEa+M2eLlvulVmpYL1bsotgfmSJ4cdusasxi6LKI846+rxyBWmeCz4otwKQqU5pkKA8a4/gtptgTMBXiMzamX6n70te7st5ZgLhjesNLj4BibXqHF8FXLw9iNPFxCxSsyiqSRbVKXL+D7xvcra8fwUyikfvVIYEdJ34e8dzXA7c4q1sUz4pGFhJmy7tvOGyfhLgQl1hmRnxsn5lhomBBTXdaEknsfmM9jZHP7mrGhWrun4Eq3S9y63nM5pF3Yf5Z7cEcFWvAB9mgxMcgK+KSIdDv8Tu82WfOLgKjusOJoqF87KueMuhC+FVY+n31seg+oHOldYVR12Xh+w1NIFpUpKCbXlQeJPTlWaHV4Nw4j5Xavh8zakf/UyR3RPOK+X/2pk6Kkg5YnROxQ5yB06SGVT5xQCA3hUlkozSpqKteVJAPPOwRwvhA7vlaV71acdbUfGan3uLP/k6JK8NDbvrILsM/KchOGq/YBB/fQvWtIqrvZ9Qyr/gJ7OWUbtQcpdZNY6Li0LsDv3z0ivnX+wFDAljTZpBnzup8X2UKTzbiHsj8axGXyvryWuXN/zyFSPAYlfGDeKuI4zyGBGqtev/6Zs6zMmA3QQKl269dav2fYCApEE5e/ua7kumphk3m6UFGmkSbsyTeId22FwhL+E5Qo0NZqkxVowayBM3onl9Zu//Zdbg8txcgiBbL7mVVPUegzwTAuh7W7eNCPsFc4fXgq0VnafwWNcRZMz6svIfCLh2NKuepsZJNDvICswRexbqXLp5XmSIa+0E437BV6cpWD+vdXHmGR1UADQXEyt2MRMh4jhCYKaCXAiIyjZ4VcZnHGAcO5yMgF6C5f1BagIwRFGjOwFlr1JOhVZkhn9X1XpJRn9YUuUgsWA9HpVlE+UyoFc0+Ag9z6sUvlbtEKdMmn5kexaz+fDPJftbnRTbTFrsd2qsNajzEt6sGE+hGS8WS9l8BpSpti+SAlkiHZKx85qgS9T7XGDLHTHTeRFNI+tvHGV+FrAY2wnJpMFWELAmOcAW9QOHqlyvJLo32q8i2ougJXs7qnLp/5H1pW9Ch7MQt8a1fX1+fNRHGyzRg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8943.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZsAWD7dNdK2Ie2wWaLzXdyI3i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LEw+Ge/32jZJbBGpHYJnMKEml3IPckQ1hCyAUNd6n6Trl5HcWCU1/taY1KVrXjXvsIaz0A4K0BJEIrAIXl18W4/Ay58nSn+I/Df9CFosk1gA9/ASWjAnhupObh5TXNEy6rZPM+8gS3GRBC6aQR2PM7l/Ecc/VWcbklGLUsI8kOk1xwnV6T3EhiM4UgE6tXKBNy9KrcQU4+bXD2LXPLHOLgsnJVjtZHWW63Vkf9MnoTD5dAEYV+aQWLi7H7p9uu70KqC8y0t7ABwsqa1zKvWU0YeJznjo5CL9c0mfwnIC0jkH2agrRhru9URO6ZFkUqIv1ZVqMCl1Nu3vKelQT/X8mpRH2HJJSu+C03s36kIHgH7AQGqS3Vo4N5xB7aR5SX12d0vsLIm9rvYArR1j2H5L1UjaEA3h4b+pRXZE3APVRYyFNU40VgjRVC67WE4376yJ+CP9apWIuvMlvpF2njHBdoSeiI6RsdTubCaKFhd X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75d2130c-646e-45f3-22aa-08dd0e5a727b X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:39:38.8199 (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: WhPJ8XzLuQIXnfgiLxgxbhmVO2pSb4XXcXIu+PpGnfurftPFKdgI3wOhVMZ7O5Bfz0V0yc7F93hqwmy9mes5TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7859 From: Daniel Wagner This tests is exercising the target code and not so much the host side. The problem with nvme/030 is that it depends on interface to interact with the target which is not covered by the standard. Thus we can't run it against an arbitrary target. Just skip it when we run against a arbitrary target. Signed-off-by: Daniel Wagner --- tests/nvme/030 | 1 + tests/nvme/rc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/tests/nvme/030 b/tests/nvme/030 index 596e411..fe74849 100755 --- a/tests/nvme/030 +++ b/tests/nvme/030 @@ -13,6 +13,7 @@ requires() { _nvme_requires _have_loop _require_nvme_trtype_is_fabrics + _require_kernel_nvme_target } set_conditions() { diff --git a/tests/nvme/rc b/tests/nvme/rc index 9ad9a52..d1a4c01 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -191,6 +191,14 @@ _require_kernel_nvme_fabrics_feature() { return 0 } +_require_kernel_nvme_target() { + if [[ -n "${nvme_target_control}" ]]; then + SKIP_REASONS+=("Linux kernel soft target not available") + return 1; + fi + return 0 +} + _test_dev_nvme_ctrl() { echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")" } From patchwork Tue Nov 26 20:38:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13886349 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2058.outbound.protection.outlook.com [40.107.244.58]) (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 DD0E88831 for ; Tue, 26 Nov 2024 20:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653594; cv=fail; b=f9j1W1HbEaeUA+2BfCtabsJ4BJzwK8sgL6qI/v5JaeFUSZ+xmj2duympevAnTC2VqHqXlmgLVIAgctITAzxAWcWG2AGeo3uul/9fJOziVNVhajoakZwjUMOSy8alVS4A2ognY8WoBY5+dtreuPjHIGdnmXrNewfOLh7knix0DuU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653594; c=relaxed/simple; bh=qD6DEvVMwX0Felrq4VLQZyXkccyE0ON/5jb2PJv+2xE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UbrMctA0q3auCEhIboi+ApX48QnxcVSJweRhzKeBoZql/LKCQMxNRilgCcKJQBy9MZtgCiHYSqsQkw69K3HuM9b4eNYsTPNTGmby/YD7uADokhUvRQtsNq/z9oOPvWMo/L6+iwhwa3OXgXww7+msOVahIuvlpdSk1syFcrQJYsk= 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=Wh2mOf3F; arc=fail smtp.client-ip=40.107.244.58 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="Wh2mOf3F" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g8uY4ajJurWUMoo+lDHn2wQOxMXHOZrUThegdLXHpvDIFMUZoTaExS5DV0HpuU2OjNSJdLBAVbRfA0xMxLQYAh+s8nK+cVve06KNdGYkgK/0C+SKRh/JiifMIqu2849u9Yrz+1KJzKEohgjkaoZdNoORSxgcTmK78O2avaO+fDkjctgtduQ/dnkrvwfn8uPnVUg8E7sYa2J5kKrGqB11rHDRPLhkIfUlvxSYaf8F8LINjmzD1FravASxwgSlyV6TTBiiN3wJcGD8rZ5BxSiSRhfRlpUOHsQVi9vqt0ZBpAh2tTfXe8eizBArvFNmJixs3oGsMof+C1Vw8buWSSAgJg== 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=JwAECEZklaEQ+IKOK5Vg+jyXmMZWFwbEMze4TjsqgWFxkZTblQS87Fn2b2unhrK/dS97KSTJ5LY1EvkR4t5pBUVH9xk8zmG7xOfzk2kF7/UprjSasLerVf5PPj/9iyd20ekvHB0ZXlmi9OrReIGU3KFDuIYBCgno229CxjxryVvEPhTgw52FzHGcJ4ff+ufijlsws1cu2aG1cASMcacGsDFEQZy78NnGNibbjWDtcZK4+jHXZinq8RljEkbuWRZooD9OXTglNi0IHPVeAGLfF1iInvTnU479RMrRNVlYYFwe4ecq+KC6j4RamYR1lEvniAUFUr0+pFkLDb91o785MQ== 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=Wh2mOf3Fbnxurj3SxgfGPSB+aw3NVYY5mi+h/QQR5GLq8duqH66j/dSvUr/TRtj7+6FUdhj7Bhwi/GN+MV4K3sxXlgE/p9V5YRXcSVwG6AfU7lYSauBT2tSEmdrF7bBKNAsVtBYM/izf6OUh5KzrMmRlF6/o+PrIo6WmJTwsdPau6kx4C033ytdaRH6x31CGG5S+Bn2NN65fiMIscMjUujTzHGZAHYsoNoZS6GnEbMq/2rPJyuh+c2wKL39AdNtLQuuTz8JtI494JObh+BxJqCTnS5pEEtCkyqFJDlubR9FuAYdGW/iciwuqJlMW93yvxbIaZGjAmJnBl3VFJx1PVA== 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 SA1PR12MB8697.namprd12.prod.outlook.com (2603:10b6:806:385::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.18; Tue, 26 Nov 2024 20:39:46 +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.8182.019; Tue, 26 Nov 2024 20:39:46 +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 v4 4/5] contrib: add remote target setup/cleanup script Date: Tue, 26 Nov 2024 22:38:55 +0200 Message-Id: <20241126203857.27210-5-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241126203857.27210-1-aaptel@nvidia.com> References: <20241126203857.27210-1-aaptel@nvidia.com> X-ClientProxiedBy: FR3P281CA0061.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::9) 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_|SA1PR12MB8697:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b149d7f-5f7b-46c2-a1b3-08dd0e5a76cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft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8cuHWXtxl1dcOuVet2JH603qu+grAOe/u34fCFIQCRlSZG8Ic+K3yDU/BErIx/u6RehJ7hpRu1LS1d4HuJSjSu+5mDUZIeEGIOWqOgAcRyj/kRtI8KpkZFhqkoKJUk3VQxGaKCXbjo6jjhaLHYj7ndkEDTvwXGD/lsOTYPDehV1bpw4kFHBQ95VKBDHnlAyJ8XRAtbsFWQeV0CD81WLTLVnVqbXE57ePClnn9fHqlKdSBx4AVrq71dbHcB/ZlG44UHR1/OxITSbdLCBzlg0M419M0QNHA0miIlKBEIw+HUy13KnuW4Dt1OyA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8943.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W5mS+pJMcP6vd0TbDaeJgkrJoUczgZ9ryOZhjD4z4UZ5Xf/ObB5+evs7piS1JUFmHIWUCOpVix/hQtXAh8tQexJ1vdJVz/gv0RP0xR+7MXLlRU7vIihYaVKrlbZeOFrdszTi0p6fOLLoBInhhLT20RgFgNU0sZyFUSImPwD6NZxM5/Wzp7fhshrXk/y3QScXnZi23QoxWU2ZoBLLww6ToYLkMNdXiIkP8inswLKF7AOxTihd1ww+zTf9gNI4A5+ee2YlkEeM5/5trMlXztFupLxeYHJVmOFRxVgAGOlp433NB/JAqTtH8fyqf/zeKmZwjjkQTHqYteSXt7gps2lYYUcvsfwYtaxklReemJ/BYerb6KzvVF5YxUZJVMVi9qyVW2Pevdn0RflgyjzDTfwBruistZhOm61LPC4B+3j/XU7gkv7CSG8355pGWkKoirjBetdlHY/gzgH7UUa2JGP1wGR3RI+UB2z7vDAC69EVfnUJLegsfDhrobGrVh0ar1rRtSnZoZmo4EWE2oR4zSQGD3qUkHmOgqsYvXTufuTeRP1f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enant-Network-Message-Id: 1b149d7f-5f7b-46c2-a1b3-08dd0e5a76cb X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:39:46.1436 (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: 9bgCjLoxdFrCgGEwpgcz4vh81vwiMAlir9BoVH2SOIPuJZmFBxUCLtaCLG5LHJ3anISV+uvBW5J0x1bTvnm6gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8697 From: Daniel Wagner Use nvmetcli to setup/cleanup a remote soft target. Signed-off-by: Daniel Wagner Signed-off-by: Aurelien Aptel --- 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 }}" + } + ] +} From patchwork Tue Nov 26 20:38:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Aptel X-Patchwork-Id: 13886350 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2058.outbound.protection.outlook.com [40.107.244.58]) (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 BB251149C64 for ; Tue, 26 Nov 2024 20:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653596; cv=fail; b=WgwvVui99JKGj9p4TPWdos/+8ufuak0anIotcr13mZSL3L0nkdneah9ZNS/o9drF/Obr2aKy11+BOJ4dKoBC5uta7UDiJ6KMdiuuJYhcitVd7gVhA0BJlfI+JO4gKuaE1U0KVwJhVBu6/n38VNZS5ThIG1r9AblB3LXBbPgStEI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732653596; c=relaxed/simple; bh=4CqN6YgUkGP+X+wBW7x2hGZgRk+LQ8sW5/tOwNvArkw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=bc9xG4nhE/cEact2xplTYKO0VMptdSUK14X7gy+odAwWz5t9MYJW0rzHnDUVVpU3lDx9sltijclquxJGIa4PODm1QQI8/xK6ZSb+kaBavw2le6UkbHAMfaQwfmFzMPn2tDTzCwmzPcyKqAYNcS/iGgG0qYc+o6iAYU6RP9o8ulg= 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=U8JSpICu; arc=fail smtp.client-ip=40.107.244.58 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="U8JSpICu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Uq4zUDzYTje2O2LG6pXCLt3vD9ekg6Dv4ha2FvTlsPl00Od4r43+DZUgpq4ru0r+vjUzYphFhTFap2evrwyQr6INpZvlsKpn2u78iMCROOdcsaDZM7f1zie+zNuTYdxXERtRJ60HnKfxV6XpkZ/YpXNVoCaEarTBPA5qvglJPfsdfHfDDtozuJ9UrwP6T6GMEaJCxaf5JLwQYa8XGsCkp7nANEAs1jVsczm22BJX5lYIh5uxdNgrtXONQ0PfiZQtTrdr6FNxMWDSlCuMihPJT/z/EvzOaUp7kZu0ZD/uz/hAU7UPP4zqQ3+VUaZ2hFqT8t0gycFoXN3GjveNdVihPQ== 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=Ld8tVkmYkwXU/t9R/isfxzSkWT8bkKlGpQfZ0pzrYvg=; b=aoqAPIpi9ALvFM+mUABmlK8PrOUVFQcTW9wOM2T6E5q0SOnh9cZUUsFGpl7bmrf7XR18vUKLDJiApwbfhClyniJSLSZNoIpv8bX9E5KXaZYTCsGHr1AuPAQHE1br/3FMtPxnCiiR4Qt/zo8SqdiksKvFi9IdnWGF0OUxeTmH5UqaBeYaIVl+AS3Ou1+bqCeCTmZjXtOhA+X+ZeMDTunmE61gNmmj13fdkkEWiaAn6k4JrkDcAsnTOHnlKh7LHjygbCD1r5Nw8fBr5091f2sihaUkILkE7Yw/ku0BigwPJTi5Y8yfCrCGhyluf6XkGSmYkc1GthWQPBBL9RN3ULUc0g== 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=Ld8tVkmYkwXU/t9R/isfxzSkWT8bkKlGpQfZ0pzrYvg=; b=U8JSpICuV8ccWZyipJX6/DHAN3niA5IGMtZW8ewfOWiNcMef5mpXZJsNamDKIGcGOd+IelaD7Peyb4oWvNq4/51+0P2xQ5tRNqtvWKpFYsHqeodNQ4CzunKw+b4bzfxSNZrAB0hiQXjweA2PbNIKHcBgYbS2CTk6UzhG9DEnHMW+AdvjPZqDw8Vdl5PvQWfI/y0VyUok2sKyu2/YI8Airm/wFtRzuZRmJ0WB5hAEcZLsZavb256IzctIE103bCbvuXK4OQaeLARk6ZWMPwbm3SF7IFzrbh/V2FnZ8krB5k84X84AF0pWA+O1SawroWpZ6nAkee9H9fDgjNfZKK3OoA== 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 SA1PR12MB8697.namprd12.prod.outlook.com (2603:10b6:806:385::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.18; Tue, 26 Nov 2024 20:39:51 +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.8182.019; Tue, 26 Nov 2024 20:39:51 +0000 From: Aurelien Aptel To: aaptel@nvidia.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Chaitanya Kulkarni , Daniel Wagner , Shai Malin , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 5/5] nvme/055: add test for nvme-tcp zero-copy offload Date: Tue, 26 Nov 2024 22:38:56 +0200 Message-Id: <20241126203857.27210-6-aaptel@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241126203857.27210-1-aaptel@nvidia.com> References: <20241126203857.27210-1-aaptel@nvidia.com> X-ClientProxiedBy: FR3P281CA0176.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::11) 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_|SA1PR12MB8697:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a87ed56-7e41-4ea7-7c56-08dd0e5a79f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: S3LL3nCQ5tppi3vUv3DLkYGoXC0Ub2o5Vrs0ffrOZ8gEM4yairTrL73CBm3OCmV1Fx32SpO7i9YxG6TAGHp4nJ+fm0xNzcPEXrDKlwYyTLe8wiuQN4vRDZzYBrxF5wwzj+gOi88Tmg8ljrm8bMuwWnBM1yQSjHFS5D8zMajl8uAwBY/8RApAoVGzcP2x+9JRRr1OTyau4oH+gjLamN5/4crfsDMXYoTL0/V9HNLcViMdhMyt3D6YKcTgZvBAjFBrVrdsuEuhwKy/cwDcWGvMg+8acmPhqXMILB4AgYkEsDexpdog3+qX/fgA9j5TsKpBJSltAL9j2ovvbWPMM1qS9ClEcDkX9hS0AekfvC0dF9iXDCh+Q7amr87oKZjTQiceiv0w6/Mh1hXoQOVgGRb14CmY51//vAqct6/BrGZ4vCHqGwoZoyREhCry4Bpf7HcBMbDIkpJ2joO26SGyDnzkxabklMf48lQBvxpDAElUoXnPOAZKA+IOBiBiqPZ5jvVG02dfCIimsjJ1TMNlXdZiy585TjSvNMnrZkI9KSbFVS/cglWaqUDLG5RuQZWtiTNDJVuBLMuWPcaud0kZPsIahXqpjMhqAz5rHFq/YjOfjMGAmnCqTre6/QUDEK9sYtKRA8YTty7VUEqUD2LzchzgjU402zpvCxzUkRo/ghGZrHTqC2Scr2SByO6VDZtuVXyd6NPMH5pX2j6fF9WqRuIXX+ClYUkq+7JN2YbfttlkN7rZdEFFaKxCPWc1QgmeF2xc3+iJ4543/grPkgadMOnKLymqcgVDbGsr0uL///osAkiQBDoMtkz/qQb00FAXqAwzyeZLoYsdMh+4zmWmC16NTWlWUDs5FmOhXVVnIyQf+LIkDyLPnCbbacR9KvT3OKnG9zOUy7e3V2tUIfK8eXJZ28GYBMbCB7o47bOKM4ASPvgOvLhjXqoytLQiHmPY2cmndzMt+E8WvzUzriJoxH+rExo7fjKhFbBnktEgrP06fqhh8Z+8qEeQSQ4Txmhuz5cigbAUgWegLjTQGZ12TrU8wBA1A9w/rI7NanqKlxaxJSAqPzKMqIc4uTwZLBU4Jm71AEb3L8oKJznL9UiBOdQwwDkdYtIZ3GdEMYzPpa/pB9Q3BIHsD0yoA8K+KTh/q8ftJTNIGu6i/bbsugEd9hvp3GTeDWN5NniPAESrgrOKQxCDRv67CRJ3WCGxmi64tI5MtquXIvCfOZcq0G2qoQSbdJqzWCafI/DSqzHfq0MfHMuK1LUdye2sIcaw6M2jlk6WXlo+GXbPo2EjhXorISMy0cnu2dJy6O6GfcmMWZMHo1AedJRDKBVsqlmxE2wBlhlwRYu+nOKz8LTK0tthnYZZDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8943.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-Message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8/h8Qc8Gs3RiYpIbLN/drQYpX8ixDodCSB3C4bBYNGJdUKCG4BRy7SDg3HfVBWCISOu6cg8O5OxLwLb1kUR7JhU2B4+Qa8XuyUd6TzzI3PH1xQAcPlBj9P+TSHo3Oq1A8XW8eooMWn1DijaWV6Gl/V8GMUliy8AvE23i5ayI2Q77jyGVBEdbOA91T3jrBl4advoHDoX2A5C/Uw0eDEQ3M8wNfOjI0QM8MgUa9dX0g3lJ7siNHO5Bby1B0QbMRZ4u+3aUiZvTQy1wgihA3vZpxZQgKFM+DzvIg/PPR8t3DSQeL7u0142AgLvB2L0xP5XvhNSapeAloldWQoctWUgBd7rhhx2UUPYGE6KpjDd4xLaOziHS8zAdpd3QIH+H+L1gQOYSkiqVpz0LN5rKxIQCD0E4FV6iCtSebchvRYbQq2wJAuZnnfIdiyOhbU/jnQctsiZ/trgJVeGLoQ4Z95cXfoDqm/emG5bIUVhoawGqSn2P/cWTsMfKo/+5GfMMfX/aVkBj6fsdwX/+6pQ6cX79Apf0jfCREhO4lZfQNCx+cGn/AtkcZLLWp1Q X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a87ed56-7e41-4ea7-7c56-08dd0e5a79f7 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8943.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:39:51.3725 (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: lDQVF9dlVsWK93DQmZMbqGyOQ1ho/crROzaShtAG9FF19i3lVHltm56X8hcLOWzv150qsHm5l5K+n+DvP1ibhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8697 This commit adds a new test for the kernel ULP DDP (Direct Data Placement) feature with NVMe-TCP. Configuration of DDP is per NIC and is done through a script in the kernel source. For this reason we add 2 new config vars: - KERNELSRC: path to the running kernel sources - NVME_IFACE: name of the network interface to configure the offload on Signed-off-by: Aurelien Aptel Signed-off-by: Shai Malin smalin@nvidia.com Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 9 ++ README.md | 1 + common/rc | 8 + tests/nvme/055 | 285 +++++++++++++++++++++++++++++++++ tests/nvme/055.out | 44 +++++ tests/nvme/rc | 8 + 6 files changed, 355 insertions(+) create mode 100755 tests/nvme/055 create mode 100644 tests/nvme/055.out diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index fe4f729..a42fc91 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -124,6 +124,15 @@ The NVMe tests can be additionally parameterized via environment variables. be skipped and this script gets called. This makes it possible to run the fabric nvme tests against a real target. +#### NVMe-TCP zero-copy offload + +The NVMe-TCP ZC offload tests use a couple more variables. + +- KERNELSRC: Path to running kernel sources. + Needed for the script to configure the offload. +- NVME_IFACE: Name of the interface the offload should be enabled on. + This should be the same interface the NVMe connection is made with. + ### Running nvme-rdma and SRP tests These tests will use the siw (soft-iWARP) driver by default. The rdma_rxe diff --git a/README.md b/README.md index 55227d9..5073510 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Some tests require the following: - nbd-client and nbd-server (Debian) or nbd (Fedora, openSUSE, Arch Linux) - dmsetup (Debian) or device-mapper (Fedora, openSUSE, Arch Linux) - rublk (`cargo install --version=^0.1 rublk`) for ublk test +- python3, ethtool, iproute2 for nvme-tcp zero-copy offload test Build blktests with `make`. Optionally, install it to a known location with `make install` (`/usr/local/blktests` by default, but this can be changed by diff --git a/common/rc b/common/rc index b2e68b2..0c8b51f 100644 --- a/common/rc +++ b/common/rc @@ -148,6 +148,14 @@ _have_loop() { _have_driver loop && _have_program losetup } +_have_kernel_source() { + if [ -z "${KERNELSRC}" ]; then + SKIP_REASONS+=("KERNELSRC not set") + return 1 + fi + return 0 +} + _have_blktrace() { # CONFIG_BLK_DEV_IO_TRACE might still be disabled, but this is easier # to check. We can fix it if someone complains. diff --git a/tests/nvme/055 b/tests/nvme/055 new file mode 100755 index 0000000..7e76126 --- /dev/null +++ b/tests/nvme/055 @@ -0,0 +1,285 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Aurelien Aptel +# +# zero-copy offload + +. tests/nvme/rc + +DESCRIPTION="enable zero copy offload and run rw traffic" +TIMED=1 + +iface_idx="" + +# these vars get updated after each call to connect_run_disconnect() +nb_packets=0 +nb_bytes=0 +nb_offload_packets=0 +nb_offload_bytes=0 +offload_bytes_ratio=0 +offload_packets_ratio=0 + +requires() { + _nvme_requires + _require_remote_nvme_target + _require_nvme_trtype tcp + _have_kernel_option ULP_DDP + # require nvme-tcp as a module to be able to change the ddp_offload param + _have_module nvme_tcp && _have_module_param nvme_tcp ddp_offload + _have_fio + _have_program ip + _have_program ethtool + _have_kernel_source && have_netlink_cli && _have_program python3 + have_iface +} + +have_netlink_cli() { + local cli + cli="${KERNELSRC}/tools/net/ynl/cli.py" + + if ! [ -f "$cli" ]; then + SKIP_REASONS+=("Kernel sources do not have tools/net/ynl/cli.py") + return 1 + fi + + if ! "$cli" -h &> /dev/null; then + SKIP_REASONS+=("Cannot run the kernel tools/net/ynl/cli.py") + return 1; + fi + + if ! [ -f "${KERNELSRC}/Documentation/netlink/specs/ulp_ddp.yaml" ]; then + SKIP_REASONS+=("Kernel sources do not have the ULP DDP netlink specs") + return 1 + fi +} + +have_iface() { + if [ -z "${NVME_IFACE}" ]; then + SKIP_REASONS+=("NVME_IFACE not set") + return 1 + fi + return 0 +} + +set_conditions() { + _set_nvme_trtype "$@" +} + +netlink_cli() { + "${KERNELSRC}/tools/net/ynl/cli.py" \ + --spec "${KERNELSRC}/Documentation/netlink/specs/ulp_ddp.yaml" \ + "$@" +} + +eth_stat() { + ethtool -S "${NVME_IFACE}" | awk "/ $1:/ { print \$2 }" +} + +ddp_stat() { + netlink_cli --do stats-get --json "{\"ifindex\": $iface_idx}" \ + | awk -F: "/'$1'/{print \$2;}" | tr -d '{},' +} + +ddp_caps() { + local out + out="$(netlink_cli --do caps-get --json "{\"ifindex\": $iface_idx}")" + echo "$out" | tr '{},' '\n' | tr -d ' '| awk -F: "/$1/ { print \$2 }" +} + +configure_ddp() { + local mod_param + local cap + + mod_param=$1 + cap=$2 + + echo "=== configured with ddp_offload=$mod_param and caps=$cap ===" + + # set ddp_offload module param + modprobe -q -r nvme-tcp + modprobe -q nvme-tcp ddp_offload=$mod_param + + # set capabilities + netlink_cli --do caps-set --json "{\"ifindex\": $iface_idx, \"wanted\": $cap, \"wanted_mask\": 3}" >> "$FULL" 2>&1 +} + +connect_run_disconnect() { + local io_size + local nvme_dev + local nb_drop + local drop_ratio + local nb_resync + local resync_ratio + + # offload stat counters + local start_sk_add + local start_sk_add_fail + local start_sk_del + local start_setup + local start_setup_fail + local start_teardown + local start_off_bytes + local start_eth_bytes + local start_off_packets + local start_eth_packets + local end_sk_add + local end_sk_add_fail + local end_sk_del + local end_setup + local end_setup_fail + local end_teardown + local end_drop + local end_resync + local end_off_bytes + local end_eth_bytes + local end_off_packets + local end_eth_packets + + io_size=$1 + + start_sk_add=$(ddp_stat rx-nvme-tcp-sk-add) + start_sk_add_fail=$(ddp_stat rx-nvme-tcp-sk-add-fail) + start_sk_del=$(ddp_stat rx-nvme-tcp-sk-del) + start_setup=$(ddp_stat rx-nvme-tcp-setup) + start_setup_fail=$(ddp_stat rx-nvme-tcp-setup-fail) + start_teardown=$(ddp_stat rx-nvme-tcp-teardown) + start_drop=$(ddp_stat rx-nvme-tcp-drop) + start_resync=$(ddp_stat rx-nvme-tcp-resync) + start_off_packets=$(ddp_stat rx-nvme-tcp-packets) + start_off_bytes=$(ddp_stat rx-nvme-tcp-bytes) + start_eth_packets=$(eth_stat rx_packets) + start_eth_bytes=$(eth_stat rx_bytes) + _nvme_connect_subsys --hdr-digest --data-digest --nr-io-queues 8 + + nvme_dev="/dev/$(_find_nvme_ns "${def_subsys_uuid}")" + + local common_args=( + --blocksize_range=$io_size + --rw=randrw + --numjobs=8 + --iodepth=128 + --name=randrw + --ioengine=libaio + --time_based + --runtime="$TIMEOUT" + --direct=1 + --invalidate=1 + --randrepeat=1 + --norandommap + --filename="$nvme_dev" + ) + + echo "IO size: $io_size" + + _run_fio "${common_args[@]}" + _nvme_disconnect_subsys >> "$FULL" 2>&1 + + end_sk_add=$(ddp_stat rx-nvme-tcp-sk-add) + end_sk_add_fail=$(ddp_stat rx-nvme-tcp-sk-add-fail) + end_sk_del=$(ddp_stat rx-nvme-tcp-sk-del) + end_setup=$(ddp_stat rx-nvme-tcp-setup) + end_setup_fail=$(ddp_stat rx-nvme-tcp-setup-fail) + end_teardown=$(ddp_stat rx-nvme-tcp-teardown) + end_drop=$(ddp_stat rx-nvme-tcp-drop) + end_resync=$(ddp_stat rx-nvme-tcp-resync) + end_off_packets=$(ddp_stat rx-nvme-tcp-packets) + end_eth_packets=$(eth_stat rx_packets) + end_off_bytes=$(ddp_stat rx-nvme-tcp-bytes) + end_eth_bytes=$(eth_stat rx_bytes) + + echo "Offloaded sockets: $((end_sk_add - start_sk_add))" + echo "Failed sockets: $((end_sk_add_fail - start_sk_add_fail))" + echo "Unoffloaded sockets: $((end_sk_del - start_sk_del))" + echo "Offload packet leaked: $((end_setup - end_teardown))" + echo "Failed packet setup: $((end_setup_fail - start_setup_fail))" + + # global var results + nb_drop=$(( end_drop - start_drop )) + nb_resync=$(( end_resync - start_resync )) + nb_packets=$(( end_eth_packets - start_eth_packets )) + nb_offload_packets=$(( end_off_packets - start_off_packets )) + nb_bytes=$(( end_eth_bytes - start_eth_bytes )) + nb_offload_bytes=$(( end_off_bytes - start_off_bytes )) + + offload_packets_ratio=0 + offload_bytes_ratio=0 + + # sanity check and avoid div by zero in ratio calculation + if [[ nb_bytes -eq 0 || nb_packets -eq 0 ]]; then + echo "No traffic: $nb_bytes bytes, $nb_packets packets" + return + fi + + offload_packets_ratio=$(( nb_offload_packets*100/nb_packets )) + offload_bytes_ratio=$(( nb_offload_bytes*100/nb_bytes )) + + drop_ratio=$(( nb_drop*100/nb_packets )) + resync_ratio=$(( nb_resync*100/nb_packets )) + [[ drop_ratio -gt 5 ]] && echo "High drop ratio: $drop_ratio %" + [[ resync_ratio -gt 5 ]] && echo "High resync ratio: $resync_ratio %" +} + +test() { + local starting_ddp_config + + : "${TIMEOUT:=30}" + + echo "Running ${TEST_NAME}" + + # get iface index + iface_idx=$(ip address | awk -F: "/${NVME_IFACE}/ { print \$1; exit; }") + + # check hw supports ddp + if [[ $(( $(ddp_caps hw) & 3)) -ne 3 ]]; then + SKIP_REASONS+=("${NVME_IFACE} does not support nvme-tcp ddp offload") + return + fi + + _setup_nvmet + _nvmet_target_setup + + if [ "$(cat "/sys/module/nvme_tcp/parameters/ddp_offload")" = Y ]; then + starting_ddp_config="1 $(ddp_caps active)" + else + starting_ddp_config="0 $(ddp_caps active)" + fi + + # if any of the offload knobs are disabled, no offload should occur + # and offloaded packets & bytes should be zero + + configure_ddp 0 0 + connect_run_disconnect 32k-1M + echo "Offloaded packets: $nb_offload_packets" + echo "Offloaded bytes: $nb_offload_bytes" + + configure_ddp 0 3 + connect_run_disconnect 32k-1M + echo "Offloaded packets: $nb_offload_packets" + echo "Offloaded bytes: $nb_offload_bytes" + + configure_ddp 1 0 + connect_run_disconnect 32k-1M + echo "Offloaded packets: $nb_offload_packets" + echo "Offloaded bytes: $nb_offload_bytes" + + # if everything is enabled, the offload should happen for large IOs only + configure_ddp 1 3 + + connect_run_disconnect 32k-1M + [[ nb_offload_packets -lt 100 ]] && echo "Low offloaded packets: $nb_offload_packets" + [[ nb_offload_bytes -lt 32768 ]] && echo "Low offloaded bytes: $nb_offload_bytes" + [[ offload_bytes_ratio -lt 90 ]] && echo "Low offloaded bytes ratio: $offload_bytes_ratio %" + [[ offload_packets_ratio -lt 95 ]] && echo "Low offloaded packets ratio: $offload_packets_ratio %" + + # small IO should be under the offload threshold, ratio should be zero + connect_run_disconnect 4k-16k + echo "Offload bytes ratio: $offload_bytes_ratio %" + echo "Offload packets ratio: $offload_packets_ratio %" + + _nvmet_target_cleanup + + # restore starting config + configure_ddp $starting_ddp_config > /dev/null + + echo "Test complete" +} diff --git a/tests/nvme/055.out b/tests/nvme/055.out new file mode 100644 index 0000000..06706a6 --- /dev/null +++ b/tests/nvme/055.out @@ -0,0 +1,44 @@ +Running nvme/055 +=== configured with ddp_offload=0 and caps=0 === +IO size: 32k-1M +Offloaded sockets: 0 +Failed sockets: 0 +Unoffloaded sockets: 0 +Offload packet leaked: 0 +Failed packet setup: 0 +Offloaded packets: 0 +Offloaded bytes: 0 +=== configured with ddp_offload=0 and caps=3 === +IO size: 32k-1M +Offloaded sockets: 0 +Failed sockets: 0 +Unoffloaded sockets: 0 +Offload packet leaked: 0 +Failed packet setup: 0 +Offloaded packets: 0 +Offloaded bytes: 0 +=== configured with ddp_offload=1 and caps=0 === +IO size: 32k-1M +Offloaded sockets: 0 +Failed sockets: 0 +Unoffloaded sockets: 0 +Offload packet leaked: 0 +Failed packet setup: 0 +Offloaded packets: 0 +Offloaded bytes: 0 +=== configured with ddp_offload=1 and caps=3 === +IO size: 32k-1M +Offloaded sockets: 8 +Failed sockets: 0 +Unoffloaded sockets: 8 +Offload packet leaked: 0 +Failed packet setup: 0 +IO size: 4k-16k +Offloaded sockets: 8 +Failed sockets: 0 +Unoffloaded sockets: 8 +Offload packet leaked: 0 +Failed packet setup: 0 +Offload bytes ratio: 0 % +Offload packets ratio: 0 % +Test complete diff --git a/tests/nvme/rc b/tests/nvme/rc index d1a4c01..4a43e43 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -199,6 +199,14 @@ _require_kernel_nvme_target() { return 0 } +_require_remote_nvme_target() { + if [ -z "${nvme_target_control}" ]; then + SKIP_REASONS+=("Remote target required but NVME_TARGET_CONTROL is not set") + return 1 + fi + return 0 +} + _test_dev_nvme_ctrl() { echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")" }