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
bpf: simplify adding/removing types to alignchecker #24736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, what a spell! Took 10min to understand three lines lol
Happy that you were chosen for the review :-) |
This PR doesn't require to run the testsuite, as cilium would already fail by this moment if |
Types in alignchecker were listed like 'TYPE _n', e.g., 'struct tunnel_key _53', so this was simple to add a new type: just add 1 to the last n. However, this is not obvious what to do when removing a type: to re-enumerate the remaining types or to leave holes? Fix this by using the __COUNTER__ macro. Now a new type can be listed as _(TYPE), e.g., '_(struct tunnel_key)', so this simple both to add and to remove types. Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
b52cb9e
to
bea74a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new version was well worth posting a reject review 😄 Thanks! It looks great!
Types in alignchecker were listed like
TYPE _n
, e.g.,struct tunnel_key _53
, so this was simple to add a new type: just add 1 to the last n. However, this is not obvious what to do when removing a type: to re-enumerate the remaining types or to leave holes? Fix this by using the__COUNTER__
macro. Now a new type can be listed as_(TYPE)
, e.g.,_(struct tunnel_key)
, so this simple both to add and to remove types.