netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] selftests/bpf: fix netdevsim trap_flow_action_cookie read
@ 2020-07-27 11:04 Hangbin Liu
  2020-07-30 23:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hangbin Liu @ 2020-07-27 11:04 UTC (permalink / raw)
  To: netdev; +Cc: Jiri Pirko, David S . Miller, Jakub Kicinski, Hangbin Liu

When read netdevsim trap_flow_action_cookie, we need to init it first,
or we will get "Invalid argument" error.

Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/bpf/test_offload.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py
index 8294ae3ffb3c..43c9cda199b8 100755
--- a/tools/testing/selftests/bpf/test_offload.py
+++ b/tools/testing/selftests/bpf/test_offload.py
@@ -318,6 +318,9 @@ class DebugfsDir:
                 continue
 
             if os.path.isfile(p):
+                # We need to init trap_flow_action_cookie before read it
+                if f == "trap_flow_action_cookie":
+                    cmd('echo deadbeef > %s/%s' % (path, f))
                 _, out = cmd('cat %s/%s' % (path, f))
                 dfs[f] = out.strip()
             elif os.path.isdir(p):
-- 
2.25.4


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

* Re: [PATCH net] selftests/bpf: fix netdevsim trap_flow_action_cookie read
  2020-07-27 11:04 [PATCH net] selftests/bpf: fix netdevsim trap_flow_action_cookie read Hangbin Liu
@ 2020-07-30 23:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-30 23:34 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev, jiri, kuba

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Mon, 27 Jul 2020 19:04:55 +0800

> When read netdevsim trap_flow_action_cookie, we need to init it first,
> or we will get "Invalid argument" error.
> 
> Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied.

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

end of thread, other threads:[~2020-07-30 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 11:04 [PATCH net] selftests/bpf: fix netdevsim trap_flow_action_cookie read Hangbin Liu
2020-07-30 23:34 ` David Miller

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