xdp-tools icon indicating copy to clipboard operation
xdp-tools copied to clipboard

libxdp: Add retries to handle some race conditions on attach and detach

Open tohojo opened this issue 3 years ago • 0 comments

While the libxdp locking protects against concurrent updates of the same multiprog, there's still a race window where the old multiprog can get detached by another application while we build its replacement. To get around this we have to retry building and attaching (to refresh our view of the kernel state), but this was never implemented.

Implement retry logic in program attach and detach; this relies on being able to attach freplace programs to multiple dispatchers, so it'll fail on kernels that are too old for that. But before we always failed if we hit this race, so it's still an improvement.

Signed-off-by: Toke Høiland-Jørgensen [email protected]

tohojo avatar Oct 14 '22 11:10 tohojo