forked from p4lang/p4runtime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ipdk-io/P4RuntimeProtoChange
Integrate idpf extensions to p4runtime
- Loading branch information
Showing
4 changed files
with
184 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024, Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// For licensing information, see the file ‘LICENSE’ in the root folder | ||
|
||
syntax = "proto3"; | ||
|
||
import "p4/config/v1/p4info.proto"; | ||
|
||
// This is an extension of p4/config/v1/p4info.proto. | ||
// It provides support for the meter externs in the Intel IPU E2100. | ||
|
||
package idpf; | ||
|
||
option go_package = "github.com/p4lang/p4runtime/go/idpf"; | ||
|
||
message P4Ids { | ||
enum Prefix { | ||
UNSPECIFIED = 0; | ||
MATCH_VALUE_LOOKUP_TABLE = 0x81; | ||
TERNARY_MATCH_LOOKUP_TABLE = 0x82; | ||
TSMETER = 0x83; | ||
DIRECT_TSMETER = 0x84; | ||
PACKET_MOD_METER = 0x85; | ||
DIRECT_PACKET_MOD_METER = 0x86; | ||
} | ||
} | ||
|
||
message Param { | ||
uint32 id = 1; | ||
string name = 2; | ||
uint32 bitwidth = 3; | ||
} | ||
|
||
message MatchValueLookupTable { | ||
p4.config.v1.Preamble preamble = 1; | ||
repeated p4.config.v1.MatchField match_fields = 2; | ||
repeated Param params = 3; | ||
uint32 size = 4; | ||
} | ||
|
||
message TSMeter { | ||
p4.config.v1.Preamble preamble = 1; | ||
p4.config.v1.MeterSpec spec = 2; | ||
int32 size = 3; | ||
uint32 index_width = 4; | ||
} | ||
|
||
message DirectTSMeter { | ||
p4.config.v1.Preamble preamble = 1; | ||
p4.config.v1.MeterSpec spec = 2; | ||
} | ||
|
||
message PacketModMeter { | ||
p4.config.v1.Preamble preamble = 1; | ||
p4.config.v1.MeterSpec spec = 2; | ||
int32 size = 3; | ||
uint32 index_width = 4; | ||
} | ||
|
||
message DirectPacketModMeter { | ||
p4.config.v1.Preamble preamble = 1; | ||
p4.config.v1.MeterSpec spec = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2024, Intel Corporation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// For licensing information, see the file ‘LICENSE’ in the root folder | ||
|
||
syntax = "proto3"; | ||
|
||
import "google/protobuf/any.proto"; | ||
import "p4/v1/p4runtime.proto"; | ||
|
||
// This is an extension of p4/v1/p4runtime.proto | ||
// It provides support for the meter externs in the Intel IPU E2100. | ||
|
||
package idpf; | ||
|
||
option go_package = "github.com/p4lang/p4runtime/go/idpf"; | ||
|
||
// MatchValueLookupTable | ||
message MVLUTEntry { | ||
uint32 mvlut_id = 1; | ||
message ConfigParam { | ||
message Param { | ||
uint32 param_id = 1; | ||
uint64 param_value = 2; | ||
} | ||
repeated Param params = 1; | ||
} | ||
repeated p4.v1.FieldMatch match = 2; | ||
ConfigParam param = 3; | ||
} | ||
|
||
// DANGER -- this is an extension of p4.v1.Action with some additional fields. | ||
// as such it needs to be identical to that with just extra stuff added. | ||
// It is unfortunate that protobuf does not support versioning and extension. | ||
message Action { | ||
uint32 action_id = 1; | ||
message Param { | ||
uint32 param_id = 2; | ||
bytes value = 3; | ||
// extra stuff added for idpf | ||
string param_name = 5; | ||
string proto_id = 6; | ||
string key_name = 7; | ||
} | ||
repeated Param params = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters