ebb439
From 4d84a20d68a7c3ceec726aefaa0eca234598fb97 Mon Sep 17 00:00:00 2001
ebb439
From: Numan Siddique <numans@ovn.org>
ebb439
Date: Mon, 5 Oct 2020 22:26:56 +0530
ebb439
Subject: [PATCH 2/5] ovn-trace: Don't assert for next(stage=ingress,..).
ebb439
ebb439
The commit [1] allowed next action to advance from ingress to egress pipeline, but
ebb439
ovn-trace was not modified to handle this condition. Also corrected the ovntrace node
ebb439
format message as per the next stage.
ebb439
ebb439
[1] - b4b68177eb2f("Fix conntrack entry leaks because of TCP RST packets not sent to conntrack.")
ebb439
ebb439
Fixes: b4b68177eb2f("Fix conntrack entry leaks because of TCP RST packets not sent to conntrack.")
ebb439
Acked-by: Dumitru Ceara <dceara@redhat.com>
ebb439
Signed-off-by: Numan Siddique <numans@ovn.org>
ebb439
ebb439
(cherry-picked from upstream branch-20.09 commit 3583f4312eb6ad5af86053a2b0c795ee9dbec81e)
ebb439
ebb439
Change-Id: Ia6c11333a51a2dc85fbdc7829e327b412b6e88d1
ebb439
---
ebb439
 utilities/ovn-trace.c | 13 ++++++++-----
ebb439
 1 file changed, 8 insertions(+), 5 deletions(-)
ebb439
ebb439
diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c
ebb439
index 33afc4f43..0920ae159 100644
ebb439
--- a/utilities/ovn-trace.c
ebb439
+++ b/utilities/ovn-trace.c
ebb439
@@ -1888,12 +1888,15 @@ execute_next(const struct ovnact_next *next,
ebb439
              enum ovnact_pipeline pipeline, struct ovs_list *super)
ebb439
 {
ebb439
     if (pipeline != next->pipeline) {
ebb439
-        ovs_assert(next->pipeline == OVNACT_P_INGRESS);
ebb439
-
ebb439
-        uint16_t in_key = uflow->regs[MFF_LOG_INPORT - MFF_REG0];
ebb439
+        uint16_t key = next->pipeline == OVNACT_P_INGRESS
ebb439
+                       ? uflow->regs[MFF_LOG_INPORT - MFF_REG0]
ebb439
+                       : uflow->regs[MFF_LOG_OUTPORT - MFF_REG0];
ebb439
         struct ovntrace_node *node = ovntrace_node_append(
ebb439
-            super, OVNTRACE_NODE_PIPELINE, "ingress(dp=\"%s\", inport=\"%s\")",
ebb439
-            dp->friendly_name, ovntrace_port_key_to_name(dp, in_key));
ebb439
+            super, OVNTRACE_NODE_PIPELINE, "%s(dp=\"%s\", %s=\"%s\")",
ebb439
+            next->pipeline == OVNACT_P_INGRESS ? "ingress" : "egress",
ebb439
+            dp->friendly_name,
ebb439
+            next->pipeline == OVNACT_P_INGRESS ? "inport" : "outport",
ebb439
+            ovntrace_port_key_to_name(dp, key));
ebb439
         super = &node->subs;
ebb439
     }
ebb439
     trace__(dp, uflow, next->ltable, next->pipeline, super);
ebb439
-- 
ebb439
2.26.2
ebb439