On vr, 30 nov 2018 15:13:16 +0100, Patrick Menschel wrote: > > Ok, it means we should support different programming models for > > different transfer sizes. Given that packets that exceed the traditional 1500 bytes from ethernet serve 1 single PGN, I find it hard to implement different programming models for that 1 application The 'sensible buffer size' is broken by design. IMHO, you cannot define such thing, since that is application knowledge. > > 1. send over socket with sensible buffer size (1-10 MiB) > > 2. send over memfd? size up to J1939_MAX_ETP_PACKET_SIZE. > > Needs different programming model in user space. > > 3. Add support for SOCK_STREAM, where kernel splits data into sensible > > sized ETP messages. Message boundaries from user space are not > > preserved, like TCP. I doubt that this is a good idea. > > > > Before I'll start with 1. variant, what would be "sensible buffer size"? > > Is 1 MiB enough? > > > > Hi, > > from what I read in J1939-73, a common transfer size would be 2kiB as > the length field for binary transfer (DM14-DM18) is 11bit in width, so > 1MiB should be plenty. ETP's reason of existence is to step over the 1785 bytes limit. between 10 and 100 KB seems sensible to me, meaning that this is very subjective, and so probably not a good discriminator. > Best Regards, > Patrick >