Skip to content

Commit

Permalink
Extend BMv2 proto with error codes. (sonic-net#764)
Browse files Browse the repository at this point in the history

Co-authored-by: kishanps <[email protected]>
  • Loading branch information
VSuryaprasad-HCL and kishanps authored Nov 26, 2024
1 parent 1027213 commit 421ecac
Show file tree
Hide file tree
Showing 9 changed files with 396 additions and 1 deletion.
4 changes: 3 additions & 1 deletion p4_symbolic/bmv2/bmv2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ message P4Program {
repeated Deparser deparsers = 4;
// All actions defined in the program, including their names
// paramters, and bodies.
// Eventhough actions are typically attached to tables,
// Even though actions are typically attached to tables,
// they are defined seperatly in the JSON format,
// and the table definitions refer to them by their action id.
repeated Action actions = 5;
// All pipelines (e.g. control constructs) defined in the program,
// including all their tables, and the mapping of tables
// to actions via match keys.
repeated Pipeline pipelines = 6;
// All errors defined in the program.
repeated google.protobuf.ListValue errors = 7;
}

// A P4 header type definition.
Expand Down
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/basic.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1109,3 +1109,59 @@ pipelines {
source_fragment: "MyEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/hardcoded.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,59 @@ pipelines {
source_fragment: "UselessEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/reflector.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,59 @@ pipelines {
source_fragment: "UselessEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/set_invalid.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,59 @@ pipelines {
source_fragment: "UselessEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/table.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,59 @@ pipelines {
source_fragment: "UselessEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
56 changes: 56 additions & 0 deletions p4_symbolic/bmv2/expected/table_hit_1.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -860,3 +860,59 @@ pipelines {
source_fragment: "MyEgress"
}
}
errors {
values {
string_value: "NoError"
}
values {
number_value: 0
}
}
errors {
values {
string_value: "PacketTooShort"
}
values {
number_value: 1
}
}
errors {
values {
string_value: "NoMatch"
}
values {
number_value: 2
}
}
errors {
values {
string_value: "StackOutOfBounds"
}
values {
number_value: 3
}
}
errors {
values {
string_value: "HeaderTooShort"
}
values {
number_value: 4
}
}
errors {
values {
string_value: "ParserTimeout"
}
values {
number_value: 5
}
}
errors {
values {
string_value: "ParserInvalidArgument"
}
values {
number_value: 6
}
}
Loading

0 comments on commit 421ecac

Please sign in to comment.