diff mbox series

[ovs-dev] ovn-trace: Fix tracing when ip.dst has to go via a gateway router

Message ID 20181009131157.26033-1-nusiddiq@redhat.com
State Accepted
Headers show
Series [ovs-dev] ovn-trace: Fix tracing when ip.dst has to go via a gateway router | expand

Commit Message

Numan Siddique Oct. 9, 2018, 1:11 p.m. UTC
From: Numan Siddique <nusiddiq@redhat.com>

ovn-trace does not trace past an l3gateway port type. This patch
fixes it.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1626080
Suggested-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
---
 ovn/utilities/ovn-trace.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mark Michelson Oct. 9, 2018, 7:39 p.m. UTC | #1
Looks good to me.

Acked-by: Mark Michelson <mmichels@redhat.com>

On 10/09/2018 09:11 AM, nusiddiq@redhat.com wrote:
> From: Numan Siddique <nusiddiq@redhat.com>
> 
> ovn-trace does not trace past an l3gateway port type. This patch
> fixes it.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1626080
> Suggested-by: Dan Williams <dcbw@redhat.com>
> Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
> ---
>   ovn/utilities/ovn-trace.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c
> index 2446b3f76..40a79ceea 100644
> --- a/ovn/utilities/ovn-trace.c
> +++ b/ovn/utilities/ovn-trace.c
> @@ -645,6 +645,15 @@ read_ports(void)
>           } else if (!strcmp(sbpb->type, "l3gateway")) {
>               /* Treat all gateways as local for our purposes. */
>               dp->has_local_l3gateway = true;
> +            const char *peer_name = smap_get(&sbpb->options, "peer");
> +            if (peer_name) {
> +                struct ovntrace_port *peer
> +                    = shash_find_data(&ports, peer_name);
> +                if (peer) {
> +                    port->peer = peer;
> +                    port->peer->peer = port;
> +                }
> +            }
>           }
>       }
>   
>
Ben Pfaff Oct. 11, 2018, 9:13 p.m. UTC | #2
Thanks Numan (and Mark).  I applied this to master.

On Tue, Oct 09, 2018 at 03:39:46PM -0400, Mark Michelson wrote:
> Looks good to me.
> 
> Acked-by: Mark Michelson <mmichels@redhat.com>
> 
> On 10/09/2018 09:11 AM, nusiddiq@redhat.com wrote:
> >From: Numan Siddique <nusiddiq@redhat.com>
> >
> >ovn-trace does not trace past an l3gateway port type. This patch
> >fixes it.
> >
> >Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1626080
> >Suggested-by: Dan Williams <dcbw@redhat.com>
> >Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
> >---
> >  ovn/utilities/ovn-trace.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> >diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c
> >index 2446b3f76..40a79ceea 100644
> >--- a/ovn/utilities/ovn-trace.c
> >+++ b/ovn/utilities/ovn-trace.c
> >@@ -645,6 +645,15 @@ read_ports(void)
> >          } else if (!strcmp(sbpb->type, "l3gateway")) {
> >              /* Treat all gateways as local for our purposes. */
> >              dp->has_local_l3gateway = true;
> >+            const char *peer_name = smap_get(&sbpb->options, "peer");
> >+            if (peer_name) {
> >+                struct ovntrace_port *peer
> >+                    = shash_find_data(&ports, peer_name);
> >+                if (peer) {
> >+                    port->peer = peer;
> >+                    port->peer->peer = port;
> >+                }
> >+            }
> >          }
> >      }
> >
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c
index 2446b3f76..40a79ceea 100644
--- a/ovn/utilities/ovn-trace.c
+++ b/ovn/utilities/ovn-trace.c
@@ -645,6 +645,15 @@  read_ports(void)
         } else if (!strcmp(sbpb->type, "l3gateway")) {
             /* Treat all gateways as local for our purposes. */
             dp->has_local_l3gateway = true;
+            const char *peer_name = smap_get(&sbpb->options, "peer");
+            if (peer_name) {
+                struct ovntrace_port *peer
+                    = shash_find_data(&ports, peer_name);
+                if (peer) {
+                    port->peer = peer;
+                    port->peer->peer = port;
+                }
+            }
         }
     }