xdp.XDP.detach never returns... Thus when we write await program.detach(...) we wait forever. Sending keyboard interrupt (ctrl*c) during this infinite wait results in the python program terminating, after which we see that the eBPF program has been detached. So the function actually does its job, but it has to be awaited. Otherwise it does not detach the program from XDP. I worked around that by asyncio.wait_for(program.detach(...), 1) where 1 is the timeout threshold in seconds.
xdp.XDP.detach never returns... Thus when we write
await program.detach(...)
we wait forever. Sending keyboard interrupt (ctrl*c) during this infinite wait results in the python program terminating, after which we see that the eBPF program has been detached. So the function actually does its job, but it has to be awaited. Otherwise it does not detach the program from XDP. I worked around that byasyncio.wait_for(program.detach(...), 1)
where 1 is the timeout threshold in seconds.