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

Handling of tables with multiple "lpm" match type fields #60

Closed
vgurevich opened this issue May 31, 2016 · 1 comment
Closed

Handling of tables with multiple "lpm" match type fields #60

vgurevich opened this issue May 31, 2016 · 1 comment
Labels
enhancement This topic discusses an improvement to existing compiler code.

Comments

@vgurevich
Copy link

vgurevich commented May 31, 2016

Following up on a posting in p4-dev...

The current code accepts such tables and generates a JSON file. Here is an example program:

header_type ethernet_t {
    fields {
        dstAddr : 48;
        srcAddr : 48;
        ethertype : 16;
    }
}

header ethernet_t ethernet;

parser start {
    extract(ethernet);
    return ingress;
}

action set_egress_port(port) {
    modify_field(standard_metadata.egress_spec, port);
}

table t1 {
    reads {
         ethernet.dstAddr : lpm;
         ethernet.srcAddr : lpm;
    }
    actions {
         set_egress_port;
    }
}

control ingress {
    apply(t1);
}

control egress {
}

However, when this JSON file is used with simple_switch BMv2 executable, it rejects it with the following message:

Table t1 features 2 LPM match fields

The current "official" compiler (p4c-bm) rejects such tables. The spec is not very explicit about whether this construct is allowed. If it is, then there needs to be a clear standard on how to handle entry priorities in this case and this will result in different PD API implementation in the first place.

@krambn krambn added the enhancement This topic discusses an improvement to existing compiler code. label Jul 20, 2016
@mihaibudiu
Copy link
Contributor

I think that this issue has been solved by the recent PR #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This topic discusses an improvement to existing compiler code.
Projects
None yet
Development

No branches or pull requests

3 participants