libbpf tc program #101
Answered
by
chenhengqi
cheneytianx
asked this question in
Q&A
Replies: 2 comments 3 replies
-
a quick google search found this https://lore.kernel.org/lkml/20210402152743.dbadpgcmrgjt4eca@apollo/T/#m773e6e57e9c763eb9590c86304a0473a8b187f23 |
Beta Was this translation helpful? Give feedback.
0 replies
-
DECLARE_LIBBPF_OPTS(bpf_tc_hook, tc_hook,
.ifindex = 4, .attach_point = BPF_TC_EGRESS);
DECLARE_LIBBPF_OPTS(bpf_tc_opts, tc_opts,
.flags = BPF_TC_F_REPLACE, .handle = 1, .priority = 1);
err = bpf_tc_hook_create(&tc_hook);
if (err)
return err;
tc_opts.prog_fd = bpf_program__fd(skel->progs.tc_egress);
err = bpf_tc_attach(&tc_hook, &tc_opts);
if (err)
return err; |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
cheneytianx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to attach tc program in the userspace code using libbpf?
Beta Was this translation helpful? Give feedback.
All reactions