Giter Site home page Giter Site logo

p4-proposals's People

Contributors

akeep avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

p4-proposals's Issues

error is like enum, but might need separate explicit mention to include it in serializable

It has slightly different syntax for adding new error codes, and unlike enum has no 'type name' -- there is only one 'error enum' in any P4_16 program as specified now, but anyone can add more values to it anywhere at the top level of the program, or multiple places later.

One use case for making it serializable is to pass the value to the control plane in a header of a packet that experienced a parser error. Not a capability everyone would want in their P4 programs, but some may.

Minor nit - I don't think bool is actually serializable in current P4_16 spec

Summary: I believe that bool is currently in the same boat as enum as far as serializability goes, with 0 distinctions in what you can do with them.

This comment is prompted by this sentence in Section 3 of the serializable types proposal: "Currently, some scalar types (like bool types) are not explicitly serializable unless they are included as part of a header in the current spec"

bool is defined to have a way to cast a value of that type to bit<1>, or from bit<1> to bool.

Including either of them in a header is an error for the latest p4test and p4c-bm2-ss open source compilers.

I believe it is not allowed by the P4_16 v1.0.0 spec, either.

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.