Skip to content
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

load_balancing: more guidance needed for use of hash() #96

Open
liujed opened this issue Nov 13, 2017 · 0 comments
Open

load_balancing: more guidance needed for use of hash() #96

liujed opened this issue Nov 13, 2017 · 0 comments

Comments

@liujed
Copy link
Member

liujed commented Nov 13, 2017

  • Slide 78 of P4D2_2017_Fall/P4_tutorial_labs.pdf has information on the signature of hash() that should be copied into load_balancing.p4.
  • Comments for ecmp_base and ecmp_count are needed in load_balancing p4. (Otherwise, I wouldn't know to use them for baseand max in the call to hash().)
  • Hash algorithm is unspecified. (Need to say CRC16 somewhere.)
  • Attempts based on example usage in PSA spec didn't work. My attempt:
Hash<bit<14>>(HashAlgorithm_t.CRC16) h;
meta.ecmp_select =
  h.get_hash({hdr.ipv4.srcAddr, hdr.ipv4.dstAddr,
    hdr.ipv4.protocol, hdr.tcp.srcPort, hdr.tcp.dstPort});

Resulting error:

syntax error, unexpected IDENTIFIER, expecting ;
        Hash<bit<14>>(HashAlgorithm_t.CRC16) h
                                             ^
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

No branches or pull requests

1 participant