diff mbox series

[ovs-dev,v2,01/11] python: fix datapath flow decoders

Message ID 20221219161352.54414-1-amorenoz@redhat.com
State Accepted
Commit c627cfd9cb630c052285a540cd65dd809be0ea95
Headers show
Series [ovs-dev,v2,01/11] python: fix datapath flow decoders | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Adrian Moreno Dec. 19, 2022, 4:13 p.m. UTC
Fix the following erros in odp decoding:
- Missing push_mpls action
- Typos in collector_set_id, tp_src/tp_dst and csum
- Missing two fields in vxlan match

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Mike Pattrick <mkp@redhat.com>
---
 python/ovs/flow/odp.py | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

Comments

Ilya Maximets Dec. 21, 2022, 6:52 p.m. UTC | #1
On 12/19/22 17:13, Adrian Moreno wrote:
> Fix the following erros in odp decoding:
> - Missing push_mpls action
> - Typos in collector_set_id, tp_src/tp_dst and csum
> - Missing two fields in vxlan match
> 
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
> Acked-by: Mike Pattrick <mkp@redhat.com>
> ---
>  python/ovs/flow/odp.py | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)

Thanks, Adrian and Mike!

I can see that tests are actually failing now if unknown attributes
are present.  Cool!

I applied the set.  First patch also backported to 3.0.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/python/ovs/flow/odp.py b/python/ovs/flow/odp.py
index 87a3bae2f..3bc3aec8e 100644
--- a/python/ovs/flow/odp.py
+++ b/python/ovs/flow/odp.py
@@ -225,7 +225,7 @@  class ODPFlow(Flow):
                             KVDecoders(
                                 {
                                     "probability": decode_int,
-                                    "collector_sed_id": decode_int,
+                                    "collector_set_id": decode_int,
                                     "obs_domain_id": decode_int,
                                     "obs_point_id": decode_int,
                                     "output_port": decode_default,
@@ -303,6 +303,21 @@  class ODPFlow(Flow):
             ),
             "pop_nsh": decode_flag,
             "tnl_pop": decode_int,
+            "pop_mpls": KVDecoders({"eth_type": decode_int}),
+            **dict.fromkeys(
+                ["push_mpls", "add_mpls"],
+                nested_kv_decoder(
+                    KVDecoders(
+                        {
+                            "label": decode_int,
+                            "tc": decode_int,
+                            "ttl": decode_int,
+                            "bos": decode_int,
+                            "eth_type": decode_int,
+                        }
+                    )
+                ),
+            ),
             "ct_clear": decode_flag,
             "ct": nested_kv_decoder(
                 KVDecoders(
@@ -412,7 +427,7 @@  class ODPFlow(Flow):
                                             {
                                                 "src": decode_int,
                                                 "dst": decode_int,
-                                                "dsum": Mask16,
+                                                "csum": Mask16,
                                             }
                                         )
                                     ),
@@ -499,8 +514,8 @@  class ODPFlow(Flow):
                         "src": IPMask,
                         "dst": IPMask,
                         "proto": Mask8,
-                        "tcp_src": Mask16,
-                        "tcp_dst": Mask16,
+                        "tp_src": Mask16,
+                        "tp_dst": Mask16,
                     }
                 )
             ),
@@ -541,6 +556,8 @@  class ODPFlow(Flow):
                         "vxlan": nested_kv_decoder(
                             KVDecoders(
                                 {
+                                    "flags": decode_int,
+                                    "vni": decode_int,
                                     "gbp": nested_kv_decoder(
                                         KVDecoders(
                                             {
@@ -548,7 +565,7 @@  class ODPFlow(Flow):
                                                 "flags": Mask8,
                                             }
                                         )
-                                    )
+                                    ),
                                 }
                             )
                         ),