p4lang / pna

Portable NIC Architecture
Apache License 2.0
55 stars 21 forks source link

Add hash algorithms to pna.p4 #91

Closed hesingh closed 1 year ago

hesingh commented 1 year ago

Currently hash algorithms are TODO in PNA specification. This PR attempts to complete the TODO and also add defines to use as a flag to hash api to use hash on only source, destination, or both IP/IPv6 addresses, and protocol.

One has to start somewhere and thus psa.p4 hash algorithms have been copied to pna.p4. Also, none of the hash algorithms look like one a Nic can't support.

hesingh commented 1 year ago

Please merge, thanks.

jfingerh commented 1 year ago

@hesingh Happy to do so after having at least an announcement and call for objections or concerns in the next public PNA work group meeting next Monday. I do not anticipate any, but I'm trying not to ram things through without such notification.

thantry commented 1 year ago

Would be good to add Toeplitz and Xor hash, which are common in many NICs for RSS.

thomascalvert-xlnx commented 1 year ago

LGTM.

Agree that Toeplitz needs adding, but equally happy for that to be in a separate commit.

jfingerh commented 1 year ago

@thantry @thomascalvert-xlnx Thanks for review. Yes, we should add other hash algorithms as desired. For Toeplitz, this issue is tracking that, and from previous conversations it sounds like there might be additional control plane and/or data plane APIs desired there, and if so, merely adding a new enum value to the list is not enough, and I'd rather someone propose all of the pieces necessary in a PR addressing that issue: https://github.com/p4lang/pna/issues/19

For XOR, I have created a separate issue to track that: https://github.com/p4lang/pna/issues/93 I understand the desire to pile all the desired changes into single PRs, but hopefully we can get to a place where separate PRs can be moved through the pipeline of writing, approvals, and merging quickly enough that we are comfortable doing separate PRs.