Re: [PATCH] can: enable multi-queue for SocketCAN devices

From: Jonas Mark (BT-FIR/ENG1)
Date: Wed Mar 14 2018 - 08:27:08 EST


Hello Marc,

> > The existing SocketCAN implementation provides alloc_candev() to
> > allocate a CAN device using a single Tx and Rx queue. This can lead to
> > priority inversion in case the single Tx queue is already full with low
> > priority messages and a high priority message needs to be sent while the
> > bus is fully loaded with medium priority messages.
> >
> > This problem can be solved by using the existing multi-queue support of
> > the network subsystem. The commit makes it possible to use multi-queue in
> > the CAN subsystem in the same way it is used in the Ethernet subsystem
> > by adding an alloc_candev_mqs() call and accompanying macros. With this
> > support a CAN device can use multi-queue qdisc (e.g. mqprio) to avoid
> > the aforementioned priority inversion.
> >
> > The existing functionality of alloc_candev() is the same as before.
> >
> > CAN devices need to have prioritized multiple hardware queues or are
> > able to abort waiting for arbitration to make sensible use of
> > multi-queues.
> >
> > Signed-off-by: Zhu Yi <yi.zhu5@xxxxxxxxxxxx>
> > Signed-off-by: Mark Jonas <mark.jonas@xxxxxxxxxxxx>
> > Reviewed-by: Heiko Schocher <hs@xxxxxxx>
>
> Do you have a driver or a patch to make a driver mq aware?

Yes, we have CAN hardware with multiple queues and we also have a SocketCAN driver for it.

IMHO the driver will be of very little use for the Linux community because the HW is proprietary.

Our motivation to separate this patch from the proprietary SocketCAN driver is that we felt it was odd that the multi-queue infrastructure is in place and only very few lines of code are missing to offer it to the CAN networking subsystem as well.

Greetings,
Mark