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

lenient treatment of garbage properties #138

Closed
smolkaj opened this issue Nov 5, 2016 · 3 comments
Closed

lenient treatment of garbage properties #138

smolkaj opened this issue Nov 5, 2016 · 3 comments

Comments

@smolkaj
Copy link
Member

smolkaj commented Nov 5, 2016

Currently it's possible to specify arbitrary table properties, without provoking a compiler error:

   table t {
        key = { }
        actions = { }
        something = "random";
        number = 1;
    }

Is this intended behavior, to allow the backend to use these properties? If so, at the very least I would expect a warning from the backend in case it does not understand a property. I'm concerned that this will otherwise be a source of very hard-to-find bugs:

table t {
    // typo; may be hard to spot
    sizes = 1024
}
@smolkaj smolkaj changed the title lenient treatment of garbage lenient treatment of garbage properties Nov 5, 2016
ChrisDodd pushed a commit that referenced this issue Nov 5, 2016
@smolkaj
Copy link
Member Author

smolkaj commented Nov 10, 2016

I verified that the compiler now prints a warning.

@smolkaj smolkaj closed this as completed Nov 10, 2016
@smolkaj smolkaj reopened this Nov 10, 2016
@smolkaj
Copy link
Member Author

smolkaj commented Nov 10, 2016

I now see a large number of warning for my translation of switch.p4:

l2.p4(142): warning: Unknown table property: support_timeout
        support_timeout = true;
        ^^^^^^^^^^^^^^^
multicast.p4(374): warning: Unknown table property: ipv4_multicast_route_star_g_stats
        @name("ipv4_multicast_route_star_g_stats") counters =
                                                   ^^^^^^^^
multicast.p4(390): warning: Unknown table property: ipv4_multicast_route_s_g_stats
        @name("ipv4_multicast_route_s_g_stats") counters =
                                                ^^^^^^^^
multicast.p4(467): warning: Unknown table property: ipv6_multicast_route_star_g_stats
        @name("ipv6_multicast_route_star_g_stats") counters =
                                                   ^^^^^^^^
multicast.p4(485): warning: Unknown table property: ipv6_multicast_route_s_g_stats
        @name("ipv6_multicast_route_s_g_stats") counters =
                                                ^^^^^^^^
meter.p4(40): warning: Unknown table property: meters
        meters = meter_index;
        ^^^^^^
meter.p4(77): warning: Unknown table property: meter_stats
        @name("meter_stats") counters =
                             ^^^^^^^^
security.p4(77): warning: Unknown table property: storm_control_stats
        @name("storm_control_stats") counters = direct_counter(CounterType.packets);
                                     ^^^^^^^^
l2.p4(279): warning: Unknown table property: egress_bd_stats
        @name("egress_bd_stats") counters =
                                 ^^^^^^^^

@mbudiu-vmw: I just wanted to check back with you and see if these properties are indeed unknown by bmv2, or if we need to update the knownProperties list.

@smolkaj
Copy link
Member Author

smolkaj commented Nov 29, 2016

All fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant