linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH blktests V2] tests/srp: fix module loading issue during srp tests
@ 2021-10-18  2:40 Yi Zhang
  2021-10-19 19:43 ` Omar Sandoval
  0 siblings, 1 reply; 3+ messages in thread
From: Yi Zhang @ 2021-10-18  2:40 UTC (permalink / raw)
  To: osandov, bvanassche; +Cc: linux-block

The ib_isert/ib_srpt modules will be automatically loaded after the first
 time rdma_rxe/siw setup, which will lead srp tests fail.

$ modprobe rdma_rxe
$ echo eno1 >/sys/module/rdma_rxe/parameters/add
$ lsmod | grep -E "ib_srpt|iscsi_target_mod|ib_isert"
ib_srpt               167936  0
ib_isert              139264  0
iscsi_target_mod      843776  1 ib_isert
target_core_mod      1069056  3 iscsi_target_mod,ib_srpt,ib_isert
rdma_cm               315392  5 rpcrdma,ib_srpt,ib_iser,ib_isert,rdma_ucm
ib_cm                 344064  2 rdma_cm,ib_srpt
ib_core              1101824  10 rdma_cm,rdma_rxe,rpcrdma,ib_srpt,iw_cm,ib_iser,ib_isert,rdma_ucm,ib_uverbs,ib_cm

$ ./check srp/001
srp/001 (Create and remove LUNs)                             [failed]
    runtime    ...  3.675s
    --- tests/srp/001.out	2021-10-13 01:18:50.846740093 -0400
    +++ /root/blktests/results/nodev/srp/001.out.bad	2021-10-14 03:24:18.593852208 -0400
    @@ -1,3 +1 @@
    -Configured SRP target driver
    -count_luns(): 3 <> 3
    -Passed
    +insmod: ERROR: could not insert module /lib/modules/5.15.0-rc5.fix+/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko: File exists
modprobe: FATAL: Module iscsi_target_mod is in use.

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
---
 tests/srp/rc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/srp/rc b/tests/srp/rc
index 7239d87..16638a4 100755
--- a/tests/srp/rc
+++ b/tests/srp/rc
@@ -497,7 +497,8 @@ start_lio_srpt() {
 	if modinfo ib_srpt | grep -q '^parm:[[:blank:]]*rdma_cm_port:'; then
 		opts+=("rdma_cm_port=${srp_rdma_cm_port}")
 	fi
-	insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?
+	unload_module ib_srpt &&
+		insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?
 	i=0
 	for r in "${vdev_path[@]}"; do
 		if [ -b "$(readlink -f "$r")" ]; then
@@ -554,7 +555,7 @@ stop_lio_srpt() {
 	rmdir /sys/kernel/config/target/*/* >&/dev/null
 	rmdir /sys/kernel/config/target/* >&/dev/null
 
-	for m in ib_srpt iscsi_target_mod target_core_pscsi target_core_iblock \
+	for m in ib_srpt ib_isert iscsi_target_mod target_core_pscsi target_core_iblock \
 			 target_core_file target_core_stgt target_core_user \
 			 target_core_mod
 	do
-- 
2.21.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests V2] tests/srp: fix module loading issue during srp tests
  2021-10-18  2:40 [PATCH blktests V2] tests/srp: fix module loading issue during srp tests Yi Zhang
@ 2021-10-19 19:43 ` Omar Sandoval
  2021-10-24 12:44   ` Yi Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Omar Sandoval @ 2021-10-19 19:43 UTC (permalink / raw)
  To: Yi Zhang; +Cc: bvanassche, linux-block

On Mon, Oct 18, 2021 at 10:40:07AM +0800, Yi Zhang wrote:
> The ib_isert/ib_srpt modules will be automatically loaded after the first
>  time rdma_rxe/siw setup, which will lead srp tests fail.
> 
> $ modprobe rdma_rxe
> $ echo eno1 >/sys/module/rdma_rxe/parameters/add
> $ lsmod | grep -E "ib_srpt|iscsi_target_mod|ib_isert"
> ib_srpt               167936  0
> ib_isert              139264  0
> iscsi_target_mod      843776  1 ib_isert
> target_core_mod      1069056  3 iscsi_target_mod,ib_srpt,ib_isert
> rdma_cm               315392  5 rpcrdma,ib_srpt,ib_iser,ib_isert,rdma_ucm
> ib_cm                 344064  2 rdma_cm,ib_srpt
> ib_core              1101824  10 rdma_cm,rdma_rxe,rpcrdma,ib_srpt,iw_cm,ib_iser,ib_isert,rdma_ucm,ib_uverbs,ib_cm
> 
> $ ./check srp/001
> srp/001 (Create and remove LUNs)                             [failed]
>     runtime    ...  3.675s
>     --- tests/srp/001.out	2021-10-13 01:18:50.846740093 -0400
>     +++ /root/blktests/results/nodev/srp/001.out.bad	2021-10-14 03:24:18.593852208 -0400
>     @@ -1,3 +1 @@
>     -Configured SRP target driver
>     -count_luns(): 3 <> 3
>     -Passed
>     +insmod: ERROR: could not insert module /lib/modules/5.15.0-rc5.fix+/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko: File exists
> modprobe: FATAL: Module iscsi_target_mod is in use.
> 
> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
> ---
>  tests/srp/rc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/srp/rc b/tests/srp/rc
> index 7239d87..16638a4 100755
> --- a/tests/srp/rc
> +++ b/tests/srp/rc
> @@ -497,7 +497,8 @@ start_lio_srpt() {
>  	if modinfo ib_srpt | grep -q '^parm:[[:blank:]]*rdma_cm_port:'; then
>  		opts+=("rdma_cm_port=${srp_rdma_cm_port}")
>  	fi
> -	insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?
> +	unload_module ib_srpt &&
> +		insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?

While we're here, can this just be modprobe ib_srpt instead of insmod?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests V2] tests/srp: fix module loading issue during srp tests
  2021-10-19 19:43 ` Omar Sandoval
@ 2021-10-24 12:44   ` Yi Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Yi Zhang @ 2021-10-24 12:44 UTC (permalink / raw)
  To: Omar Sandoval; +Cc: Bart Van Assche, linux-block

On Wed, Oct 20, 2021 at 3:43 AM Omar Sandoval <osandov@osandov.com> wrote:
>
> On Mon, Oct 18, 2021 at 10:40:07AM +0800, Yi Zhang wrote:
> > The ib_isert/ib_srpt modules will be automatically loaded after the first
> >  time rdma_rxe/siw setup, which will lead srp tests fail.
> >
> > $ modprobe rdma_rxe
> > $ echo eno1 >/sys/module/rdma_rxe/parameters/add
> > $ lsmod | grep -E "ib_srpt|iscsi_target_mod|ib_isert"
> > ib_srpt               167936  0
> > ib_isert              139264  0
> > iscsi_target_mod      843776  1 ib_isert
> > target_core_mod      1069056  3 iscsi_target_mod,ib_srpt,ib_isert
> > rdma_cm               315392  5 rpcrdma,ib_srpt,ib_iser,ib_isert,rdma_ucm
> > ib_cm                 344064  2 rdma_cm,ib_srpt
> > ib_core              1101824  10 rdma_cm,rdma_rxe,rpcrdma,ib_srpt,iw_cm,ib_iser,ib_isert,rdma_ucm,ib_uverbs,ib_cm
> >
> > $ ./check srp/001
> > srp/001 (Create and remove LUNs)                             [failed]
> >     runtime    ...  3.675s
> >     --- tests/srp/001.out     2021-10-13 01:18:50.846740093 -0400
> >     +++ /root/blktests/results/nodev/srp/001.out.bad  2021-10-14 03:24:18.593852208 -0400
> >     @@ -1,3 +1 @@
> >     -Configured SRP target driver
> >     -count_luns(): 3 <> 3
> >     -Passed
> >     +insmod: ERROR: could not insert module /lib/modules/5.15.0-rc5.fix+/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko: File exists
> > modprobe: FATAL: Module iscsi_target_mod is in use.
> >
> > Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
> > ---
> >  tests/srp/rc | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/srp/rc b/tests/srp/rc
> > index 7239d87..16638a4 100755
> > --- a/tests/srp/rc
> > +++ b/tests/srp/rc
> > @@ -497,7 +497,8 @@ start_lio_srpt() {
> >       if modinfo ib_srpt | grep -q '^parm:[[:blank:]]*rdma_cm_port:'; then
> >               opts+=("rdma_cm_port=${srp_rdma_cm_port}")
> >       fi
> > -     insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?
> > +     unload_module ib_srpt &&
> > +             insmod "/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt."* "${opts[@]}" || return $?
>
> While we're here, can this just be modprobe ib_srpt instead of insmod?
>

Yeah, change to modprobe also works here, I've send V3 for it.

-- 
Best Regards,
  Yi Zhang


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-24 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  2:40 [PATCH blktests V2] tests/srp: fix module loading issue during srp tests Yi Zhang
2021-10-19 19:43 ` Omar Sandoval
2021-10-24 12:44   ` Yi Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).