Skip to content

Commit e8dd958

Browse files
TropicaoKernel Patches Daemon
authored andcommitted
selftests/bpf: rename test_tc_edt.bpf.c section to expose program type
The test_tc_edt BPF program uses a custom section name, which works fine when manually loading it with tc, but prevents it from being loaded with libbpf. Update the program section name to "tc" to be able to manipulate it with a libbpf-based C test. Signed-off-by: Alexis Lothoré (eBPF Foundation) <[email protected]>
1 parent 9a71dd4 commit e8dd958

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tools/testing/selftests/bpf/progs/test_tc_edt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ static inline int handle_ipv4(struct __sk_buff *skb)
9999
return TC_ACT_OK;
100100
}
101101

102-
SEC("cls_test") int tc_prog(struct __sk_buff *skb)
102+
SEC("tc")
103+
int tc_prog(struct __sk_buff *skb)
103104
{
104105
if (skb->protocol == bpf_htons(ETH_P_IP))
105106
return handle_ipv4(skb);

tools/testing/selftests/bpf/test_tc_edt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ip -netns ${NS_DST} route add ${IP_SRC}/32 dev veth_dst
5555
ip netns exec ${NS_SRC} tc qdisc add dev veth_src root fq
5656
ip netns exec ${NS_SRC} tc qdisc add dev veth_src clsact
5757
ip netns exec ${NS_SRC} tc filter add dev veth_src egress \
58-
bpf da obj ${BPF_FILE} sec cls_test
58+
bpf da obj ${BPF_FILE} sec tc
5959

6060

6161
# start the listener

0 commit comments

Comments
 (0)