Code Monkey home page Code Monkey logo

Comments (4)

dhankook avatar dhankook commented on July 18, 2024

from behavioral-model.

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

For the first option.
Indeed I will have some more roles that do not contain those "ecmp_group" and "forward". So does it mean I should use the second option that copy the tables and commands to new one with different name?

from behavioral-model.

dhankook avatar dhankook commented on July 18, 2024

from behavioral-model.

antoninbas avatar antoninbas commented on July 18, 2024

Just adding some more info to @dhankook answer. In theory, the compiler and software switch should allow you to invoke the same table from 2 different places in the control flow, providing the 2 invocations are mutually exclusive (i.e. the same packet cannot go through the same table twice). However, because of the way we process the control flow in the current P4 compiler (we transform it into a table graph), it is actually pretty difficult to allow this, so we just throw an error if the same table is "applied" twice. While there is no immediate plan to fix this in the current compiler, we are hoping the next compiler (for P4_16) will not have this limitation.

Regarding your specific use case, I'd like to point out that most people will probably achieve different roles by writing different P4 programs and swapping the programs on the target as needed. This can be done in bmv2 through the runtime CLI. When you include all your roles in a single P4 program, you may limit the amount of physical resources available for each role. While in bmv2 your programs can be arbitrarily complex, this won't be the case for hardware P4 targets.

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.