2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

python: ovs: flow: Add dp hash and meter actions.

Add missing actions.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Simon Horman <horms@ovn.org>
This commit is contained in:
Adrian Moreno
2024-01-17 12:18:53 +01:00
committed by Simon Horman
parent ab7d089612
commit 5e45091ea8
2 changed files with 21 additions and 0 deletions

View File

@@ -204,6 +204,7 @@ class ODPFlow(Flow):
"""Generate the arguments for the action KVDecoders."""
_decoders = {
"drop": decode_flag,
"meter": decode_int,
"lb_output": decode_int,
"trunc": decode_int,
"recirc": decode_int,
@@ -334,6 +335,14 @@ class ODPFlow(Flow):
)
),
**ODPFlow._tnl_action_decoder_args(),
"hash": nested_kv_decoder(
KVDecoders(
{
"l4": decode_int,
"sym_l4": decode_int,
}
)
),
}
_decoders["sample"] = nested_kv_decoder(

View File

@@ -534,6 +534,18 @@ def test_odp_fields(input_string, expected):
),
],
),
(
"actions:meter(1),hash(l4(0))",
[
KeyValue("meter", 1),
KeyValue(
"hash",
{
"l4": 0,
}
),
],
),
],
)
def test_odp_actions(input_string, expected):