Skip to content

Commit cffcb4a

Browse files
liuhangbingregkh
authored andcommitted
selftests/bpf: fix netdevsim trap_flow_action_cookie read
[ Upstream commit 4bbca66 ] 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 <liuhangbin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 15a9441 commit cffcb4a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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