Skip to content

mctp-estack: fix MCTP serial parsing and framing with escape sequences#45

Closed
mark64 wants to merge 1 commit intoCodeConstruct:mainfrom
mark64:main
Closed

mctp-estack: fix MCTP serial parsing and framing with escape sequences#45
mark64 wants to merge 1 commit intoCodeConstruct:mainfrom
mark64:main

Conversation

@mark64
Copy link

@mark64 mark64 commented Feb 27, 2026

Previously, if an MCTP serial packet had an escape sequence in the frame checksum, it would fail to parse in mctp-rs.

The DMTF spec, however, requires that escaping be performed after FCS generation on transmit, and similarly that
escaping be performed before FCS checking on receive, so the current behavior is incorrect.

I fixed the serial.rs code and added some unit tests to cover these cases.

@mark64 mark64 changed the title Fix MCTP serial parsing and framing with escape sequences mctp-estack: fix MCTP serial parsing and framing with escape sequences Feb 27, 2026
Signed-off-by: Mark Hill <markleehill@gmail.com>
@mark64
Copy link
Author

mark64 commented Feb 27, 2026

The CI failures appear unrelated to this change, but if required I can fix them

@mark64
Copy link
Author

mark64 commented Feb 27, 2026

nevermind, linux does it the way it is in main as well, so will close

@mark64 mark64 closed this Feb 27, 2026
@jk-ozlabs
Copy link
Member

It's entirely possible that we have the same issue in the kernel implementation, in which case we could address both...

@marklh0
Copy link

marklh0 commented Mar 3, 2026

It's entirely possible that we have the same issue in the kernel implementation, in which case we could address both...

That's true, it would have been helpful to have the spec show an example escaped byte sequence to clarify whether escaping applies to the header and CRC, rather than just the data payload. And doing it to the entire packet makes more sense to me as an outside observer.

But, this approach does work too, and I'd rather not introduce a compatibility break with already-existing Linux kernel implementations, even if my reading of the spec is what was originally intended.

Anyway happy to pursue this PR again if people think it matches the spec and want me to change the kernel too

@jk-ozlabs
Copy link
Member

I have submitted a query with the DMTF, clarification there might be good motivation to get this sorted everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants