You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ultimate goal of this change is to apply the ignore suffix rule to
kfuncs. This allows a user to define multiple flavors of kfuncs as they
may appear in different kernel versions, without name collisions.
During kfunc relocation, we strip the ___... suffix before looking up
kfunc candidates in the vmlinux BTF.
This required changing the behavior of btf.Spec.AnyTypesByName, which
would internally call newEssentialName on the provided name to lookup
types but then still apply name filtering on the name with the suffix.
By moving the suffix stripping out of the btf.Spec method responsibility
the caller can decide if they want to find exact matches or if they
want to apply the ignore suffix rule.
This also surfaced a test with a wrong assumption. We were asserting
that if the kernel contained a `ambiguous` and `ambiguous___flavor` type
that we should match both during relocation. But this is not how the
ignore suffix rule works, suffixes are only stripped off of user
provided type names (those in ELF BTF), the logic should not be applied
to kernel types. So removed tests with the bad assumptions and added
a new test to assert the correct ambiguous relocation behavior.
Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
0 commit comments