Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dynamic dispatch #1352

Open
dave-tucker opened this issue Dec 4, 2024 · 0 comments
Open

Support for dynamic dispatch #1352

dave-tucker opened this issue Dec 4, 2024 · 0 comments
Labels
enhancement New feature or request help wanted A good second or third contribution
Milestone

Comments

@dave-tucker
Copy link
Collaborator

dave-tucker commented Dec 4, 2024

It's possible that users of bpfman may want to implement their own dynamic dispatch - similar to how we create a dispatcher for XDP and TC programs.

This can be accomplished via either:

a. BPF_MAP_TYPE_PROG_ARRAY and tail calls
b. BPF_PROG_TYPE_EXT

From an API standpoint we'd need to figure out how we'd like to model this.

Prog Array

ISTR that we can update a BPF_MAP_TYPE_PROG_ARRAY from user space using bpf_map_update_elem.
The issue is that adding a program requires a file descriptor... and getting file descriptors from the bpf syscall requires privileges 😢

There are 2 ways we can handle this:

  1. Manifest the necessary program pins inside a container's bpffs. This then puts the onus on the userland program to update the jump table, which I think seems reasonable. The API we'd need to design would be fairly easy to model from K8s (outside K8s if you have access to bpffs it doesn't matter).
  2. Try and get bpfman to update the map. I'm discouraging this as we had concluded early on that letting bpfman manipulate maps was potentially a bad idea. The API for this would also get complicated - how do we reference other programs? what do we do if a program that's supposed to be in the map isn't loaded yet?

Extensions

I believe we already have an API for adding extensions. If not, it's easy as they are just treated like any other eBPF program. I don't see any concerns in how we'd model this in the K8s API.

@github-project-automation github-project-automation bot moved this to 🆕 New in bpfman Dec 4, 2024
@dave-tucker dave-tucker added this to the Q1-2025 milestone Dec 4, 2024
@dave-tucker dave-tucker added help wanted A good second or third contribution enhancement New feature or request labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted A good second or third contribution
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant