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

bmv2 back-end does not generate checksum computations #655

Closed
mihaibudiu opened this issue May 23, 2017 · 0 comments
Closed

bmv2 back-end does not generate checksum computations #655

mihaibudiu opened this issue May 23, 2017 · 0 comments
Assignees
Labels
bug This behavior is unintended and should be fixed.

Comments

@mihaibudiu
Copy link
Contributor

Here is an example program:

#include <core.p4>
#include <v1model.p4>

header H {
    bit<16> d;
    bit<16> c;
}

struct Parsed_packet {
    H h;
}

struct Metadata {
}

control DeparserI(packet_out packet, in Parsed_packet hdr) {
    apply {
        packet.emit(hdr.h);
    }
}

parser parserI(packet_in pkt, out Parsed_packet hdr, inout Metadata meta, inout standard_metadata_t stdmeta) {
    state start {
        pkt.extract(hdr.h);
        transition accept;
    }
}

control cIngress(inout Parsed_packet hdr, inout Metadata meta, inout standard_metadata_t stdmeta) {
    apply {
        hdr.h.d = hdr.h.d + 1;
    }
}

control cEgress(inout Parsed_packet hdr, inout Metadata meta, inout standard_metadata_t stdmeta) {
    apply {}
}

control vc(in Parsed_packet hdr, inout Metadata meta) {
    Checksum16() ck;
    apply {
        bit<16> tmp = ck.get({ hdr.h.d, hdr.h.c });
        if (0 != tmp)
            mark_to_drop();
    }
}

control uc(inout Parsed_packet hdr, inout Metadata meta) {
    Checksum16() ck;
    apply {
        bit<16> tmp = ck.get({ hdr.h.d });
        hdr.h.c = tmp;
    }
}

V1Switch(parserI(), vc(), cIngress(), cEgress(), uc(), DeparserI()) main;

The checksums computation produced in json is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants