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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2019 at 1:11 PM Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> 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.



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux