Git Product home page Git Product logo

Comments (3)

antoninbas avatar antoninbas commented on July 20, 2024

I don't see anything with your code snippet. Usually, not being able to connect to the switch with the runtime_CLI means that the switch has crashed. A few things can cause the switch to crash (e.g. out-of-bound register access during packet processing).
You can check if the switch crashed by checking if the switch process started by Mininet is still alive (grep for simple_switch in the ps output).
If you need help, please provide a full P4 program (which can be compiled) as well as CLI commands.

from behavioral-model.

Raymondma-public avatar Raymondma-public commented on July 20, 2024

Seems that the problem occurs due to the intrinsic_metadata.
I try to add all field in C++ to the meta data instead of only "switch_role" then everything seems working.
But I do not understand why, can you explain briefly why I can make it work like this?

header_type intrinsic_metadata_t {
    fields {
        mcast_grp : 4;
        egress_rid : 4;
        mcast_hash : 16;
        lf_field_list : 32;
        resubmit_flag : 16;
        switch_role:4;
    }
}

from behavioral-model.

antoninbas avatar antoninbas commented on July 20, 2024

You are not supposed to use intrinsic_metadata to store your own metadata. Sorry for missing that in the snippet you submitted. Please use something like this:

header_type user_metadata_t {
    fields {
        switch_role : 4;
    }
}
metadata user_metadata_t user_metadata;

The names user_metadata_t / user_metadata are not important, you can use whatever you want so long as it is not intrinsic or standard. intrinsic_metadata fields have a special meaning for the switch, and you should not try to modify them. More information here: https://github.com/p4lang/behavioral-model/blob/master/docs/simple_switch.md

However, I think that the switch should probably not crash in your case, and I'll leave this issue open until I have time to try and improve it.

from behavioral-model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.