linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
@ 2020-07-14 12:40 Paolo Pisati
  2020-07-16  1:01 ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Pisati @ 2020-07-14 12:40 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Shuah Khan
  Cc: netdev, linux-kselftest, linux-kernel

Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:

$ sudo ./ip_defrag.sh
+ set -e
+ mktemp -u XXXXXX
+ readonly NETNS=ns-rGlXcw
+ trap cleanup EXIT
+ setup
+ ip netns add ns-rGlXcw
+ ip -netns ns-rGlXcw link set lo up
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
+ ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
+ cleanup
+ ip netns del ns-rGlXcw

$ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory

$ sudo modprobe nf_defrag_ipv6
$ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
-rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 tools/testing/selftests/net/ip_defrag.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
index 15d3489ecd9c..6919afe47e0a 100755
--- a/tools/testing/selftests/net/ip_defrag.sh
+++ b/tools/testing/selftests/net/ip_defrag.sh
@@ -3,6 +3,8 @@
 #
 # Run a couple of IP defragmentation tests.
 
+modprobe -q nf_defrag_ipv6
+
 set +x
 set -e
 
-- 
2.25.1


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

* Re: [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
  2020-07-14 12:40 [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support Paolo Pisati
@ 2020-07-16  1:01 ` Jakub Kicinski
  2020-07-16  7:23   ` Paolo Pisati
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2020-07-16  1:01 UTC (permalink / raw)
  To: Paolo Pisati
  Cc: David S . Miller, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Tue, 14 Jul 2020 14:40:32 +0200 Paolo Pisati wrote:
>  #
>  # Run a couple of IP defragmentation tests.
>  
> +modprobe -q nf_defrag_ipv6
> +
>  set +x
>  set -e
>  

Any reason you add this command before set -e ?

It seems we want the script to fail if module can't be loaded.

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

* Re: [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
  2020-07-16  1:01 ` Jakub Kicinski
@ 2020-07-16  7:23   ` Paolo Pisati
  2020-07-16 15:38     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Pisati @ 2020-07-16  7:23 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David S . Miller, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Thu, Jul 16, 2020 at 3:01 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Any reason you add this command before set -e ?
>
> It seems we want the script to fail if module can't be loaded.

Cause if CONFIG_NF_DEFRAG_IPV6=y, the script would unnecessarily fail.

-- 
bye,
p.

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

* Re: [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
  2020-07-16  7:23   ` Paolo Pisati
@ 2020-07-16 15:38     ` Jakub Kicinski
  2020-07-16 15:46       ` Paolo Pisati
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2020-07-16 15:38 UTC (permalink / raw)
  To: Paolo Pisati
  Cc: David S . Miller, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Thu, 16 Jul 2020 09:23:12 +0200 Paolo Pisati wrote:
> On Thu, Jul 16, 2020 at 3:01 AM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > Any reason you add this command before set -e ?
> >
> > It seems we want the script to fail if module can't be loaded.  
> 
> Cause if CONFIG_NF_DEFRAG_IPV6=y, the script would unnecessarily fail.

I don't think modprobe fails when code is built in.

$ sudo modprobe pstore
$ echo $?
0
$ grep CONFIG_PSTORE= /boot/config-5.7.8-200.fc32.x86_64
CONFIG_PSTORE=y
$ lsmod | grep pstore
$

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

* Re: [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
  2020-07-16 15:38     ` Jakub Kicinski
@ 2020-07-16 15:46       ` Paolo Pisati
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Pisati @ 2020-07-16 15:46 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David S . Miller, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Thu, Jul 16, 2020 at 5:38 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> I don't think modprobe fails when code is built in.
>
> $ sudo modprobe pstore
> $ echo $?
> 0
> $ grep CONFIG_PSTORE= /boot/config-5.7.8-200.fc32.x86_64
> CONFIG_PSTORE=y
> $ lsmod | grep pstore
> $

Ah, i didn't know - i'll send a V2 then.
-- 
bye,
p.

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

end of thread, other threads:[~2020-07-16 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 12:40 [PATCH] selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support Paolo Pisati
2020-07-16  1:01 ` Jakub Kicinski
2020-07-16  7:23   ` Paolo Pisati
2020-07-16 15:38     ` Jakub Kicinski
2020-07-16 15:46       ` Paolo Pisati

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).