All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table
@ 2017-10-19  7:31 Paolo Abeni
  2017-10-19 13:30 ` Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paolo Abeni @ 2017-10-19  7:31 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Steven Rostedt, Ingo Molnar, David Ahern

The perf traces for ipv6 routing code show a relevant cost around
trace_fib6_table_lookup(), even if no trace is enabled. This is
due to the fib6_table de-referencing currently performed by the
caller.

Let's the tracing code pay this overhead, passing to the trace
helper the table pointer. This gives small but measurable
performance improvement under UDP flood.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 include/trace/events/fib6.h |  6 +++---
 net/ipv6/route.c            | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/trace/events/fib6.h b/include/trace/events/fib6.h
index d60096cddb2a..b34bed17abc7 100644
--- a/include/trace/events/fib6.h
+++ b/include/trace/events/fib6.h
@@ -12,9 +12,9 @@
 TRACE_EVENT(fib6_table_lookup,
 
 	TP_PROTO(const struct net *net, const struct rt6_info *rt,
-		 u32 tb_id, const struct flowi6 *flp),
+		 struct fib6_table *table, const struct flowi6 *flp),
 
-	TP_ARGS(net, rt, tb_id, flp),
+	TP_ARGS(net, rt, table, flp),
 
 	TP_STRUCT__entry(
 		__field(	u32,	tb_id		)
@@ -34,7 +34,7 @@ TRACE_EVENT(fib6_table_lookup,
 	TP_fast_assign(
 		struct in6_addr *in6;
 
-		__entry->tb_id = tb_id;
+		__entry->tb_id = table->tb6_id;
 		__entry->oif = flp->flowi6_oif;
 		__entry->iif = flp->flowi6_iif;
 		__entry->tos = ip6_tclass(flp->flowlabel);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 2e8842fa6450..d638fd993287 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -945,7 +945,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct net *net,
 
 	rcu_read_unlock();
 
-	trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
+	trace_fib6_table_lookup(net, rt, table, fl6);
 
 	return rt;
 
@@ -1670,7 +1670,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
 	if (rt == net->ipv6.ip6_null_entry) {
 		rcu_read_unlock();
 		dst_hold(&rt->dst);
-		trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
+		trace_fib6_table_lookup(net, rt, table, fl6);
 		return rt;
 	} else if (rt->rt6i_flags & RTF_CACHE) {
 		if (ip6_hold_safe(net, &rt, true)) {
@@ -1678,7 +1678,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
 			rt6_dst_from_metrics_check(rt);
 		}
 		rcu_read_unlock();
-		trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
+		trace_fib6_table_lookup(net, rt, table, fl6);
 		return rt;
 	} else if (unlikely((fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH) &&
 			    !(rt->rt6i_flags & RTF_GATEWAY))) {
@@ -1714,7 +1714,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
 		}
 
 uncached_rt_out:
-		trace_fib6_table_lookup(net, uncached_rt, table->tb6_id, fl6);
+		trace_fib6_table_lookup(net, uncached_rt, table, fl6);
 		return uncached_rt;
 
 	} else {
@@ -1742,7 +1742,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
 		}
 		local_bh_enable();
 		rcu_read_unlock();
-		trace_fib6_table_lookup(net, pcpu_rt, table->tb6_id, fl6);
+		trace_fib6_table_lookup(net, pcpu_rt, table, fl6);
 		return pcpu_rt;
 	}
 }
@@ -2183,7 +2183,7 @@ static struct rt6_info *__ip6_route_redirect(struct net *net,
 
 	rcu_read_unlock();
 
-	trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
+	trace_fib6_table_lookup(net, rt, table, fl6);
 	return rt;
 };
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table
  2017-10-19  7:31 [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table Paolo Abeni
@ 2017-10-19 13:30 ` Steven Rostedt
  2017-10-19 15:38 ` David Ahern
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2017-10-19 13:30 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: netdev, David S. Miller, Ingo Molnar, David Ahern

On Thu, 19 Oct 2017 09:31:43 +0200
Paolo Abeni <pabeni@redhat.com> wrote:

> The perf traces for ipv6 routing code show a relevant cost around
> trace_fib6_table_lookup(), even if no trace is enabled. This is
> due to the fib6_table de-referencing currently performed by the
> caller.
> 
> Let's the tracing code pay this overhead, passing to the trace
> helper the table pointer. This gives small but measurable
> performance improvement under UDP flood.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table
  2017-10-19  7:31 [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table Paolo Abeni
  2017-10-19 13:30 ` Steven Rostedt
@ 2017-10-19 15:38 ` David Ahern
  2017-10-19 17:26 ` Martin KaFai Lau
  2017-10-21  1:23 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2017-10-19 15:38 UTC (permalink / raw)
  To: Paolo Abeni, netdev; +Cc: David S. Miller, Steven Rostedt, Ingo Molnar

On 10/19/17 1:31 AM, Paolo Abeni wrote:
> The perf traces for ipv6 routing code show a relevant cost around
> trace_fib6_table_lookup(), even if no trace is enabled. This is
> due to the fib6_table de-referencing currently performed by the
> caller.
> 
> Let's the tracing code pay this overhead, passing to the trace
> helper the table pointer. This gives small but measurable
> performance improvement under UDP flood.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  include/trace/events/fib6.h |  6 +++---
>  net/ipv6/route.c            | 12 ++++++------
>  2 files changed, 9 insertions(+), 9 deletions(-)

Makes sense.

Acked-by: David Ahern <dsa@cumulusnetworks.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table
  2017-10-19  7:31 [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table Paolo Abeni
  2017-10-19 13:30 ` Steven Rostedt
  2017-10-19 15:38 ` David Ahern
@ 2017-10-19 17:26 ` Martin KaFai Lau
  2017-10-21  1:23 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Martin KaFai Lau @ 2017-10-19 17:26 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, David S. Miller, Steven Rostedt, Ingo Molnar, David Ahern

On Thu, Oct 19, 2017 at 07:31:43AM +0000, Paolo Abeni wrote:
> The perf traces for ipv6 routing code show a relevant cost around
> trace_fib6_table_lookup(), even if no trace is enabled. This is
> due to the fib6_table de-referencing currently performed by the
> caller.
> 
> Let's the tracing code pay this overhead, passing to the trace
> helper the table pointer. This gives small but measurable
> performance improvement under UDP flood.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table
  2017-10-19  7:31 [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table Paolo Abeni
                   ` (2 preceding siblings ...)
  2017-10-19 17:26 ` Martin KaFai Lau
@ 2017-10-21  1:23 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-10-21  1:23 UTC (permalink / raw)
  To: pabeni; +Cc: netdev, rostedt, mingo, dsa

From: Paolo Abeni <pabeni@redhat.com>
Date: Thu, 19 Oct 2017 09:31:43 +0200

> The perf traces for ipv6 routing code show a relevant cost around
> trace_fib6_table_lookup(), even if no trace is enabled. This is
> due to the fib6_table de-referencing currently performed by the
> caller.
> 
> Let's the tracing code pay this overhead, passing to the trace
> helper the table pointer. This gives small but measurable
> performance improvement under UDP flood.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Looks good, applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-21  1:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19  7:31 [PATCH net-next] ipv6: let trace_fib6_table_lookup() dereference the fib table Paolo Abeni
2017-10-19 13:30 ` Steven Rostedt
2017-10-19 15:38 ` David Ahern
2017-10-19 17:26 ` Martin KaFai Lau
2017-10-21  1:23 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.