From: Daniel Wagner <dwagner@suse.de>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
Chaitanya Kulkarni <kch@nvidia.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Hannes Reinecke <hare@suse.de>, Sagi Grimberg <sagi@grimberg.me>,
Jason Gunthorpe <jgg@ziepe.ca>, Daniel Wagner <dwagner@suse.de>
Subject: [PATCH blktests v2 0/1] Introduce nvmet target setup/cleanup helpers
Date: Fri, 18 Aug 2023 16:15:34 +0200 [thread overview]
Message-ID: <20230818141537.22332-1-dwagner@suse.de> (raw)
I've decided to at two cleanup patches for the passthru tests. Initially I tried
to get rid of the arguments when calling the helpers.
Instead
_nvmet_passthru_target_setup "${def_subsysnqn}"
just
_nvmet_passthru_target_setup
but I run into the problem that ShellCheck seems to have a bug when default
arguments are used in the function:
fn() {
local -i a=${1:-42}
printf '%d\n' "$a"
}
fn
will trigger SC2119 and SC2120. This has been reported but not fixed yet:
https://github.com/koalaman/shellcheck/issues/2511
Thus I decided to leave it as it is, unless someone has a clever idea
how to get this working.
original cover letter:
Introduce helpers to setup nvmet targets. This is spin off from the refactoring
patches and the allowed_host patches [1].
Sagi suggested to record all resources allocated by nvmet_target_setup and then
later clean them up in nvmet_target_cleanup. I opted to figure out in
nvmet_target_cleanup what was allocated via the newly introdcuded _get_nvmet_ports
helper. The reason being, Hannes told me offline that he would like to add ANA
tests which will add some more ports to the subsystem. I hope with this
the code is more future proof.
BTW, while looking at this I saw that the passthru code is using the awkward
return value port when calling nvmet_passthru_target_setup. It seems some
more refactoring is in order...
[1] https://lore.kernel.org/linux-nvme/5h333eqhtw252sjw6axjewlb5bbb5ze7awekczxe3kie2lnhw6@manyer42khct/
changes
v2:
- drop local subsys variable in passthru tests
- do not use port as handle in passthru tests
- free port after unregistering from subsys
v1:
- https://lore.kernel.org/linux-nvme/20230818095744.24619-1-dwagner@suse.de/
Daniel Wagner (3):
nvme/{033,034,035,036}: use default subsysnqn variable directly
nvme/{033,034,035,036,37}: drop port handle between passthru target
setup and cleanup
nvme: introduce nvmet_target_{setup/cleanup} common code
tests/nvme/003 | 14 ++-----
tests/nvme/004 | 21 ++---------
tests/nvme/005 | 20 +---------
tests/nvme/006 | 19 +---------
tests/nvme/007 | 14 +------
tests/nvme/008 | 21 +----------
tests/nvme/009 | 16 +-------
tests/nvme/010 | 21 +----------
tests/nvme/011 | 16 +-------
tests/nvme/012 | 21 +----------
tests/nvme/013 | 16 +-------
tests/nvme/014 | 21 +----------
tests/nvme/015 | 16 +-------
tests/nvme/018 | 16 +-------
tests/nvme/019 | 21 +----------
tests/nvme/020 | 16 +-------
tests/nvme/021 | 16 +-------
tests/nvme/022 | 16 +-------
tests/nvme/023 | 21 +----------
tests/nvme/024 | 16 +-------
tests/nvme/025 | 16 +-------
tests/nvme/026 | 16 +-------
tests/nvme/027 | 17 ++-------
tests/nvme/028 | 17 ++-------
tests/nvme/029 | 21 +----------
tests/nvme/033 | 10 ++---
tests/nvme/034 | 10 ++---
tests/nvme/035 | 10 ++---
tests/nvme/036 | 12 +++---
tests/nvme/037 | 5 +--
tests/nvme/040 | 19 +---------
tests/nvme/041 | 18 +--------
tests/nvme/042 | 17 +--------
tests/nvme/043 | 17 +--------
tests/nvme/044 | 19 ++--------
tests/nvme/045 | 18 ++-------
tests/nvme/047 | 21 +----------
tests/nvme/048 | 17 +--------
tests/nvme/rc | 99 +++++++++++++++++++++++++++++++++++++++++++++++---
39 files changed, 184 insertions(+), 553 deletions(-)
--
2.41.0
next reply other threads:[~2023-08-18 14:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 14:15 Daniel Wagner [this message]
2023-08-18 14:15 ` [PATCH blktests v2 1/3] nvme/{033,034,035,036}: use default subsysnqn variable directly Daniel Wagner
2023-08-18 14:15 ` [PATCH blktests v2 2/3] nvme/{033,034,035,036,37}: drop port handle between passthru target setup and cleanup Daniel Wagner
2023-08-18 14:15 ` [PATCH blktests v2 3/3] nvme: introduce nvmet_target_{setup/cleanup} common code Daniel Wagner
2023-08-20 14:58 ` Sagi Grimberg
2023-08-21 5:57 ` Daniel Wagner
2023-08-21 7:43 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230818141537.22332-1-dwagner@suse.de \
--to=dwagner@suse.de \
--cc=hare@suse.de \
--cc=jgg@ziepe.ca \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®