On Fri, Jun 04, 2021 at 11:31:57PM IST, Alexei Starovoitov wrote: > On Fri, Jun 04, 2021 at 12:01:15PM +0530, Kumar Kartikeya Dwivedi wrote: > > +/* TC bpf_link related API */ > > +struct bpf_tc_hook; > > + > > +struct bpf_tc_link_opts { > > + size_t sz; > > + __u32 handle; > > + __u32 priority; > > + __u32 gen_flags; > > + size_t :0; > > +}; > > Did you think of a way to share struct bpf_tc_opts with above? > Or use bpf_tc_link_opts inside bpf_tc_opts? A couple of fields in bpf_tc_opts aren't really relevant here (prog_fd, prog_id) and will always be unused, so I thought it would be cleaner to give this its own opts struct. It still reuses the hook abstraction that was added, though. > Some other way? > gen_flags here and flags there are the same? No, it was an oversight that I missed adding gen_flags there, I'll send a patch separately with some other assorted things. It's used when offloading to HW. We don't really support any other flags (e.g. BPF_TC_F_REPLACE) for this. -- Kartikeya