netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: bpf: add check for ip XDP redirect
@ 2017-08-11  0:02 William Tu
  2017-08-11 11:31 ` Daniel Borkmann
  0 siblings, 1 reply; 3+ messages in thread
From: William Tu @ 2017-08-11  0:02 UTC (permalink / raw)
  To: netdev; +Cc: Daniel Borkmann, John Fastabend

Kernel test robot reports error when running test_xdp_redirect.sh.
Check if ip tool supports xdpgeneric, if not, skip the test.

Signed-off-by: William Tu <u9012063@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
---
 tools/testing/selftests/bpf/test_xdp_redirect.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh b/tools/testing/selftests/bpf/test_xdp_redirect.sh
index d8c73ed6e040..c5a8b7173c12 100755
--- a/tools/testing/selftests/bpf/test_xdp_redirect.sh
+++ b/tools/testing/selftests/bpf/test_xdp_redirect.sh
@@ -23,6 +23,11 @@ cleanup()
 	ip netns del ns2 2> /dev/null
 }
 
+ip link set dev lo xdpgeneric off 2>/dev/null > /dev/null
+if [ $? -ne 0 ];then
+        echo "selftests: [SKIP] Could not run test without the ip xdpgeneric support"
+        exit 0
+fi
 set -e
 
 ip netns add ns1
-- 
2.7.4

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

* Re: [PATCH] selftests: bpf: add check for ip XDP redirect
  2017-08-11  0:02 [PATCH] selftests: bpf: add check for ip XDP redirect William Tu
@ 2017-08-11 11:31 ` Daniel Borkmann
  2017-08-11 13:35   ` William Tu
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Borkmann @ 2017-08-11 11:31 UTC (permalink / raw)
  To: William Tu, netdev; +Cc: John Fastabend

On 08/11/2017 02:02 AM, William Tu wrote:
> Kernel test robot reports error when running test_xdp_redirect.sh.
> Check if ip tool supports xdpgeneric, if not, skip the test.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: John Fastabend <john.fastabend@gmail.com>
> ---
>   tools/testing/selftests/bpf/test_xdp_redirect.sh | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh b/tools/testing/selftests/bpf/test_xdp_redirect.sh
> index d8c73ed6e040..c5a8b7173c12 100755
> --- a/tools/testing/selftests/bpf/test_xdp_redirect.sh
> +++ b/tools/testing/selftests/bpf/test_xdp_redirect.sh
> @@ -23,6 +23,11 @@ cleanup()
>   	ip netns del ns2 2> /dev/null
>   }
>
> +ip link set dev lo xdpgeneric off 2>/dev/null > /dev/null
> +if [ $? -ne 0 ];then
> +        echo "selftests: [SKIP] Could not run test without the ip xdpgeneric support"
> +        exit 0

Small nit: could you make that indent consistently as tabs
like in your cleanup() function slightly further above?

Other than that (+ subject should also be [PATCH net-next]):

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

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

* Re: [PATCH] selftests: bpf: add check for ip XDP redirect
  2017-08-11 11:31 ` Daniel Borkmann
@ 2017-08-11 13:35   ` William Tu
  0 siblings, 0 replies; 3+ messages in thread
From: William Tu @ 2017-08-11 13:35 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: Linux Kernel Network Developers, John Fastabend

thanks! I will fix it and re-submit.
William

On Fri, Aug 11, 2017 at 4:31 AM, Daniel Borkmann <daniel@iogearbox.net> wrote:
> On 08/11/2017 02:02 AM, William Tu wrote:
>>
>> Kernel test robot reports error when running test_xdp_redirect.sh.
>> Check if ip tool supports xdpgeneric, if not, skip the test.
>>
>> Signed-off-by: William Tu <u9012063@gmail.com>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Cc: John Fastabend <john.fastabend@gmail.com>
>> ---
>>   tools/testing/selftests/bpf/test_xdp_redirect.sh | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh
>> b/tools/testing/selftests/bpf/test_xdp_redirect.sh
>> index d8c73ed6e040..c5a8b7173c12 100755
>> --- a/tools/testing/selftests/bpf/test_xdp_redirect.sh
>> +++ b/tools/testing/selftests/bpf/test_xdp_redirect.sh
>> @@ -23,6 +23,11 @@ cleanup()
>>         ip netns del ns2 2> /dev/null
>>   }
>>
>> +ip link set dev lo xdpgeneric off 2>/dev/null > /dev/null
>> +if [ $? -ne 0 ];then
>> +        echo "selftests: [SKIP] Could not run test without the ip
>> xdpgeneric support"
>> +        exit 0
>
>
> Small nit: could you make that indent consistently as tabs
> like in your cleanup() function slightly further above?
>
> Other than that (+ subject should also be [PATCH net-next]):
>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>

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

end of thread, other threads:[~2017-08-11 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11  0:02 [PATCH] selftests: bpf: add check for ip XDP redirect William Tu
2017-08-11 11:31 ` Daniel Borkmann
2017-08-11 13:35   ` William Tu

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