-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PSA] Hash function #306
Comments
Is it reasonable to proceed on issues like this one by opening a pull request with proposed changes to the text, and let the discussion be on the PR? |
@jafingerhut, yes, please! |
I will create such a PR, but another issue I found is that if you try code like this with the latest version of p4test from the p4lang/p4c repository, it gives an error. Snippet of code:
I get an error like the following from the latest 2017-Jul-05 version of p4test:
Is this something that you expect to be correct syntax in P4_16? The grammar seems to allow it, so not sure why the error message. I can open an issue on the p4lang/p4c repo if desired. |
@hanw noticed it as well and we believe this is a bug in the compiler. I recall some discussion between him and @mbudiu-vmw, but don't recall the conclusion. I should think that one of the enum members should be a valid type for the instantiation of the extern. So we''ll have to fix the compiler. |
Issue #492 in p4lang/p4c. Solution is to pass constant value as a constructor parameter. |
@hanw Thanks. Yes, that makes sense. My PR for the PSA document can include this change to the Hash extern as well. |
Created PR #346 |
addressed by #346. |
Section on "Hash function". There is no description of what the 'max'
parameter of getHash does.
If the intent is for hashes and checksums to share the type
'HashAlgorithm', then HashAlgorithm should have the 16-bit 1's
complement checksum used by the IPv4 header to its choices.
The spec might want to note that 'remove' will only work for some hash
functions, and not others, e.g. it is easy to remove some data from a
1's complement checksum calculator, but much more complex, and
position-dependent, to remove it from a CRC calculation.
The text was updated successfully, but these errors were encountered: