Fix header size to be multiple of 8 bits#5553
Conversation
The changes look good to me, but in order to merge this you need to sign your commit using DCO. See the page for this PR and click on the link labeled "DCO" near the bottom of the page for instructions on how to do so after you have created a PR. Alternately, if you find following those instructions troublesome you can close this PR and create a new one and be sure to use |
Signed-off-by: pacokwon <haechank@gmail.com>
8b5e9a3 to
cd3126f
Compare
|
Thanks for letting me know. I just pushed a signed commit. Please take a look! |
|
@pacokwon You need to update some expected output files in the directory testdata/p4_16_samples_outputs, too, to correspond with the changes you made to the test program, otherwise existing tests that compare the current compiler output against expected fail. Look in the top level README.md of the p4c repo for example commands using P4TEST_REPLACE, for one way to create locally on your system the new expected output files. |
Resolves #5535
The BMv2 target only supports headers with fields totaling a multiple of 8 bits. However, in
testdata/p4_16_samples/custom-type-restricted-fields.p4, the header typepacket_out_thad a size of 65 bits and was being rejected by BMv2. Changingqueue_idto 7 bits satisfies the header size constraint and preserves the semantics of the program, asqueue_idis not being utilized elsewhere in the program.