summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2026-10-08 16:31:57 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-10-13 12:26:26 +0200
commitc436a624f89e56978659a12e01fe8b2fda2b3a6d (patch)
tree927de86dd1c34a40f4672a885564101e968c70e4 /include
parentffe378c06c10b97806e2109a5d619a48a9c2940c (diff)
ipv4: Pass netns to fib_table_lookup()
The next patch will report the network namespace cookie in the fib_table_lookup tracepoint. As a preparation, pass the namespace to fib_table_lookup() and from there to the tracepoint, like the fib6_table_lookup tracepoint. All the callers already have the namespace at hand. Add the namespace as the last tracepoint argument so that the positions of the existing arguments do not change and BPF programs that attach to the raw tracepoint are not affected. No functional changes intended. Assisted-by: LLM Reviewed-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Ferenc Fejes <ferenc@fejes.dev> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20261008133158.1438907-3-idosch@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip_fib.h12
-rw-r--r--include/trace/events/fib.h5
2 files changed, 10 insertions, 7 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 0a35355fb0f3..fb446f01a65d 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -275,8 +275,9 @@ struct fib_dump_filter {
struct net_device *dev;
};
-int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
- struct fib_result *res, int fib_flags);
+int fib_table_lookup(struct net *net, struct fib_table *tb,
+ const struct flowi4 *flp, struct fib_result *res,
+ int fib_flags);
int fib_table_insert(struct net *, struct fib_table *, struct fib_config *,
struct netlink_ext_ack *extack);
int fib_table_delete(struct net *, struct fib_table *, struct fib_config *,
@@ -323,7 +324,8 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
tb = fib_get_table(net, RT_TABLE_MAIN);
if (tb)
- err = fib_table_lookup(tb, flp, res, flags | FIB_LOOKUP_NOREF);
+ err = fib_table_lookup(net, tb, flp, res,
+ flags | FIB_LOOKUP_NOREF);
if (err == -EAGAIN)
err = -ENETUNREACH;
@@ -387,14 +389,14 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
tb = rcu_dereference_rtnl(net->ipv4.fib_main);
if (tb)
- err = fib_table_lookup(tb, flp, res, flags);
+ err = fib_table_lookup(net, tb, flp, res, flags);
if (err != -EAGAIN)
goto out;
tb = rcu_dereference_rtnl(net->ipv4.fib_default);
if (tb)
- err = fib_table_lookup(tb, flp, res, flags);
+ err = fib_table_lookup(net, tb, flp, res, flags);
if (err == -EAGAIN)
err = -ENETUNREACH;
diff --git a/include/trace/events/fib.h b/include/trace/events/fib.h
index feb28b359eff..341905b5edf3 100644
--- a/include/trace/events/fib.h
+++ b/include/trace/events/fib.h
@@ -15,9 +15,10 @@
TRACE_EVENT(fib_table_lookup,
TP_PROTO(u32 tb_id, const struct flowi4 *flp,
- const struct fib_nh_common *nhc, int err),
+ const struct fib_nh_common *nhc, int err,
+ const struct net *net),
- TP_ARGS(tb_id, flp, nhc, err),
+ TP_ARGS(tb_id, flp, nhc, err, net),
TP_STRUCT__entry(
__field( u32, tb_id )