Re: [net-rfc 04/16] can: dev: can_get_len(): add a helper function to get the correct length of Classical frames

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

 





On 24.10.20 07:25, Vincent MAILHOL wrote:
On 24.10.20 01:47, Oliver Hartkopp wrote:

Btw. do you really see any legacy SocketCAN applications (*together*
with your testing application on the same Linux host) where you don't
have the source code to check whether they properly initialize the
reserved/padding bytes?

Do you?

You still didn't answer this hypothetical question. There must be a reason behind .. :-D

You can not take responsibility for broken implementations on other ECUs.

We clearly share a difference stance on this subject, I think it is
time to close the debate. I agree to go with your solution.

Ok, together with this answer I also can close the debate :-)

I saw your patch. Changing the name from raw_can to len8_dlc clears
the concerns I had for invalid frames. Thank you.

Great! In fact it cost some time in the night where I woke up from sleep and think about "the overall goal what we want to archive" ;-)

The right naming lets developers make right assumptions about the functionality. Therefore it always remains tricky - and discussions like these. I needed two hours to write an rephrase the patch again and again ...

Also the ctrlmode has now a clear target of Classic CAN (CC) in its name: CC_LEN8_DLC

Thank you also for depreciating the can_dlc field and introducing the
len field in struct can_frame. It is a smart change.

Thanks. I always had the idea to fix this up after the introduction of CAN FD which uses a 'len' element too. I discovered myself at that time, that can_dlc was not the best matching choice - but Kernel APIs are written in stone for a good reason.

So I've checked what people do, when they need to rename structure elements in the Kernel API in the uapi section and found this:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=31ba514b2fd0495796

I will now test the patch.

So far it only is an idea for naming 'things' - but I'm happy you like it!

IMO we could continue with enabling a CAN driver to support CAN_CTRLMODE_CC_LEN8_DLC and see how it works in reality with CAN_RAW and AF_PACKET - and if we would finally need CAN_RAW_LEN8_DLC or not.

Best,
Oliver



[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