8000 load_balancing: more guidance needed for use of hash() · Issue #96 · p4lang/tutorials · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
load_balancing: more guidance needed for use of hash() #96
Open
@liujed

Description

@liujed
  • 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
                                             ^
3822

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0