p4c icon indicating copy to clipboard operation
p4c copied to clipboard

P4Info generation should use canonical P4Runtime 'shortest byte strings'

Open jafingerhut opened this issue 6 years ago • 2 comments

P4Runtime canonical representation of unsigned bit strings is to use the fewest number of bytes in the byte sequence possible, omitting any leading bytes that are completely 0. The existing files produce values with unnecessary leading 0 bytes in some cases.

Fully implementing this enhancement will require first changes code in other p4lang repos so that P4Runtime servers are ready to receive these minimal length byte strings.

Also in p4c's generation of 'entries' tables via the --p4runtime-entries-files option.

jafingerhut avatar Mar 22 '19 19:03 jafingerhut

@antoninbas This issue appears to be one that was likely fixed quite some time ago. If you agree, let me know and I will close this.

jafingerhut avatar Nov 24 '22 02:11 jafingerhut

@jafingerhut based on this: https://github.com/p4lang/p4c/blob/76d1b07511b5368e6e35f786baa0d1a2c3e184ef/control-plane/bytestrings.cpp#L38-L52 I would say that no, it has not been fixed.

antoninbas avatar Nov 29 '22 19:11 antoninbas