Skip to content
Snippets Groups Projects
Commit 70ade8a3 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

try to load ebpf first then remove it for update

parent ee3922ea
Branches
No related tags found
No related merge requests found
......@@ -75,8 +75,21 @@ def main():
subprocess.run(f"sudo {DIR}/ubuntu_intermediate/./initiate.sh", shell=True, check=True)
print("./initiate is executed")
b = BPF(src_file=f"inter_op_ebpf.c")
fn = b.load_func("inter_op_ebpf", BPF.XDP)
for inter_num in range(2, 13):
inter_name = f"ens{inter_num + 1}"
b.attach_xdp(inter_name, fn, 0)
print("Attach the ebpf program at", inter_name)
update_ebpf_file()
for inter_num in range(2, 13):
inter_name = f"ens{inter_num + 1}"
print("Detach the ebpf program at", inter_name)
b.remove_xdp(inter_name, 0)
b = BPF(src_file=f"inter_op_ebpf.c")
fn = b.load_func("inter_op_ebpf", BPF.XDP)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment