[PATCH blktests 11/15] common/nvme, nvme/003: add --no_port option to _nvme_connect_subsys
Shinichiro Kawasaki
shinichiro.kawasaki at wdc.com
Mon Oct 28 00:07:15 PDT 2024
On Oct 25, 2024 / 16:54, Daniel Wagner wrote:
> On Thu, Oct 24, 2024 at 10:00:21AM GMT, Shin'ichiro Kawasaki wrote:
> > Commit "nvme: pass in port parameter to _nvme_connect_subsys()"
> > introduced the --port argument to _nvme_connect_subsys(). If the option
> > is not specified, _nvme_connect_subsys() automatically finds the port
> > for the specified subsysnqn. However, this does not work for the test
> > case nvme/003, since the test case connects to the subsys for discovery,
> > then, the port of the created subsysnqn is not to be used. This causes
> > the failure of the test case.
> >
> > To avoid the failure, introduce --no_port option. When this is option is
> > specified, _nvme_connect_subsys() skips the port finding step.
>
> Can't we just figure out from the subsys name if we need to use the
> default ports directly?
I think we can do it. Instead of --no_port option, _nvme_connect_subsys() can
check if the subsys name matches "nvmexpress.dicovery", and make
_get_nvmet_port_params() skip port dependent parameters.
Having said that, I'm not sure if this is the best, because this will hide the
nvme/003 unique operation within _nvme_connect_subsys(). See some more
explanation below.
> I am not so sure about the --no_port argument
> is a good idea. And if a test wants to use a specific port, we have the
> port option, no?
AFAIU, there will be three kinds of _nvme_connect_subsys() calls from port
parameter point of view:
1) Default port(s)
No port related option is specified to _nvme_connect_subsys().
_nvme_connect_subsys() gets the ports prepared, and refer to them.
2) Specific multiple ports
--port option is specified to _nvme_connect_subsys().
Following series will add tests for them.
3) No port
nvme/003 creates a nvmet subsystem with default port. The test case
also connects to another subsys "nqn.2014-08.org.nvmexpress.discovery"
by calling _nvmet_connect_subsys(). In this case, port related parameters
should not be specified.
To clarify that the _nvmet_connect_subsys() call in nvme/003 is the 3) case, I
suggest to introduce --no_port option. It will explicitly show that
_nvmet_connect_subsys() does the exceptional parameter preparation.
More information about the Linux-nvme
mailing list