Skip to contentSkip to conversation

network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

PATCH New Alexey Kodanev 3 participants 8 messages Jun 17, 2020 – Jun 22, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Most likely support is disabled with NFS_DISABLE_UDP_SUPPORT config option (default y).
commit b24ee6c64ca7 ("NFS: allow deprecation of NFS UDP protocol")

---
 testcases/network/nfs/nfs_stress/nfs_lib.sh | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
testcases/network/nfs/nfs_stress/nfs_lib.sh +9 -3
index e236cd485..1bd057717 100644
@@ -87,11 +87,17 @@ nfs_mount()
 
 	tst_res TINFO "Mounting NFS: $mnt_cmd"
 	if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then
-		tst_rhost_run -s -c "$mnt_cmd"
-		return
+		tst_rhost_run -c "$mnt_cmd"
+	else
+		$mnt_cmd > /dev/null
 	fi
 
-	ROD $mnt_cmd
+	if [ $? -ne 0 ]; then
+		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
+			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
+		fi
+		tst_brk TBROK "mount command failed"
+	fi
 }
 
 nfs_setup()
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Alexey Kodanev <[email protected]> wrote:

...

--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh

testcases/network/nfs/nfs_stress/nfs_lib.sh nfs_mount() · line 90

Quoted 7 lines

+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh

testcases/network/nfs/nfs_stress/nfs_lib.sh +0 -1
@@ -87,11 +87,17 @@ nfs_mount()
 
        tst_res TINFO "Mounting NFS: $mnt_cmd"
        if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then
-               tst_rhost_run -s -c "$mnt_cmd"
 

Or, maybe we can have a new function naming as 'tst_kconifg_check' to parse kernel .config in shell library as well?

i.e

    tst_kconfig_check "NFS_DISABLE_UDP_SUPPORT=y"
    if [$? -qe 0 ]; then
        tst_rhost_run -s -c "$mnt_cmd"
    else
        exit with TCONF ...

What do you think?

Quoted 26 lines
testcases/network/nfs/nfs_stress/nfs_lib.sh +6 -3
-               return
+               tst_rhost_run -c "$mnt_cmd"
+       else
+               $mnt_cmd > /dev/null
        fi
 
-       ROD $mnt_cmd
+       if [ $? -ne 0 ]; then
+               if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp
-ge 5.6; then
+                       tst_brk TCONF "UDP support disabled with the

kernel config NFS_DISABLE_UDP_SUPPORT?"

testcases/network/nfs/nfs_stress/nfs_lib.sh +3 -1
+               fi
+               tst_brk TBROK "mount command failed"
+       fi
 }
 
 nfs_setup()
--

2.20.1

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200618/cc395a81/attachment.htm>
#2 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Hi Li, Alexey,

Quoted 8 lines

Alexey Kodanev <[email protected]> wrote:

...

--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh

Quoted 2 lines

+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh

(quoted diff) +0 -0
@@ -87,11 +87,17 @@ nfs_mount()
Quoted 7 lines

testcases/network/nfs/nfs_stress/nfs_lib.sh nfs_mount() · line 90

Quoted 3 lines
testcases/network/nfs/nfs_stress/nfs_lib.sh +0 -1
        tst_res TINFO "Mounting NFS: $mnt_cmd"
        if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then
-               tst_rhost_run -s -c "$mnt_cmd"

Or, maybe we can have a new function naming as 'tst_kconifg_check' to parse kernel .config in shell library as well?

+1, I was thinking about it for a long time.

Quoted 8 lines

i.e

    tst_kconfig_check "NFS_DISABLE_UDP_SUPPORT=y"
    if [$? -qe 0 ]; then
        tst_rhost_run -s -c "$mnt_cmd"
    else
        exit with TCONF ...

What do you think?

And also have NEEDS_KCONFIGS (space separated).

Kind regards,
Petr

#3 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Hi Li, Alexey, Cyril,

Quoted 11 lines
Quoted 10 lines

testcases/network/nfs/nfs_stress/nfs_lib.sh nfs_mount() · line 90

Quoted 6 lines

+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh

testcases/network/nfs/nfs_stress/nfs_lib.sh +0 -1
@@ -87,11 +87,17 @@ nfs_mount()
 
        tst_res TINFO "Mounting NFS: $mnt_cmd"
        if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then
-               tst_rhost_run -s -c "$mnt_cmd"

Or, maybe we can have a new function naming as 'tst_kconifg_check' to parse kernel .config in shell library as well?

+1, I was thinking about it for a long time.

Thinking about the balance between base TCONF decision on kernel version vs. require kernel config to be presented I think for cases like this I'd prefer kernel version based check (i.e. the original patch).

Requiring kernel config is ok for traditional distros (and even here is sometimes readable only for root, e.g. Debian/Ubuntu), but it's still rare on arm (other embedded archs). I guess it'd be nice to have some variable, which would turn kernel config based requirement into warning.

Kind regards,
Petr

#4 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Quoted 15 lines · Petr Vorel

Hi Li, Alexey, Cyril,

Quoted 11 lines
Quoted 10 lines

testcases/network/nfs/nfs_stress/nfs_lib.sh nfs_mount() · line 90

Quoted 6 lines

+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh

testcases/network/nfs/nfs_stress/nfs_lib.sh +0 -1
@@ -87,11 +87,17 @@ nfs_mount()
 
        tst_res TINFO "Mounting NFS: $mnt_cmd"
        if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then
-               tst_rhost_run -s -c "$mnt_cmd"

Or, maybe we can have a new function naming as 'tst_kconifg_check' to parse kernel .config in shell library as well?

+1, I was thinking about it for a long time.

Quoted 9 lines

Thinking about the balance between base TCONF decision on kernel version vs. require kernel config to be presented I think for cases like this I'd prefer kernel version based check (i.e. the original patch).

Requiring kernel config is ok for traditional distros (and even here is sometimes readable only for root, e.g. Debian/Ubuntu), but it's still rare on arm (other embedded archs). I guess it'd be nice to have some variable, which would turn kernel config based requirement into warning.

Also the option's name can be renamed in new releases, so the decision should be made only if the option is found (i.e. if we check without the the kernel version).

tst_check_kconfig - will be really nice to have. Then, we will tconf earlier in the setup if this option is found.

What about TCONF_IF_KCONFIG, in addition to NEEDS_KCONFIG?

Quoted 3 lines

Kind regards,
Petr

#5 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Hi Li, Alexey, Cyril,

Quoted 9 lines
Quoted 4 lines

Requiring kernel config is ok for traditional distros (and even here is sometimes readable only for root, e.g. Debian/Ubuntu), but it's still rare on arm (other embedded archs). I guess it'd be nice to have some variable, which would turn kernel config based requirement into warning.

Also the option's name can be renamed in new releases, so the decision should be made only if the option is found (i.e. if we check without the the kernel version).

FYI (you may have noticed) there was an effort to add boolean OR for C implementation:
https://patchwork.ozlabs.org/project/ltp/list/?series=149804&state=*

Quoted 1 line

tst_check_kconfig - will be really nice to have.

+1. Is anybody planning to work on it?

Quoted 4 lines

Then, we will tconf
earlier in the setup if this option is found.

What about TCONF_IF_KCONFIG, in addition to NEEDS_KCONFIG?

+1 (+ add it to C as well).

Kind regards,
Petr

#6 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

Hi Petr, Alexey,

Quoted 13 lines · Petr Vorel

Hi Li, Alexey, Cyril,

Quoted 2 lines
Quoted 2 lines

Requiring kernel config is ok for traditional distros (and even here is sometimes readable only for root, e.g. Debian/Ubuntu), but it's still

rare on

Quoted 1 line
Quoted 1 line

arm (other embedded archs). I guess it'd be nice to have some

variable, which

Quoted 6 lines
Quoted 1 line

would turn kernel config based requirement into warning.

Also the option's name can be renamed in new releases, so the decision should be made only if the option is found (i.e. if we check without the the kernel version).

Quoted 7 lines

FYI (you may have noticed) there was an effort to add boolean OR for C implementation:
https://patchwork.ozlabs.org/project/ltp/list/?series=149804&state=*

Quoted 1 line

tst_check_kconfig - will be really nice to have.

+1. Is anybody planning to work on it?

I have no plan to work on this, but my pleasure to help review/test the patch if possible.

Quoted 7 lines
Quoted 5 lines

Then, we will tconf
earlier in the setup if this option is found.

What about TCONF_IF_KCONFIG, in addition to NEEDS_KCONFIG?

+1 (+ add it to C as well).

NEEDS_KCONFIG - this is optional to me, my previous thought is only to have tst_check_kconfig to match the situation we need to perform some special commands for the kernel with different kconfig, but it is also acceptable to TCONF in setup phase like what we do in C library.

TCONF_IF_KCONFIG - And I haven't realized what the TCONF_IF_KCONFIG the behavior here, maybe needs read code then.

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200619/ee10551f/attachment.htm>
#7 lore raw

PATCH 1/1 network/nsf_lib.sh: TCONF on mount (udp/udp6) failure for Linux v5.6+

In reply to Petr Vorel

Hi all,

Quoted 9 lines
Quoted 3 lines

Also the option's name can be renamed in new releases, so the decision should be made only if the option is found (i.e. if we check without the the kernel version).

FYI (you may have noticed) there was an effort to add boolean OR for C implementation:
https://patchwork.ozlabs.org/project/ltp/list/?series=149804&state=*

Quoted 1 line

tst_check_kconfig - will be really nice to have.

+1. Is anybody planning to work on it?

https://github.com/linux-test-project/ltp/issues/700
I'll try to implement it in July, unless somebody does it before.

Quoted 5 lines
Quoted 4 lines

Then, we will tconf
earlier in the setup if this option is found.

What about TCONF_IF_KCONFIG, in addition to NEEDS_KCONFIG?

+1 (+ add it to C as well).

I'd prefer TWARN_IF_NO_CONFIG, more info in the ticket.

Kind regards,
Petr