[PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2

Vincent Mailhol posted 21 patches 4 weeks, 1 day ago
There is a newer version of this series
drivers/net/can/dev/calc_bittiming.c |  10 +-
drivers/net/can/dev/dev.c            |  33 ++
drivers/net/can/dev/netlink.c        | 607 ++++++++++++++++++++++-------------
include/linux/can/bittiming.h        |  48 ++-
include/linux/can/dev.h              |  42 +--
include/uapi/linux/can/netlink.h     |  14 +-
6 files changed, 471 insertions(+), 283 deletions(-)
Re: [PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2
Posted by Vincent Mailhol 4 weeks, 1 day ago
On 03/09/2025 à 17:49, Vincent Mailhol wrote:

(...)

> The follow up series which introduces CAN XL is nearly completed but
> will be sent only once this one is approved: one thing at a time, I do
> not want to overwhelm people (including myself).

If you want a preview of the full CAN XL, you can have a look at my work in
progress here:

https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/linux.git/
log/?h=b4/canxl-netlink
https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/iproute2-next.git/log/?h=canxl-netlink

The kernel part is nearly completed, but I am still playing some whack-a-mole to
find potential gaps in the configuration validation. I also need to rewrite or
fine tune the commit description.

The iproute2 part is still under development. It has the PWM interface but I
have not added all the control modes yet.

Regardless, the two links above are just an FYI. Beware that there will be some
random force pushes without any notice. You can play with it but it is
*not* opened for comments until the preparation series is approved.

Looking forward for your comments on this CAN XL preparation series, it took me
a fair amount of effort :)


Yours sincerely,
Vincent Mailhol
Re: [PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2
Posted by Oliver Hartkopp 4 weeks, 1 day ago

On 03.09.25 11:26, Vincent Mailhol wrote:
> On 03/09/2025 à 17:49, Vincent Mailhol wrote:
> 
> (...)
> 
>> The follow up series which introduces CAN XL is nearly completed but
>> will be sent only once this one is approved: one thing at a time, I do
>> not want to overwhelm people (including myself).
> 
> If you want a preview of the full CAN XL, you can have a look at my work in
> progress here:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/linux.git/
> log/?h=b4/canxl-netlink
> https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/iproute2-next.git/log/?h=canxl-netlink
> 
> The kernel part is nearly completed, but I am still playing some whack-a-mole to
> find potential gaps in the configuration validation. I also need to rewrite or
> fine tune the commit description.
> 
> The iproute2 part is still under development. It has the PWM interface but I
> have not added all the control modes yet.
> 

Thanks Vincent!

The repos are very helpful.

With "missing" control modes you refer to CAN_CTRLMODE_XL_ERR_SIGNAL, 
CAN_CTRLMODE_XL_RRS and CAN_CTRLMODE_RESTRICTED, right?

Best regards,
Oliver

> Regardless, the two links above are just an FYI. Beware that there will be some
> random force pushes without any notice. You can play with it but it is
> *not* opened for comments until the preparation series is approved.
> 
> Looking forward for your comments on this CAN XL preparation series, it took me
> a fair amount of effort :)
> 
> 
> Yours sincerely,
> Vincent Mailhol

Re: [PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2
Posted by Vincent Mailhol 4 weeks ago
On 04/09/2025 at 15:36, Oliver Hartkopp wrote:
> On 03.09.25 11:26, Vincent Mailhol wrote:
>> On 03/09/2025 à 17:49, Vincent Mailhol wrote:
>>
>> (...)
>>
>>> The follow up series which introduces CAN XL is nearly completed but
>>> will be sent only once this one is approved: one thing at a time, I do
>>> not want to overwhelm people (including myself).
>>
>> If you want a preview of the full CAN XL, you can have a look at my work in
>> progress here:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/linux.git/
>> log/?h=b4/canxl-netlink
>> https://git.kernel.org/pub/scm/linux/kernel/git/mailhol/iproute2-next.git/
>> log/?h=canxl-netlink
>>
>> The kernel part is nearly completed, but I am still playing some whack-a-mole to
>> find potential gaps in the configuration validation. I also need to rewrite or
>> fine tune the commit description.
>>
>> The iproute2 part is still under development. It has the PWM interface but I
>> have not added all the control modes yet.
>>
> 
> Thanks Vincent!
> 
> The repos are very helpful.
> 
> With "missing" control modes you refer to CAN_CTRLMODE_XL_ERR_SIGNAL,
> CAN_CTRLMODE_XL_RRS and CAN_CTRLMODE_RESTRICTED, right?

Yes, I only added the CAN_CTRLMODE_XL_TMS so far in iproute2. The kernel has all
of the four flags (but because I did not finish testing, I highly suspect that
there are still some bugs somewhere).

Concerning the CAN_CTRLMODE_XL_RRS, I am not sure if that one is needed. I still
have it in my WIP series but I am recently considering to remove it. The reason
is that when reading ISO 11898-1 having RRS configurable looks mandatory to me.

In the logical Link control (LLC) this RRS bit is named FTYP (for Frame Type).
For example, CiA only mentions FTYP in their CAN XL knowledge page:

  https://www.can-cia.org/can-knowledge/can-xl

Contrarily to CAN FD's RRS which is indeed specified as being dominant and which
is just ignored in the LLC, the CAN XL FTYP/RRS is part of the LLC interface and
is meant to be configurable.

Nothing in the standard tells us that this should be a dominant bit. I think
your intention was to add CAN_CTRLMODE_XL_RRS as a quirk for the devices which
expose this flag. But as far as I can see, it seems that a device which does not
expose it is just not compliant.

If some day a device which can not set the FTYP/RRS flag appears in the wild,
then maybe we can add a flag which would specify that RRS is not configurable
(opposite logic as what you suggested). But as long as such a device do not
exist, it is better to add nothing.


Yours sincerely,
Vincent Mailhol

Re: [PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2
Posted by Oliver Hartkopp 3 weeks, 6 days ago
On 04.09.25 11:18, Vincent Mailhol wrote:

> Concerning the CAN_CTRLMODE_XL_RRS, I am not sure if that one is needed. I still
> have it in my WIP series but I am recently considering to remove it. The reason
> is that when reading ISO 11898-1 having RRS configurable looks mandatory to me.
> 
> In the logical Link control (LLC) this RRS bit is named FTYP (for Frame Type).
> For example, CiA only mentions FTYP in their CAN XL knowledge page:
> 
>    https://www.can-cia.org/can-knowledge/can-xl
> 
> Contrarily to CAN FD's RRS which is indeed specified as being dominant and which
> is just ignored in the LLC, the CAN XL FTYP/RRS is part of the LLC interface and
> is meant to be configurable.

I double checked my XCANB CAN XL controller spec and indeed the RRS bit 
is part of every RX/TX FIFO element and the figures see it as 
configurable element too.

> Nothing in the standard tells us that this should be a dominant bit. I think
> your intention was to add CAN_CTRLMODE_XL_RRS as a quirk for the devices which
> expose this flag. But as far as I can see, it seems that a device which does not
> expose it is just not compliant.

Let's see if we will find CAN XL IP cores where the engineers have a 
different view on this. I currently have a discussion on this RRS bit 
with the Vector support because the RRS bit is not visible in the 
CANalyser 19 GUI.

> If some day a device which can not set the FTYP/RRS flag appears in the wild,
> then maybe we can add a flag which would specify that RRS is not configurable
> (opposite logic as what you suggested). But as long as such a device do not
> exist, it is better to add nothing.

ACK. After this discussion I would also vote to omit my glorious patch 
which added the CAN_CTRLMODE_XL_RRS flag. Let's see if we find a CAN XL 
controller that does not support the variable RRS bit in reading and 
writing. And if it shows up we can add this flag to handle it (similar 
to the fd-non-iso feature).

Best regards,
Oliver

Re: [PATCH 00/21] can: netlink: preparation before introduction of CAN XL step 2/2
Posted by Vincent Mailhol 3 weeks, 6 days ago
On 05/09/2025 at 20:11, Oliver Hartkopp wrote:
> On 04.09.25 11:18, Vincent Mailhol wrote:
> 
>> Concerning the CAN_CTRLMODE_XL_RRS, I am not sure if that one is needed. I still
>> have it in my WIP series but I am recently considering to remove it. The reason
>> is that when reading ISO 11898-1 having RRS configurable looks mandatory to me.
>>
>> In the logical Link control (LLC) this RRS bit is named FTYP (for Frame Type).
>> For example, CiA only mentions FTYP in their CAN XL knowledge page:
>>
>>    https://www.can-cia.org/can-knowledge/can-xl
>>
>> Contrarily to CAN FD's RRS which is indeed specified as being dominant and which
>> is just ignored in the LLC, the CAN XL FTYP/RRS is part of the LLC interface and
>> is meant to be configurable.
> 
> I double checked my XCANB CAN XL controller spec and indeed the RRS bit is part
> of every RX/TX FIFO element and the figures see it as configurable element too.
> 
>> Nothing in the standard tells us that this should be a dominant bit. I think
>> your intention was to add CAN_CTRLMODE_XL_RRS as a quirk for the devices which
>> expose this flag. But as far as I can see, it seems that a device which does not
>> expose it is just not compliant.
> 
> Let's see if we will find CAN XL IP cores where the engineers have a different
> view on this. I currently have a discussion on this RRS bit with the Vector
> support because the RRS bit is not visible in the CANalyser 19 GUI.
> 
>> If some day a device which can not set the FTYP/RRS flag appears in the wild,
>> then maybe we can add a flag which would specify that RRS is not configurable
>> (opposite logic as what you suggested). But as long as such a device do not
>> exist, it is better to add nothing.
> 
> ACK. After this discussion I would also vote to omit my glorious patch which
> added the CAN_CTRLMODE_XL_RRS flag. Let's see if we find a CAN XL controller
> that does not support the variable RRS bit in reading and writing. And if it
> shows up we can add this flag to handle it (similar to the fd-non-iso feature).

OK. Good that we reached out to the same conclusion :)

Because I already implemented all the logic, I will save the current RRS patch
somewhere in case we need to resurrect it some days.


Yours sincerely,
Vincent Mailhol