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

WIP: Reconfiguration APIs to allow multiple P4 pipelines to be chained. #445

Draft
wants to merge 1 commit 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
30 changes: 30 additions & 0 deletions proto/p4/v1/p4runtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,23 @@ message Update {
Entity entity = 2;
}

// Pipeline ID to uniquely identify a pipeline on a device.
message PipelineId {
uint32 id = 1;
bool enabled = 2; // Indicates if the pipeline is enabled or disabled.
}

// Define a message to specify the position for a new pipeline.
message PipelinePosition {
enum RelativePosition {
NONE = 0;
BEFORE = 1;
AFTER = 2;
}
PipelineId reference_id = 1; // The ID of the reference pipeline.
RelativePosition position = 2; // Load the new pipeline BEFORE or AFTER the reference pipeline.
}

message Entity {
oneof entity {
ExternEntry extern_entry = 1;
Expand All @@ -139,6 +156,8 @@ message Entity {
RegisterEntry register_entry = 11;
DigestEntry digest_entry = 12;
}
// Optionally specify the target pipeline. Default is the primary pipeline.
PipelineId pipeline_id = 100;
}

message ExternEntry {
Expand Down Expand Up @@ -730,6 +749,17 @@ message ForwardingPipelineConfig {
uint64 cookie = 1;
}
Cookie cookie = 3;
// Extend to support multiple pipeline operations
enum PipelineOperation {
ADD = 0; // Add a new pipeline.
REMOVE = 1; // Remove an existing pipeline.
UPDATE = 2; // Update an existing pipeline.
ENABLE = 3; // Enable a loaded pipeline.
DISABLE = 4; // Disable a loaded pipeline.
}
PipelineOperation operation = 4; // Define the operation type: ADD, REMOVE, or UPDATE.
PipelineId pipeline_id = 5; // ID to identify the pipeline. For ADD, this can be auto-generated by the server.
PipelinePosition pipeline_position = 6; // Position for the pipeline (relevant for ADD operation).
}

message GetForwardingPipelineConfigRequest {
Expand Down
Loading