On Tue, Jun 27, 2023 at 4:33 PM John Fastabend <john.fastabend@xxxxxxxxx> wrote: > > Yeah I think so and then carry a couple different object files > for the environment around. We do this already for some things. > Its not ideal but it works. I think a good end goal would be > > int bpf_devtx_request_timestamp(...) > { > set_ts = dlsym( dl_handle, request-timestamp); > return set_ts(...) > } > > Then we could at attach time take that dlsym and rewrite it. Sounds like we need polymorphic kfuncs. Same kfunc name called by bpf prog, but implementation would change depending on {attach_btf_id, prog_type, etc}. The existing bpf_xdp_metadata_rx_hash is almost that. Except it's driver specific. We should probably generalize this mechanism.