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

map: allow empty ProgramArray to not be assigned #513

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Dec 1, 2021

xdpcap [1] used ProgramArrays to implement hooks in XDP programs.
So far, it's been possible to add an xdpcap hook without calling
into the library to patch the ProgramArray. The change to support
pre-populating tail call maps broke this, since we now don't allow
ProgramArrays which are loaded but not requested by the user.

However, this case it is OK for the ProgramArray to be closed since
there are no programs in it anyways. Make the error less strict by
allowing empty ProgramArrays to be unassigned.

1: https://github.com/cloudflare/xdpcap

@lmb lmb requested review from arthurfabre and ti-mo December 1, 2021 16:01
Copy link
Contributor

@arthurfabre arthurfabre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out and making a PR!

xdpcap [1] used ProgramArrays to implement hooks in XDP programs.
So far, it's been possible to add an xdpcap hook without calling
into the library to patch the ProgramArray. The change to support
pre-populating tail call maps broke this, since we now don't allow
ProgramArrays which are loaded but not requested by the user.

However, this case it is OK for the ProgramArray to be closed since
there are no programs in it anyways. Make the error less strict by
allowing empty ProgramArrays to be unassigned.

1: https://github.com/cloudflare/xdpcap
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've expanded the comment since this is somewhat tricky stuff.

@ti-mo ti-mo merged commit 04b5c2a into master Dec 7, 2021
@ti-mo ti-mo deleted the lmb/prog-array-error branch December 7, 2021 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants