From: David Ahern <dsah...@gmail.com>

Change fib6_table_lookup tracepoint to take the fib6_result and use
the fib6_info and fib6_nh from it.

Signed-off-by: David Ahern <dsah...@gmail.com>
---
 include/trace/events/fib6.h | 16 ++++++++--------
 net/ipv6/route.c            |  6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/trace/events/fib6.h b/include/trace/events/fib6.h
index 6d05ebdd669c..70e252d926ea 100644
--- a/include/trace/events/fib6.h
+++ b/include/trace/events/fib6.h
@@ -12,10 +12,10 @@
 
 TRACE_EVENT(fib6_table_lookup,
 
-       TP_PROTO(const struct net *net, const struct fib6_info *f6i,
+       TP_PROTO(const struct net *net, const struct fib6_result *res,
                 struct fib6_table *table, const struct flowi6 *flp),
 
-       TP_ARGS(net, f6i, table, flp),
+       TP_ARGS(net, res, table, flp),
 
        TP_STRUCT__entry(
                __field(        u32,    tb_id           )
@@ -39,7 +39,7 @@ TRACE_EVENT(fib6_table_lookup,
                struct in6_addr *in6;
 
                __entry->tb_id = table->tb6_id;
-               __entry->err = ip6_rt_type_to_error(f6i->fib6_type);
+               __entry->err = ip6_rt_type_to_error(res->f6i->fib6_type);
                __entry->oif = flp->flowi6_oif;
                __entry->iif = flp->flowi6_iif;
                __entry->tos = ip6_tclass(flp->flowlabel);
@@ -62,20 +62,20 @@ TRACE_EVENT(fib6_table_lookup,
                        __entry->dport = 0;
                }
 
-               if (f6i->fib6_nh.fib_nh_dev) {
-                       __assign_str(name, f6i->fib6_nh.fib_nh_dev);
+               if (res->nh && res->nh->fib_nh_dev) {
+                       __assign_str(name, res->nh->fib_nh_dev);
                } else {
                        __assign_str(name, "-");
                }
-               if (f6i == net->ipv6.fib6_null_entry) {
+               if (res->f6i == net->ipv6.fib6_null_entry) {
                        struct in6_addr in6_zero = {};
 
                        in6 = (struct in6_addr *)__entry->gw;
                        *in6 = in6_zero;
 
-               } else if (f6i) {
+               } else if (res->nh) {
                        in6 = (struct in6_addr *)__entry->gw;
-                       *in6 = f6i->fib6_nh.fib_nh_gw6;
+                       *in6 = res->nh->fib_nh_gw6;
                }
        ),
 
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index de2a901b4d30..e16d27df5dac 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1130,7 +1130,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct net 
*net,
        }
 
 out:
-       trace_fib6_table_lookup(net, res.f6i, table, fl6);
+       trace_fib6_table_lookup(net, &res, table, fl6);
 
        rcu_read_unlock();
 
@@ -1865,7 +1865,7 @@ struct fib6_info *fib6_table_lookup(struct net *net, 
struct fib6_table *table,
                }
        }
 
-       trace_fib6_table_lookup(net, res.f6i, table, fl6);
+       trace_fib6_table_lookup(net, &res, table, fl6);
 
        return res.f6i;
 }
@@ -2534,7 +2534,7 @@ static struct rt6_info *__ip6_route_redirect(struct net 
*net,
 
        rcu_read_unlock();
 
-       trace_fib6_table_lookup(net, rt, table, fl6);
+       trace_fib6_table_lookup(net, &res, table, fl6);
        return ret;
 };
 
-- 
2.11.0

Reply via email to