Skip to content

Commit 3a984dd

Browse files
committed
Revert "Core: Export every XDP action from pythonbpf.helper"
This reverts commit 55fb6d6.
1 parent 55fb6d6 commit 3a984dd

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

‎pythonbpf/helper/__init__.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
skb_store_bytes,
1919
get_current_cgroup_id,
2020
get_stack,
21-
XDP_ABORTED,
2221
XDP_DROP,
2322
XDP_PASS,
24-
XDP_TX,
25-
XDP_REDIRECT,
2623
)
2724

2825

@@ -89,9 +86,6 @@ def helper_call_handler(call, compilation_context, builder, func, local_sym_tab)
8986
"uid",
9087
"skb_store_bytes",
9188
"get_stack",
92-
"XDP_ABORTED",
9389
"XDP_DROP",
9490
"XDP_PASS",
95-
"XDP_TX",
96-
"XDP_REDIRECT",
9791
]

‎tests/kernel_selftest_equivalent/xdp/xdp_tx.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
# Bounce every packet back out of the interface it arrived on. Upstream is
44
# the transmit side of the veth XDP tests.
55
#
6+
# XDP_TX comes from vmlinux because pythonbpf.helper exports only XDP_PASS
7+
# and XDP_DROP; that is why this lives under vmlinux/.
8+
69
from pythonbpf import bpf, section, bpfglobal, compile
7-
from pythonbpf.helper import XDP_TX
10+
from vmlinux import XDP_TX
811
from ctypes import c_void_p, c_int64
912

1013

1114
@bpf
1215
@section("xdp")
1316
def xdp_tx(xdp: c_void_p) -> c_int64:
14-
return XDP_TX # bare, like the C: resolved by the return fast path
17+
return c_int64(XDP_TX)
1518

1619

1720
@bpf

0 commit comments

Comments
 (0)