On Tue, Mar 16, 2021 at 9:29 PM Yonghong Song <yhs@xxxxxx> wrote: > + BTF_TYPE_EMIT_ENUM(BPF_TCP_ESTABLISHED); > + > + return 0; > +} > +late_initcall(bpf_emit_btf_type); I think if we burn a dummy function on this it would be a wrong pattern to follow. This is just a nop C statement. Typically we add BUILD_BUG_ON near the places that rely on that constraint. There is such a function already. It's tcp_set_state() as you pointed out. It's not using BTF of course, but I would move above BTF_TYPE_EMIT_ENUM there. I'm not sure why you're calling it "pollute net/ipv4/tcp.c". Consider that BTF_TYPE_EMIT macro is serving similar purpose and it's scattered around net/core/filter.c