All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-23 16:41 ` petrm
  0 siblings, 0 replies; 9+ messages in thread
From: Petr Machata @ 2018-05-23 16:41 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah

Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
Request headroom in __gre6_xmit()") fix problems in reserving headroom
in the packets tunneled through ip6gre/tap and ip6erspan netdevices.

These two patches included snippets that reproduced the issues. This
patch elevates the snippets to a full-fledged test case.

Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh

diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
new file mode 100755
index 0000000..9aaf63fd
--- /dev/null
+++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Test that enough headroom is reserved for the first packet passing through an
+# IPv6 GRE-like netdevice.
+
+setup_prepare()
+{
+	ip link add h1 type veth peer name swp1
+	ip link add h3 type veth peer name swp3
+
+	ip link set dev h1 up
+	ip address add 192.0.2.1/28 dev h1
+
+	ip link add dev vh3 type vrf table 20
+	ip link set dev h3 master vh3
+	ip link set dev vh3 up
+	ip link set dev h3 up
+
+	ip link set dev swp3 up
+	ip address add dev swp3 2001:db8:2::1/64
+
+	ip link set dev swp1 up
+	tc qdisc add dev swp1 clsact
+}
+
+cleanup()
+{
+	ip link del dev swp1
+	ip link del dev swp3
+	ip link del dev vh3
+}
+
+test_headroom()
+{
+	ip link add name gt6 "$@"
+	ip link set dev gt6 up
+
+	sleep 1
+
+	tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
+		action mirred egress mirror dev gt6
+	ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
+	tc filter del dev swp1 ingress pref 1000
+
+	ip link del dev gt6
+
+	# If it doesn't panic, it passes.
+	printf "TEST: %-60s  [PASS]\n" "$2 headroom"
+}
+
+trap cleanup EXIT
+
+setup_prepare
+
+test_headroom type ip6erspan \
+	      local 2001:db8:2::1 remote 2001:db8:2::2 oseq okey 123
+test_headroom type ip6gretap \
+	      local 2001:db8:2::1 remote 2001:db8:2::2
-- 
2.4.11

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-23 16:41 ` petrm
  0 siblings, 0 replies; 9+ messages in thread
From: petrm @ 2018-05-23 16:41 UTC (permalink / raw)


Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
Request headroom in __gre6_xmit()") fix problems in reserving headroom
in the packets tunneled through ip6gre/tap and ip6erspan netdevices.

These two patches included snippets that reproduced the issues. This
patch elevates the snippets to a full-fledged test case.

Suggested-by: David Miller <davem at davemloft.net>
Signed-off-by: Petr Machata <petrm at mellanox.com>
---
 tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh

diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
new file mode 100755
index 0000000..9aaf63fd
--- /dev/null
+++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Test that enough headroom is reserved for the first packet passing through an
+# IPv6 GRE-like netdevice.
+
+setup_prepare()
+{
+	ip link add h1 type veth peer name swp1
+	ip link add h3 type veth peer name swp3
+
+	ip link set dev h1 up
+	ip address add 192.0.2.1/28 dev h1
+
+	ip link add dev vh3 type vrf table 20
+	ip link set dev h3 master vh3
+	ip link set dev vh3 up
+	ip link set dev h3 up
+
+	ip link set dev swp3 up
+	ip address add dev swp3 2001:db8:2::1/64
+
+	ip link set dev swp1 up
+	tc qdisc add dev swp1 clsact
+}
+
+cleanup()
+{
+	ip link del dev swp1
+	ip link del dev swp3
+	ip link del dev vh3
+}
+
+test_headroom()
+{
+	ip link add name gt6 "$@"
+	ip link set dev gt6 up
+
+	sleep 1
+
+	tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
+		action mirred egress mirror dev gt6
+	ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
+	tc filter del dev swp1 ingress pref 1000
+
+	ip link del dev gt6
+
+	# If it doesn't panic, it passes.
+	printf "TEST: %-60s  [PASS]\n" "$2 headroom"
+}
+
+trap cleanup EXIT
+
+setup_prepare
+
+test_headroom type ip6erspan \
+	      local 2001:db8:2::1 remote 2001:db8:2::2 oseq okey 123
+test_headroom type ip6gretap \
+	      local 2001:db8:2::1 remote 2001:db8:2::2
-- 
2.4.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-23 16:41 ` petrm
  0 siblings, 0 replies; 9+ messages in thread
From: Petr Machata @ 2018-05-23 16:41 UTC (permalink / raw)


Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
Request headroom in __gre6_xmit()") fix problems in reserving headroom
in the packets tunneled through ip6gre/tap and ip6erspan netdevices.

These two patches included snippets that reproduced the issues. This
patch elevates the snippets to a full-fledged test case.

Suggested-by: David Miller <davem at davemloft.net>
Signed-off-by: Petr Machata <petrm at mellanox.com>
---
 tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh

diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
new file mode 100755
index 0000000..9aaf63fd
--- /dev/null
+++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Test that enough headroom is reserved for the first packet passing through an
+# IPv6 GRE-like netdevice.
+
+setup_prepare()
+{
+	ip link add h1 type veth peer name swp1
+	ip link add h3 type veth peer name swp3
+
+	ip link set dev h1 up
+	ip address add 192.0.2.1/28 dev h1
+
+	ip link add dev vh3 type vrf table 20
+	ip link set dev h3 master vh3
+	ip link set dev vh3 up
+	ip link set dev h3 up
+
+	ip link set dev swp3 up
+	ip address add dev swp3 2001:db8:2::1/64
+
+	ip link set dev swp1 up
+	tc qdisc add dev swp1 clsact
+}
+
+cleanup()
+{
+	ip link del dev swp1
+	ip link del dev swp3
+	ip link del dev vh3
+}
+
+test_headroom()
+{
+	ip link add name gt6 "$@"
+	ip link set dev gt6 up
+
+	sleep 1
+
+	tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
+		action mirred egress mirror dev gt6
+	ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
+	tc filter del dev swp1 ingress pref 1000
+
+	ip link del dev gt6
+
+	# If it doesn't panic, it passes.
+	printf "TEST: %-60s  [PASS]\n" "$2 headroom"
+}
+
+trap cleanup EXIT
+
+setup_prepare
+
+test_headroom type ip6erspan \
+	      local 2001:db8:2::1 remote 2001:db8:2::2 oseq okey 123
+test_headroom type ip6gretap \
+	      local 2001:db8:2::1 remote 2001:db8:2::2
-- 
2.4.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
  2018-05-23 16:41 ` petrm
  (?)
@ 2018-05-24 16:19   ` u9012063
  -1 siblings, 0 replies; 9+ messages in thread
From: William Tu @ 2018-05-24 16:19 UTC (permalink / raw)
  To: Petr Machata
  Cc: Linux Kernel Network Developers, linux-kselftest, David Miller,
	Shuah Khan

Hi Petr,

I tried to test this patch on latest net-next but encounter a couple issues.

On Wed, May 23, 2018 at 9:41 AM, Petr Machata <petrm@mellanox.com> wrote:
> Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
> ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
> Request headroom in __gre6_xmit()") fix problems in reserving headroom
> in the packets tunneled through ip6gre/tap and ip6erspan netdevices.
>
> These two patches included snippets that reproduced the issues. This
> patch elevates the snippets to a full-fledged test case.
>
> Suggested-by: David Miller <davem@davemloft.net>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
>  tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh
>
> diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
> new file mode 100755
> index 0000000..9aaf63fd
> --- /dev/null
> +++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
> @@ -0,0 +1,59 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Test that enough headroom is reserved for the first packet passing through an
> +# IPv6 GRE-like netdevice.
> +
> +setup_prepare()
> +{
> +       ip link add h1 type veth peer name swp1
> +       ip link add h3 type veth peer name swp3
> +
> +       ip link set dev h1 up
> +       ip address add 192.0.2.1/28 dev h1
> +
> +       ip link add dev vh3 type vrf table 20
> +       ip link set dev h3 master vh3
> +       ip link set dev vh3 up
> +       ip link set dev h3 up
> +
> +       ip link set dev swp3 up
> +       ip address add dev swp3 2001:db8:2::1/64
> +
> +       ip link set dev swp1 up
> +       tc qdisc add dev swp1 clsact
> +}
> +
> +cleanup()
> +{
> +       ip link del dev swp1
> +       ip link del dev swp3
> +       ip link del dev vh3
I think we also need to do:
ip link del dev gt6

> +}
> +
> +test_headroom()
> +{
> +       ip link add name gt6 "$@"
> +       ip link set dev gt6 up
> +
> +       sleep 1
> +
> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
> +               action mirred egress mirror dev gt6
> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null

I increase ping count from 1 to 1000
and after a while the program hangs when I try to ctrl+c
+ cleanup
+ ip link del dev swp1
dmesg shows:
....
[ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9

Thanks
William

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-24 16:19   ` u9012063
  0 siblings, 0 replies; 9+ messages in thread
From: u9012063 @ 2018-05-24 16:19 UTC (permalink / raw)


Hi Petr,

I tried to test this patch on latest net-next but encounter a couple issues.

On Wed, May 23, 2018 at 9:41 AM, Petr Machata <petrm at mellanox.com> wrote:
> Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
> ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
> Request headroom in __gre6_xmit()") fix problems in reserving headroom
> in the packets tunneled through ip6gre/tap and ip6erspan netdevices.
>
> These two patches included snippets that reproduced the issues. This
> patch elevates the snippets to a full-fledged test case.
>
> Suggested-by: David Miller <davem at davemloft.net>
> Signed-off-by: Petr Machata <petrm at mellanox.com>
> ---
>  tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh
>
> diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
> new file mode 100755
> index 0000000..9aaf63fd
> --- /dev/null
> +++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
> @@ -0,0 +1,59 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Test that enough headroom is reserved for the first packet passing through an
> +# IPv6 GRE-like netdevice.
> +
> +setup_prepare()
> +{
> +       ip link add h1 type veth peer name swp1
> +       ip link add h3 type veth peer name swp3
> +
> +       ip link set dev h1 up
> +       ip address add 192.0.2.1/28 dev h1
> +
> +       ip link add dev vh3 type vrf table 20
> +       ip link set dev h3 master vh3
> +       ip link set dev vh3 up
> +       ip link set dev h3 up
> +
> +       ip link set dev swp3 up
> +       ip address add dev swp3 2001:db8:2::1/64
> +
> +       ip link set dev swp1 up
> +       tc qdisc add dev swp1 clsact
> +}
> +
> +cleanup()
> +{
> +       ip link del dev swp1
> +       ip link del dev swp3
> +       ip link del dev vh3
I think we also need to do:
ip link del dev gt6

> +}
> +
> +test_headroom()
> +{
> +       ip link add name gt6 "$@"
> +       ip link set dev gt6 up
> +
> +       sleep 1
> +
> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
> +               action mirred egress mirror dev gt6
> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null

I increase ping count from 1 to 1000
and after a while the program hangs when I try to ctrl+c
+ cleanup
+ ip link del dev swp1
dmesg shows:
....
[ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9

Thanks
William
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-24 16:19   ` u9012063
  0 siblings, 0 replies; 9+ messages in thread
From: William Tu @ 2018-05-24 16:19 UTC (permalink / raw)


Hi Petr,

I tried to test this patch on latest net-next but encounter a couple issues.

On Wed, May 23, 2018@9:41 AM, Petr Machata <petrm@mellanox.com> wrote:
> Commit 5691484df961 ("net: ip6_gre: Fix headroom request in
> ip6erspan_tunnel_xmit()") and commit 01b8d064d58b ("net: ip6_gre:
> Request headroom in __gre6_xmit()") fix problems in reserving headroom
> in the packets tunneled through ip6gre/tap and ip6erspan netdevices.
>
> These two patches included snippets that reproduced the issues. This
> patch elevates the snippets to a full-fledged test case.
>
> Suggested-by: David Miller <davem at davemloft.net>
> Signed-off-by: Petr Machata <petrm at mellanox.com>
> ---
>  tools/testing/selftests/net/ip6_gre_headroom.sh | 59 +++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100755 tools/testing/selftests/net/ip6_gre_headroom.sh
>
> diff --git a/tools/testing/selftests/net/ip6_gre_headroom.sh b/tools/testing/selftests/net/ip6_gre_headroom.sh
> new file mode 100755
> index 0000000..9aaf63fd
> --- /dev/null
> +++ b/tools/testing/selftests/net/ip6_gre_headroom.sh
> @@ -0,0 +1,59 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Test that enough headroom is reserved for the first packet passing through an
> +# IPv6 GRE-like netdevice.
> +
> +setup_prepare()
> +{
> +       ip link add h1 type veth peer name swp1
> +       ip link add h3 type veth peer name swp3
> +
> +       ip link set dev h1 up
> +       ip address add 192.0.2.1/28 dev h1
> +
> +       ip link add dev vh3 type vrf table 20
> +       ip link set dev h3 master vh3
> +       ip link set dev vh3 up
> +       ip link set dev h3 up
> +
> +       ip link set dev swp3 up
> +       ip address add dev swp3 2001:db8:2::1/64
> +
> +       ip link set dev swp1 up
> +       tc qdisc add dev swp1 clsact
> +}
> +
> +cleanup()
> +{
> +       ip link del dev swp1
> +       ip link del dev swp3
> +       ip link del dev vh3
I think we also need to do:
ip link del dev gt6

> +}
> +
> +test_headroom()
> +{
> +       ip link add name gt6 "$@"
> +       ip link set dev gt6 up
> +
> +       sleep 1
> +
> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
> +               action mirred egress mirror dev gt6
> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null

I increase ping count from 1 to 1000
and after a while the program hangs when I try to ctrl+c
+ cleanup
+ ip link del dev swp1
dmesg shows:
....
[ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9
[ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
Usage count = 9

Thanks
William
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
  2018-05-24 16:19   ` u9012063
  (?)
@ 2018-05-25  9:05     ` petrm
  -1 siblings, 0 replies; 9+ messages in thread
From: Petr Machata @ 2018-05-25  9:05 UTC (permalink / raw)
  To: William Tu
  Cc: Linux Kernel Network Developers, linux-kselftest, David Miller,
	Shuah Khan

William Tu <u9012063@gmail.com> writes:

>> +cleanup()
>> +{
>> +       ip link del dev swp1
>> +       ip link del dev swp3
>> +       ip link del dev vh3
> I think we also need to do:
> ip link del dev gt6

gt6 is removed in test_headroom, but for early-break sort of scenarios I
guess we do want to have it in cleanup() as well. With 2>/dev/null,
because most of the time it will have been cleaned up already. I'll send
a v2 like that.

>> +test_headroom()
>> +{
>> +       ip link add name gt6 "$@"
>> +       ip link set dev gt6 up
>> +
>> +       sleep 1
>> +
>> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
>> +               action mirred egress mirror dev gt6
>> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
>
> I increase ping count from 1 to 1000
> and after a while the program hangs when I try to ctrl+c
> + cleanup
> + ip link del dev swp1
> dmesg shows:
> ....
> [ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9

Interesting. Looks like another bug, the headroom issue would panic
after the first packet (and only after the first packet--increasing ping
count doesn't make it more likely to reproduce, rerunning the whole
script does).

Thanks,
Petr

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-25  9:05     ` petrm
  0 siblings, 0 replies; 9+ messages in thread
From: petrm @ 2018-05-25  9:05 UTC (permalink / raw)


William Tu <u9012063 at gmail.com> writes:

>> +cleanup()
>> +{
>> +       ip link del dev swp1
>> +       ip link del dev swp3
>> +       ip link del dev vh3
> I think we also need to do:
> ip link del dev gt6

gt6 is removed in test_headroom, but for early-break sort of scenarios I
guess we do want to have it in cleanup() as well. With 2>/dev/null,
because most of the time it will have been cleaned up already. I'll send
a v2 like that.

>> +test_headroom()
>> +{
>> +       ip link add name gt6 "$@"
>> +       ip link set dev gt6 up
>> +
>> +       sleep 1
>> +
>> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
>> +               action mirred egress mirror dev gt6
>> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
>
> I increase ping count from 1 to 1000
> and after a while the program hangs when I try to ctrl+c
> + cleanup
> + ip link del dev swp1
> dmesg shows:
> ....
> [ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9

Interesting. Looks like another bug, the headroom issue would panic
after the first packet (and only after the first packet--increasing ping
count doesn't make it more likely to reproduce, rerunning the whole
script does).

Thanks,
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices
@ 2018-05-25  9:05     ` petrm
  0 siblings, 0 replies; 9+ messages in thread
From: Petr Machata @ 2018-05-25  9:05 UTC (permalink / raw)


William Tu <u9012063 at gmail.com> writes:

>> +cleanup()
>> +{
>> +       ip link del dev swp1
>> +       ip link del dev swp3
>> +       ip link del dev vh3
> I think we also need to do:
> ip link del dev gt6

gt6 is removed in test_headroom, but for early-break sort of scenarios I
guess we do want to have it in cleanup() as well. With 2>/dev/null,
because most of the time it will have been cleaned up already. I'll send
a v2 like that.

>> +test_headroom()
>> +{
>> +       ip link add name gt6 "$@"
>> +       ip link set dev gt6 up
>> +
>> +       sleep 1
>> +
>> +       tc filter add dev swp1 ingress pref 1000 matchall skip_hw \
>> +               action mirred egress mirror dev gt6
>> +       ping -I h1 192.0.2.2 -c 1 -w 2 &> /dev/null
>
> I increase ping count from 1 to 1000
> and after a while the program hangs when I try to ctrl+c
> + cleanup
> + ip link del dev swp1
> dmesg shows:
> ....
> [ 1256.002453] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1266.082571] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9
> [ 1276.163011] unregister_netdevice: waiting for swp1 to become free.
> Usage count = 9

Interesting. Looks like another bug, the headroom issue would panic
after the first packet (and only after the first packet--increasing ping
count doesn't make it more likely to reproduce, rerunning the whole
script does).

Thanks,
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-05-25  9:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 16:41 [PATCH net-next] selftests: net: Test headroom handling of ip6_gre devices Petr Machata
2018-05-23 16:41 ` Petr Machata
2018-05-23 16:41 ` petrm
2018-05-24 16:19 ` William Tu
2018-05-24 16:19   ` William Tu
2018-05-24 16:19   ` u9012063
2018-05-25  9:05   ` Petr Machata
2018-05-25  9:05     ` Petr Machata
2018-05-25  9:05     ` petrm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.