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

Support for specifying type translations as part of the forwarding configuration. #373

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions proto/p4/v1/p4runtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,28 @@ message ForwardingPipelineConfig {
uint64 cookie = 1;
}
Cookie cookie = 3;
// Optional: Translations for `@p4runtime_translation`-annotated types, keyed
// by the unique resource identifiers (URIs) of the types.
map<string, P4RuntimeTranslation> p4runtime_translation_by_uri = 4;
}

message P4RuntimeTranslation {
// Specifies the mapping between values in P4 and values in P4Runtime for
// some type annotated with a `@p4runtime_translation`.
oneof translation {
// Static mapping, given by an explicit, reversible (injective) map.
Static static = 1;
// Dynamic mapping, to be generated by the switch lazily at runtime.
// Whenever a P4Runtime value is seen by the switch for the first time, it
// is mapped to a fresh P4 value; this mapping is then persisted and applied
// to all further occurrences of the P4Runtime value.
Dynmaic dynamic = 2;
}

message Static {
map<bytes, bytes> p4_value_by_p4runtime_value = 1;
}
message Dynamic {}
}

message GetForwardingPipelineConfigRequest {
Expand Down