Re: [PATCH 1/2] net: sch_generic: add flag IFF_FIFO_QUEUE to use pfifo_fast as default scheduler

From
Cong Wang <hidden>
Date
2019-03-27 20:53:40
Also in
linux-can
Reply to
Marc Kleine-Budde, 2019-03-27
On Wed, Mar 27, 2019 at 1:11 PM Marc Kleine-Budde [off-list ref] wrote:
Doubts aside, how should an arbitrary default qdisc per netdevice look
like? Add a string "default_qdisc" to the netdev? Lookup qdisc by string
during DOWN->UP transition? What do if that qdisc is not compiled into
the kernel? Or rather use an array of qdiscs with one of sch_generic
defaults?
I think you can just save a Qdisc_ops pointer in netdevice,
like how we install the default qdisc:

  38 const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
  39 EXPORT_SYMBOL(default_qdisc_ops);

And hard-code whatever default into your netdevice init code.

At least for pfifo_fast, you don't need to worry about module
loading. If you really do, you can call qdisc_lookup_default()
and request_module() like what qdisc_set_default() does.
Of course, you can refactor qdisc_set_default() and call it too.

Thanks.
Thread (25 messages) 25 messages, 10 authors, last reply 2019-10-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help