* [PATCH blktests v5 1/5] nvme/rc: introduce remote target support
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
@ 2024-12-06 13:51 ` Aurelien Aptel
2024-12-09 7:19 ` Chaitanya Kulkarni
2024-12-06 13:51 ` [PATCH blktests v5 2/5] common/nvme: add digest options to __nvme_connect_subsys() Aurelien Aptel
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Aurelien Aptel @ 2024-12-06 13:51 UTC (permalink / raw)
To: aaptel, linux-block, linux-nvme
Cc: Daniel Wagner, Chaitanya Kulkarni, Shai Malin,
Shin'ichiro Kawasaki
From: Daniel Wagner <dwagner@suse.de>
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 <dwagner@suse.de>
Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
---
Documentation/running-tests.md | 33 ++++++++++++++++++
check | 4 +++
common/nvme | 62 +++++++++++++++++++++++++++++-----
tests/nvme/rc | 14 ++++++++
4 files changed, 105 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..887da4d 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,17 @@ _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_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 +336,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}")
@@ -767,6 +789,7 @@ _nvmet_target_setup() {
local subsysnqn="${def_subsysnqn}"
local subsys_uuid
local port
+ local resv_enable=""
local -a ARGS
while [[ $# -gt 0 ]]; do
@@ -811,6 +834,22 @@ _nvmet_target_setup() {
fi
fi
+ if [[ -n "${nvme_target_control}" ]]; then
+ if [[ -n "${hostkey}" ]]; then
+ ARGS+=(--hostkey "${hostkey}")
+ fi
+ if [[ -n "${ctrlkey}" ]]; then
+ ARGS+=(--ctrkey "${ctrlkey}")
+ fi
+
+ "${nvme_target_control}" setup \
+ --subsysnqn "${subsysnqn}" \
+ --subsys-uuid "${subsys_uuid:-$def_subsys_uuid}" \
+ --hostnqn "${def_hostnqn}" \
+ "${ARGS[@]}" &> /dev/null
+ return
+ fi
+
ARGS=(--subsysnqn "${subsysnqn}")
if [[ -n "${blkdev}" ]]; then
ARGS+=(--blkdev "${blkdev}")
@@ -853,6 +892,13 @@ _nvmet_target_cleanup() {
esac
done
+ if [[ -n "${nvme_target_control}" ]]; then
+ "${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
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH blktests v5 1/5] nvme/rc: introduce remote target support
2024-12-06 13:51 ` [PATCH blktests v5 1/5] nvme/rc: introduce remote target support Aurelien Aptel
@ 2024-12-09 7:19 ` Chaitanya Kulkarni
0 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2024-12-09 7:19 UTC (permalink / raw)
To: Aurelien Aptel, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org
Cc: Daniel Wagner, Shai Malin, Shin'ichiro Kawasaki
On 12/6/24 05:51, Aurelien Aptel wrote:
> From: Daniel Wagner <dwagner@suse.de>
>
> 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 <dwagner@suse.de>
> Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
> ---
>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH blktests v5 2/5] common/nvme: add digest options to __nvme_connect_subsys()
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
2024-12-06 13:51 ` [PATCH blktests v5 1/5] nvme/rc: introduce remote target support Aurelien Aptel
@ 2024-12-06 13:51 ` Aurelien Aptel
2024-12-09 7:19 ` Chaitanya Kulkarni
2024-12-06 13:51 ` [PATCH blktests v5 3/5] nvme/030: only run against kernel soft target Aurelien Aptel
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Aurelien Aptel @ 2024-12-06 13:51 UTC (permalink / raw)
To: aaptel, linux-block, linux-nvme
Cc: Chaitanya Kulkarni, Daniel Wagner, Shai Malin,
Shin'ichiro Kawasaki
This commit lets tests connect nvme subsystems with data and header
digest.
Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
---
common/nvme | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/common/nvme b/common/nvme
index 887da4d..d909d42 100644
--- a/common/nvme
+++ b/common/nvme
@@ -271,6 +271,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
@@ -329,6 +331,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
@@ -380,6 +390,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)
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH blktests v5 3/5] nvme/030: only run against kernel soft target
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
2024-12-06 13:51 ` [PATCH blktests v5 1/5] nvme/rc: introduce remote target support Aurelien Aptel
2024-12-06 13:51 ` [PATCH blktests v5 2/5] common/nvme: add digest options to __nvme_connect_subsys() Aurelien Aptel
@ 2024-12-06 13:51 ` Aurelien Aptel
2024-12-09 7:20 ` Chaitanya Kulkarni
2024-12-06 13:51 ` [PATCH blktests v5 4/5] contrib: add remote target setup/cleanup script Aurelien Aptel
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Aurelien Aptel @ 2024-12-06 13:51 UTC (permalink / raw)
To: aaptel, linux-block, linux-nvme
Cc: Daniel Wagner, Chaitanya Kulkarni, Shai Malin,
Shin'ichiro Kawasaki
From: Daniel Wagner <dwagner@suse.de>
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 <dwagner@suse.de>
---
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")"
}
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH blktests v5 3/5] nvme/030: only run against kernel soft target
2024-12-06 13:51 ` [PATCH blktests v5 3/5] nvme/030: only run against kernel soft target Aurelien Aptel
@ 2024-12-09 7:20 ` Chaitanya Kulkarni
0 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2024-12-09 7:20 UTC (permalink / raw)
To: Aurelien Aptel, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org
Cc: Daniel Wagner, Shai Malin, Shin'ichiro Kawasaki
On 12/6/24 05:51, Aurelien Aptel wrote:
> From: Daniel Wagner<dwagner@suse.de>
>
> 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<dwagner@suse.de>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH blktests v5 4/5] contrib: add remote target setup/cleanup script
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
` (2 preceding siblings ...)
2024-12-06 13:51 ` [PATCH blktests v5 3/5] nvme/030: only run against kernel soft target Aurelien Aptel
@ 2024-12-06 13:51 ` Aurelien Aptel
2024-12-09 7:20 ` Chaitanya Kulkarni
2024-12-06 13:51 ` [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload Aurelien Aptel
2024-12-10 8:17 ` [PATCH blktests v5 0/5] Add support to run against arbitrary targets Shinichiro Kawasaki
5 siblings, 1 reply; 15+ messages in thread
From: Aurelien Aptel @ 2024-12-06 13:51 UTC (permalink / raw)
To: aaptel, linux-block, linux-nvme
Cc: Daniel Wagner, Chaitanya Kulkarni, Shai Malin,
Shin'ichiro Kawasaki
From: Daniel Wagner <dwagner@suse.de>
Use nvmetcli to setup/cleanup a remote soft target.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
---
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 }}"
+ }
+ ]
+}
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
` (3 preceding siblings ...)
2024-12-06 13:51 ` [PATCH blktests v5 4/5] contrib: add remote target setup/cleanup script Aurelien Aptel
@ 2024-12-06 13:51 ` Aurelien Aptel
2024-12-09 7:20 ` Chaitanya Kulkarni
2026-01-28 15:28 ` John Garry
2024-12-10 8:17 ` [PATCH blktests v5 0/5] Add support to run against arbitrary targets Shinichiro Kawasaki
5 siblings, 2 replies; 15+ messages in thread
From: Aurelien Aptel @ 2024-12-06 13:51 UTC (permalink / raw)
To: aaptel, linux-block, linux-nvme
Cc: Chaitanya Kulkarni, Daniel Wagner, Shai Malin,
Shin'ichiro Kawasaki
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 <aaptel@nvidia.com>
Signed-off-by: Shai Malin smalin@nvidia.com
Reviewed-by: Daniel Wagner <dwagner@suse.de>
---
Documentation/running-tests.md | 9 ++
README.md | 1 +
common/rc | 8 +
tests/nvme/055 | 268 +++++++++++++++++++++++++++++++++
tests/nvme/055.out | 44 ++++++
tests/nvme/rc | 8 +
6 files changed, 338 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..4f2f87e
--- /dev/null
+++ b/tests/nvme/055
@@ -0,0 +1,268 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Aurelien Aptel <aaptel@nvidia.com>
+#
+# 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_program python3 && have_netlink_cli
+ 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 nvme_dev
+
+ # offload stat counters
+ # sockets
+ local beg_sk_add beg_sk_add_fail beg_sk_del
+ local end_sk_add end_sk_add_fail end_sk_del
+ # loss
+ local beg_drop beg_resync
+ local end_drop end_resync
+ # bw stats
+ local beg_off_bytes beg_eth_bytes beg_off_packets beg_eth_packets
+ local end_off_bytes end_eth_bytes end_off_packets end_eth_packets
+ # pdu offload setup/teardown
+ local end_setup beg_setup_fail end_setup_fail end_teardown
+
+ local nb_drop drop_ratio
+ local nb_resync resync_ratio
+
+ io_size=$1
+
+ beg_sk_add=$(ddp_stat rx-nvme-tcp-sk-add)
+ beg_sk_add_fail=$(ddp_stat rx-nvme-tcp-sk-add-fail)
+ beg_sk_del=$(ddp_stat rx-nvme-tcp-sk-del)
+ beg_setup_fail=$(ddp_stat rx-nvme-tcp-setup-fail)
+ beg_drop=$(ddp_stat rx-nvme-tcp-drop)
+ beg_resync=$(ddp_stat rx-nvme-tcp-resync)
+ beg_off_packets=$(ddp_stat rx-nvme-tcp-packets)
+ beg_off_bytes=$(ddp_stat rx-nvme-tcp-bytes)
+ beg_eth_packets=$(eth_stat rx_packets)
+ beg_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 - beg_sk_add))"
+ echo "Failed sockets: $((end_sk_add_fail - beg_sk_add_fail))"
+ echo "Unoffloaded sockets: $((end_sk_del - beg_sk_del))"
+ echo "Offload packet leaked: $((end_setup - end_teardown))"
+ echo "Failed packet setup: $((end_setup_fail - beg_setup_fail))"
+
+ # global var results
+ nb_drop=$(( end_drop - beg_drop ))
+ nb_resync=$(( end_resync - beg_resync ))
+ nb_packets=$(( end_eth_packets - beg_eth_packets ))
+ nb_offload_packets=$(( end_off_packets - beg_off_packets ))
+ nb_bytes=$(( end_eth_bytes - beg_eth_bytes ))
+ nb_offload_bytes=$(( end_off_bytes - beg_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
+ local starting_cap
+
+ : "${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
+
+ starting_ddp="$(cat "/sys/module/nvme_tcp/parameters/ddp_offload")"
+ starting_cap="$(ddp_caps active)"
+
+ # if any of the offload knobs are disabled, no offload should occur
+ # and offloaded packets & bytes should be zero
+
+ configure_ddp N 0
+ connect_run_disconnect 32k-1M
+ echo "Offloaded packets: $nb_offload_packets"
+ echo "Offloaded bytes: $nb_offload_bytes"
+
+ configure_ddp N 3
+ connect_run_disconnect 32k-1M
+ echo "Offloaded packets: $nb_offload_packets"
+ echo "Offloaded bytes: $nb_offload_bytes"
+
+ configure_ddp Y 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 Y 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" "$starting_cap" > /dev/null
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/055.out b/tests/nvme/055.out
new file mode 100644
index 0000000..9284a6f
--- /dev/null
+++ b/tests/nvme/055.out
@@ -0,0 +1,44 @@
+Running nvme/055
+=== configured with ddp_offload=N 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=N 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=Y 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=Y 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")"
}
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload
2024-12-06 13:51 ` [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload Aurelien Aptel
@ 2024-12-09 7:20 ` Chaitanya Kulkarni
2026-01-28 15:28 ` John Garry
1 sibling, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2024-12-09 7:20 UTC (permalink / raw)
To: Aurelien Aptel, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org
Cc: Daniel Wagner, Shai Malin, Shin'ichiro Kawasaki
On 12/6/24 05:51, Aurelien Aptel wrote:
> 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<aaptel@nvidia.com>
> Signed-off-by: Shai Malinsmalin@nvidia.com
> Reviewed-by: Daniel Wagner<dwagner@suse.de>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload
2024-12-06 13:51 ` [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload Aurelien Aptel
2024-12-09 7:20 ` Chaitanya Kulkarni
@ 2026-01-28 15:28 ` John Garry
2026-01-29 2:07 ` Shinichiro Kawasaki
2026-01-29 10:28 ` Aurelien Aptel
1 sibling, 2 replies; 15+ messages in thread
From: John Garry @ 2026-01-28 15:28 UTC (permalink / raw)
To: Aurelien Aptel, linux-block, linux-nvme
Cc: Chaitanya Kulkarni, Daniel Wagner, Shai Malin,
Shin'ichiro Kawasaki
On 06/12/2024 13:51, Aurelien Aptel wrote:
> +++ b/tests/nvme/055
> @@ -0,0 +1,268 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2024 Aurelien Aptel<aaptel@nvidia.com>
> +#
> +# 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
I notice that this kernel config option is still not included in
mainline, over 1 year later.
It is strange to me to merge tests for features which are yet to be
accepted.
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload
2026-01-28 15:28 ` John Garry
@ 2026-01-29 2:07 ` Shinichiro Kawasaki
2026-01-29 10:28 ` Aurelien Aptel
1 sibling, 0 replies; 15+ messages in thread
From: Shinichiro Kawasaki @ 2026-01-29 2:07 UTC (permalink / raw)
To: John Garry
Cc: Aurelien Aptel, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org, Chaitanya Kulkarni, Daniel Wagner,
Shai Malin
On Jan 28, 2026 / 15:28, John Garry wrote:
> On 06/12/2024 13:51, Aurelien Aptel wrote:
> > +++ b/tests/nvme/055
> > @@ -0,0 +1,268 @@
> > +#!/bin/bash
> > +# SPDX-License-Identifier: GPL-3.0+
> > +# Copyright (C) 2024 Aurelien Aptel<aaptel@nvidia.com>
> > +#
> > +# 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
>
> I notice that this kernel config option is still not included in mainline,
> over 1 year later.
>
> It is strange to me to merge tests for features which are yet to be
> accepted.
When this test case was added, I was aware of that the DDP offload feature was
not yet accepted [1]. At that time, I expected that the feature would be applied
soon.
This test case was the first use case of the blktests feature
"NVME_TARGET_CONTROL" which allows setting up nvme targets for testing in
flexible manner [2]. The test case was useful to demonstrate the value of the
feature. That's why I merged the test for "features which are yet to be
accepted".
Said that, assuming the DDP offload feature is not going to be mainlined, this
test case has lost its value. I think it is reasonable to remove the test case
at this moment. A patch post for removal will be helpful to confirm consensus.
[1] https://lore.kernel.org/all/2537c8iv1kq.fsf@nvidia.com/
[2] https://lore.kernel.org/linux-block/20241206135120.5141-2-aaptel@nvidia.com/
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload
2026-01-28 15:28 ` John Garry
2026-01-29 2:07 ` Shinichiro Kawasaki
@ 2026-01-29 10:28 ` Aurelien Aptel
1 sibling, 0 replies; 15+ messages in thread
From: Aurelien Aptel @ 2026-01-29 10:28 UTC (permalink / raw)
To: John Garry, linux-block, linux-nvme
Cc: Chaitanya Kulkarni, Daniel Wagner, Shai Malin,
Shin'ichiro Kawasaki
Hi,
John Garry <john.g.garry@oracle.com> writes:
> I notice that this kernel config option is still not included in
> mainline, over 1 year later.
>
> It is strange to me to merge tests for features which are yet to be
> accepted.
These patches were required by the kernel reviewers to be merged in the
test suite before the feature can be merged in the kernel.
The last review round for the kernel feature unfortunately required some
major redesigning and has not been merged since.
Thanks
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH blktests v5 0/5] Add support to run against arbitrary targets
2024-12-06 13:51 [PATCH blktests v5 0/5] Add support to run against arbitrary targets Aurelien Aptel
` (4 preceding siblings ...)
2024-12-06 13:51 ` [PATCH blktests v5 5/5] nvme/055: add test for nvme-tcp zero-copy offload Aurelien Aptel
@ 2024-12-10 8:17 ` Shinichiro Kawasaki
5 siblings, 0 replies; 15+ messages in thread
From: Shinichiro Kawasaki @ 2024-12-10 8:17 UTC (permalink / raw)
To: Aurelien Aptel
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
Chaitanya Kulkarni, Daniel Wagner, Shai Malin
On Dec 06, 2024 / 15:51, Aurelien Aptel wrote:
> This series is based off Daniel's patches. It is rebased to work on
> current blktests. It is also available on github:
>
> https://github.com/aaptel/blktests.git branch remote-target-v5
>
> The last patch adds a test making explicit use of the remote target
> support by testing the new nvme-tcp offloading.
>
> changes:
> v5:
> - remove duplicated code, truncate regression in _nvmet_target_setup()
> - remove def_host_traddr, use of eval
> - fix shellcheck warnings
> - cleanup test nvme/055
I applied the v5 series. Please note that I renumbered the test case from
nvme/055 to nvme/056. Thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread