Commit 217cc5e9a0bc ("ovn-northd: Set stage-hint for all applicable
flows.") added ovn_lflow_add_with_hint() which sets the stage hint in
the logical flow records for most Northbound DB entities. However a few
cases were missed:
- newly added ECMP routes.
- newly added Forwarding Groups.
- newly added NAT rules.

Address these cases too and add support in ovn-detrace to decode
Forwarding_Group records.

Signed-off-by: Dumitru Ceara <[email protected]>
---
 northd/ovn-northd.c      | 21 +++++++++++++--------
 utilities/ovn-detrace.in | 11 +++++++++++
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 6e113b3..815c727 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -5638,8 +5638,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct 
hmap *lflows)
             "output;",
             fwd_group->vmac, fwd_group->vmac, fwd_group->vip);
 
-        ovn_lflow_add(lflows, od, S_SWITCH_IN_ARP_ND_RSP, 50,
-                      ds_cstr(&match), ds_cstr(&actions));
+        ovn_lflow_add_with_hint(lflows, od, S_SWITCH_IN_ARP_ND_RSP, 50,
+                                ds_cstr(&match), ds_cstr(&actions),
+                                &fwd_group->header_);
 
         /* L2 lookup for the forwarding group's virtual MAC */
         ds_clear(&match);
@@ -5659,8 +5660,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct 
hmap *lflows)
 
         ds_clear(&actions);
         ds_put_format(&actions, "fwd_group(%s);", ds_cstr(&group_ports));
-        ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 50,
-                      ds_cstr(&match), ds_cstr(&actions));
+        ovn_lflow_add_with_hint(lflows, od, S_SWITCH_IN_L2_LKUP, 50,
+                                ds_cstr(&match), ds_cstr(&actions),
+                                &fwd_group->header_);
     }
 
     ds_destroy(&match);
@@ -7332,8 +7334,9 @@ build_ecmp_route_flow(struct hmap *lflows, struct 
ovn_datapath *od,
                       lrp_addr_s,
                       out_port->lrp_networks.ea_s,
                       out_port->json_key);
-        ovn_lflow_add(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, 100,
-                      ds_cstr(&match), ds_cstr(&actions));
+        ovn_lflow_add_with_hint(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, 100,
+                                ds_cstr(&match), ds_cstr(&actions),
+                                &route->header_);
     }
     ds_destroy(&match);
     ds_destroy(&actions);
@@ -8784,8 +8787,10 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap 
*ports,
                     &actions, "eth.dst = %s; next;",
                     distributed ? nat->external_mac :
                     od->l3dgw_port->lrp_networks.ea_s);
-                ovn_lflow_add(lflows, od, S_ROUTER_IN_ARP_RESOLVE, 100,
-                                ds_cstr(&match), ds_cstr(&actions));
+                ovn_lflow_add_with_hint(lflows, od, S_ROUTER_IN_ARP_RESOLVE,
+                                        100, ds_cstr(&match),
+                                        ds_cstr(&actions),
+                                        &nat->header_);
             }
 
             /* Egress UNDNAT table: It is for already established connections'
diff --git a/utilities/ovn-detrace.in b/utilities/ovn-detrace.in
index 87a8d57..9ab2b66 100755
--- a/utilities/ovn-detrace.in
+++ b/utilities/ovn-detrace.in
@@ -157,6 +157,16 @@ class DHCPOptionsHintHandler(CookieHandlerByUUUID):
         print_h('DHCP Options: cidr %s options (%s)' % (
                     dhcp_opt.cidr, dhcp_opt.options))
 
+class ForwardingGroupHintHandler(CookieHandlerByUUUID):
+    def __init__(self, ovnnb_db):
+        super(ForwardingGroupHintHandler, self).__init__(ovnnb_db,
+                                                         'Forwarding_Group')
+
+    def print_record(self, fwd_group):
+        print_h('Forwarding Group: name %s vip %s vmac %s liveness %s child 
ports (%s)' % (
+                    fwd_group.name, fwd_group.vip, fwd_group.vmac,
+                    fwd_group.liveness, fwd_group.child_port))
+
 class LSPHintHandler(CookieHandlerByUUUID):
     def __init__(self, ovnnb_db):
         super(LSPHintHandler, self).__init__(ovnnb_db, 'Logical_Switch_Port')
@@ -225,6 +235,7 @@ class LogicalFlowHandler(CookieHandlerByUUUID):
         self._hint_handlers = [
             ACLHintHandler(ovnnb_db),
             DHCPOptionsHintHandler(ovnnb_db),
+            ForwardingGroupHintHandler(ovnnb_db),
             LSPHintHandler(ovnnb_db),
             LRPHintHandler(ovnnb_db),
             LRPolicyHandler(ovnnb_db),
-- 
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to