On Wed, 30 Nov 2022 16:32:47 -0800 Stanislav Fomichev wrote: > Makes sense. Let me take a closer look. I glanced at it last week and > decided that maybe it's easier to not hold the device at all.. > > Maybe we should have something like this: > > - bpf_prog_is_dev_bound() - prog is dev bound but not offloaded > (currently bpf_prog_is_dev_bound == fully offloaded) > - bpf_prog_is_offloaded() - prog is dev bound and offloaded > > So hopefully I can leverage some/most existing bpf_prog_is_dev_bound > call sites (+ add some more to reject prog_run/etc). +1, FWIW, seems like it'd improve the code readability quite a bit.