Giter Site home page Giter Site logo

Comments (3)

jnfoster avatar jnfoster commented on August 28, 2024

Just to note: given mutable state (e.g., registers, or even a header stack) and any form of recirculation, it probably won't be decidable whether a table is bidirectional or unidirectional.

from pna.

jafingerhut avatar jafingerhut commented on August 28, 2024

If this is more subtle than I am imagining, it is probably best to talk about this in person rather than over Github issues, but all I am thinking of here is that in a single execution of a P4 control, it should be possible to symbolically and statically determine from the source code of that control a logical condition under which a table is applied if it is true, and not applied if it is false.

I realize that not all formulas are this simple, but a straightforward example is:

if ((stdmeta.direction == PNA_Direction_t.NET_TO_HOST) && (meta.foo == 5)) {
    t1.apply();
}

This is clearly a unidirectional table, since the condition implies that the stdmeta.direction must be NET_TO_HOST.

There are other such logical formulas where it definitely does NOT imply that stdmeta.direction is always one value, or always the other (e.g. the condition (hdr.ipv4.dstAddr > 50), at least in the absence of knowledge of any relationship between that input field and the direction of the packet). If there truly are undecidable cases, then I'd say that a compiler should call it a bidirectional table in the absence of straightforward provable evidence that it is unidirectional.

from pna.

hesingh avatar hesingh commented on August 28, 2024

Why use annotation? Use a new table property to specify if a table is used for incoming or outgoing or both direction. For Network Packet Broker, only hardware is used with a symmetric hash which matches both directions.

from pna.

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.