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

Generic Table First draft #435

Merged
merged 45 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e553d88
Initial changes for generic tables
saynb Apr 13, 2023
1d8eff5
second changes
saynb Apr 13, 2023
4690968
3rd changes
saynb Apr 14, 2023
55bf9be
4th changes
saynb Apr 14, 2023
f775ddc
5th changes
saynb Apr 14, 2023
07b2da6
Adding p4types and p4info changes for GenericData (#4)
saynb May 12, 2023
e4a5309
Adding varbits and a readme writeup (#5)
saynb May 12, 2023
fd132e7
Adding proto changes
saynb May 12, 2023
2a5eae6
Adding genericTable for direct resources. Adding P4datatypespec to ge…
saynb May 19, 2023
35dc65a
* Adding more container types
saynb May 26, 2023
6e7c5f1
* Add Table categories introduction
saynb May 26, 2023
d6e042b
* Adding 3-level property details (Table, Entry, field)
saynb Jun 2, 2023
53b105f
* Adding Read RPC details in table categories
saynb Jun 9, 2023
b0c29d2
Expanding combinations
saynb Jun 16, 2023
4ab7546
review comments
saynb Jun 23, 2023
88a0dd1
* Explain more on indexed tables. How are duplicates handled
saynb Jun 29, 2023
74c1661
Update Go dependencies (#438)
antoninbas Jul 6, 2023
d76a364
Fixes https://github.com/p4lang/p4runtime/issues/439 (#440)
chrispsommers Jul 6, 2023
be046f3
* Adding categories and properties in p4info
saynb Jul 7, 2023
cd271fd
* Removed GenericTable category from the p4info
saynb Jul 13, 2023
1131a75
Adding space for dummy commit
saynb Jul 21, 2023
eef4daf
Correcting typo
saynb Aug 3, 2023
0e2fb58
Adding dev branches to workflows (#443)
saynb Aug 4, 2023
119bdd6
Merge branch 'main' into generic_table_2
saynb Aug 8, 2023
5797394
Merge branch 'generic-table-dev' of https://github.com/saynb/p4runtim…
saynb Aug 8, 2023
e9e996e
Correcting linter errors
saynb Aug 8, 2023
3a5f4e4
Generating go and py files
saynb Aug 8, 2023
29aab4e
Adding text regarding direct resources as GenericTables in TableEntry
saynb Aug 11, 2023
185fa08
some review comment changes
saynb Aug 19, 2023
090aa0a
Andy review comments
saynb Aug 25, 2023
48f04d9
remove whitespace
saynb Aug 25, 2023
b101dab
* Correcting GenericTable.md according to the p4info
saynb Sep 7, 2023
4d4d9f7
* Removing float from p4info and spec
saynb Sep 7, 2023
89f11d9
* Adding section to P4DataTypeSpec to indicate adding to
saynb Sep 7, 2023
371d184
Moving GenericTable.md to docs
saynb Sep 7, 2023
b4dfa73
Correcting spec for removal of p4_type in generic_type. Adding genera…
saynb Sep 7, 2023
a8ec796
* Shortening the field names in `GenericTable` to remove "genric_table_"
saynb Sep 7, 2023
1c026e4
* Making default_value as bytes
saynb Sep 7, 2023
727bab2
Adding default string value
saynb Sep 7, 2023
7f1a54a
review comments
saynb Sep 7, 2023
2cbd34c
linter error
saynb Sep 7, 2023
9ff6e4e
Review comments
saynb Sep 22, 2023
0fcf0c4
Correcting whitespace errors
saynb Dec 7, 2023
71eef58
Resolving conflicts in spec and proto only
saynb Feb 22, 2024
8bbd503
Updating generated code
saynb Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions docs/v1/GenericTable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# GenericTable example p4info

Below is an example for realizing MulticastGroupEntry as a GenericTable.
The key (MatchFields) comprise of only the group_id. 2 different ways of
defining the data fields has been presented. Only 1 of them is required.

```
generic_tables {
type_id : 145
type_name : "MulticastGroup"
properties : {
"indexed"
}
instances {
preamble {
id: 45332650
name: "MulticastGroup"
alias: "multicast_group"
}
generic_match_fields {
id: 1
name: "multicast_group_id"
match_type: EXACT
type_spec {
bitstring {
bit {
bitwidth : 32
}
}
}
}
union_refs {
id: 23557840
scope: TABLE_AND_DEFAULT
}
size: 1024
}
}
```

In the below one, both `instance` and `port` are separate
repeated fields. So the check on `len(instance_array) == len(port_array)`
needs to be a runtime check. This however keeps implementation simpler
and faster since we avoid further recursive nesting.

`port` is a varbytes of max size 64 bits each. The field is a list so
it is defined as list of varbits through p4info.

```
unions {
preamble {
id: 23557840
name: "multicast_group_member_add"
alias: "multicast_group_member_add"
}
params {
id: 1
name: "instance"
type_spec {
list {
element_type_spec {
bitstring {
bit {
bitwidth : 32
}
}
}
max_size : 10
}
}
}
params {
id: 2
name: "port"
type_spec {
list {
type_spec {
bitstring {
varbit {
max_bitwidth : 64
}
}
}
max_size : 10
}
}
}
}

```

The below one is similar to the above but both `instance` and `port` have
been converted to a list of structs.

```
unions {
preamble {
id: 23557841
name: "multicast_group_member_add_2"
alias: "multicast_group_member_add_2"
}
params {
id: 1
name: "replica"
type_spec {
list {
element_type_spec {
struct {
members {
id : 1
name : "instance"
type_spec {
bitstring {
bit {
bitwidth : 32
}
}
}
}
members {
id : 2
name : "port"
type_spec {
bitstring {
varbit {
max_bitwidth : 64
}
}
}
}
}
}
max_size : 10
}
}
}
}
```
Loading
Loading