lkml.org 
[lkml]   [2021]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 5/6] can: c_can: prepare to up the message objects number
On 03.03.2021 09:23:13, Dario Binacchi wrote:
[...]
> > > @@ -1205,17 +1203,31 @@ static int c_can_close(struct net_device *dev)
> > > return 0;
> > > }
> > >
> > > -struct net_device *alloc_c_can_dev(void)
> > > +struct net_device *alloc_c_can_dev(int msg_obj_num)
> > > {
> > > struct net_device *dev;
> > > struct c_can_priv *priv;
> > > + int msg_obj_tx_num = msg_obj_num / 2;
> >
> > IMO, a bigger tx queue is not usefull.
> > A bigger rx queue however is.
>
> This would not be good for my application. I think it really depends
> on the type of application. We can probably say that being able to
> size rx/tx queue would be a useful feature.

Ok. There is an ethtool interface to configure the size of the RX and TX
queues. In ethtool it's called the RX/TX "ring" size and you can get it
via the -g parameter, e.g. here for by Ethernet interface:

| $ ethtool -g enp0s25
| Ring parameters for enp0s25:
| Pre-set maximums:
| RX: 4096
| RX Mini: n/a
| RX Jumbo: n/a
| TX: 4096
| Current hardware settings:
| RX: 256
| RX Mini: n/a
| RX Jumbo: n/a
| TX: 256

If I understand correctly patch 6 has some assumptions that RX and TX
are max 32. To support up to 64 RX objects, you have to convert:
- u32 -> u64
- BIT() -> BIT_ULL()
- GENMASK() -> GENMASK_ULL()

The register access has to be converted, too. For performance reasons
you want to do as least as possible. Which is probably the most
complicated.

In the flexcan driver I have a similar problem. The driver keeps masks,
which mailboxes are RX and which TX and I added wrapper functions to
minimize IO access:

https://elixir.bootlin.com/linux/v5.11/source/drivers/net/can/flexcan.c#L904

This should to IMHO into patch 6.

Adding the ethtool support and making the rings configurable would be a
separate patch.

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-03-03 16:10    [W:0.171 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site