Skip to content

Commit 4bbca66

Browse files
liuhangbindavem330
authored andcommitted
selftests/bpf: fix netdevsim trap_flow_action_cookie read
When read netdevsim trap_flow_action_cookie, we need to init it first, or we will get "Invalid argument" error. Fixes: d3cbb90 ("netdevsim: add ACL trap reporting cookie as a metadata") Signed-off-by: Hangbin Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8c0de6e commit 4bbca66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/testing/selftests/bpf/test_offload.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ def _debugfs_dir_read(self, path):
318318
continue
319319

320320
if os.path.isfile(p):
321+
# We need to init trap_flow_action_cookie before read it
322+
if f == "trap_flow_action_cookie":
323+
cmd('echo deadbeef > %s/%s' % (path, f))
321324
_, out = cmd('cat %s/%s' % (path, f))
322325
dfs[f] = out.strip()
323326
elif os.path.isdir(p):

0 commit comments

Comments
 (0)