On Thu, May 23, 2024 at 11:25 PM Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote: > > > + > > +unsigned long time_next_delayed_flow = ~0ULL; > > +unsigned long unthrottle_latency_ns = 0ULL; > > +unsigned long ktime_cache = 0; > > +unsigned long dequeue_now; > > +unsigned int fq_qlen = 0; > > I suspect some of these globals may be more natural if it is stored private to > an individual Qdisc instance. i.e. qdisc_priv(). e.g. in the sch_mq setup. > > A high level idea is to allow the SEC(".struct_ops.link") to specify its own > Qdisc_ops.priv_size. > > The bpf prog could use it as a simple u8 array memory area to write anything but > the verifier can't learn a lot from it. It will be more useful if it can work > like map_value(s) to the verifier such that the verifier can also see the > bpf_rb_root/bpf_list_head/bpf_spin_lock...etc. Qdisc_ops.priv_size is too qdsic specific. imo using globals here is fine. bpf prog can use hash map or arena to store per-netdev or per-qdisc data. The less custom things the better.