Skip to content

Commit

Permalink
python: ovs: flow: Add dp hash and meter actions.
Browse files Browse the repository at this point in the history
Add missing actions.

Signed-off-by: Adrian Moreno <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
amorenoz authored and Simon Horman committed Jan 18, 2024
1 parent a0149ea commit de1b03a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/ovs/flow/odp.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def _action_decoders_args():
"""Generate the arguments for the action KVDecoders."""
_decoders = {
"drop": decode_flag,
"meter": decode_int,
"lb_output": decode_int,
"trunc": decode_int,
"recirc": decode_int,
Expand Down Expand Up @@ -334,6 +335,14 @@ def _action_decoders_args():
)
),
**ODPFlow._tnl_action_decoder_args(),
"hash": nested_kv_decoder(
KVDecoders(
{
"l4": decode_int,
"sym_l4": decode_int,
}
)
),
}

_decoders["sample"] = nested_kv_decoder(
Expand Down
12 changes: 12 additions & 0 deletions python/ovs/tests/test_odp.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,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):
Expand Down

0 comments on commit de1b03a

Please sign in to comment.