lib: helper: simplify and extend _BF_APPLY macros#437
lib: helper: simplify and extend _BF_APPLY macros#437yaakov-stein wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Claude: Review of PR #437 — lib: helper: simplify and extend _BF_APPLY macros This PR is clean and well-motivated. The recursive chaining approach is semantically equivalent to the original manual expansion, reduces code from ~55 lines to ~18, and extends the limit from 10 to 16 arguments for future use. The Verified:
One minor suggestion (left as inline comment): consider adding a No regressions identified. |
qdeslandes
left a comment
There was a problem hiding this comment.
LGTM except for a comment to fix.
If we need to support more flags at some point, we may want to look in to the Swanson Map Macro. For now, that is probably making things more complicated than they need to be.
Agreed, let's keep it this way for now and implement it when we reach the limit.
f5cfcfb to
f66aa0f
Compare
|
Claude: review of facebook/bpfilter #437 (d6969d5) Suggestions
Nits
Overall this is a clean, well-motivated PR. The recursive macro chaining is correct, the |
f66aa0f to
d9eb24c
Compare
d9eb24c to
80e4478
Compare
qdeslandes
left a comment
There was a problem hiding this comment.
Actually, LGTM but needs rebase ;)
Use recursive chaining where each _BF_APPLYn calls _BF_APPLYn-1. Also change BF_FLAG to use 1ULL to avoid UB when enum values reach 31+ (bf_matcher already has 31 values).
80e4478 to
d6969d5
Compare
_BF_APPLYncalls_BF_APPLYn-1.BPF_PROG_TYPE_CGROUP_SOCK_ADDRBPF programs #355).BF_FLAGto use 1ULL to avoid UB when enum values reach 31+ (bf_matcheralready has 31 values).Note:
Testing: