Lines Matching +full:lookup +full:- +full:table
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * net/l3mdev/l3mdev.c - L3 master device implementation
23 return -EINVAL; in l3mdev_check_type()
42 if (hdlr->dev_lookup) { in l3mdev_table_lookup_register()
43 res = -EBUSY; in l3mdev_table_lookup_register()
47 hdlr->dev_lookup = fn; in l3mdev_table_lookup_register()
69 if (hdlr->dev_lookup == fn) in l3mdev_table_lookup_unregister()
70 hdlr->dev_lookup = NULL; in l3mdev_table_lookup_unregister()
79 lookup_by_table_id_t lookup; in l3mdev_ifindex_lookup_by_table_id() local
81 int ifindex = -EINVAL; in l3mdev_ifindex_lookup_by_table_id()
92 lookup = hdlr->dev_lookup; in l3mdev_ifindex_lookup_by_table_id()
93 if (!lookup) in l3mdev_ifindex_lookup_by_table_id()
96 ifindex = lookup(net, table_id); in l3mdev_ifindex_lookup_by_table_id()
106 * l3mdev_master_ifindex_rcu - get index of L3 master device
118 ifindex = dev->ifindex; in l3mdev_master_ifindex_rcu()
131 ifindex = master->ifindex; in l3mdev_master_ifindex_rcu()
139 * l3mdev_master_upper_ifindex_by_index_rcu - get index of upper l3 master
141 * @net: network namespace for device index lookup
152 return dev ? dev->ifindex : 0; in l3mdev_master_upper_ifindex_by_index_rcu()
157 * l3mdev_fib_table_rcu - get FIB table id associated with an L3
170 if (dev->l3mdev_ops->l3mdev_fib_table) in l3mdev_fib_table_rcu()
171 tb_id = dev->l3mdev_ops->l3mdev_fib_table(dev); in l3mdev_fib_table_rcu()
173 /* Users of netdev_master_upper_dev_get_rcu need non-const, in l3mdev_fib_table_rcu()
181 master->l3mdev_ops->l3mdev_fib_table) in l3mdev_fib_table_rcu()
182 tb_id = master->l3mdev_ops->l3mdev_fib_table(master); in l3mdev_fib_table_rcu()
210 * l3mdev_link_scope_lookup - IPv6 route lookup based on flow for link
212 * @net: network namespace for device index lookup
213 * @fl6: IPv6 flow struct for lookup
225 if (fl6->flowi6_oif) { in l3mdev_link_scope_lookup()
226 dev = dev_get_by_index_rcu(net, fl6->flowi6_oif); in l3mdev_link_scope_lookup()
231 dev->l3mdev_ops->l3mdev_link_scope_lookup) in l3mdev_link_scope_lookup()
232 dst = dev->l3mdev_ops->l3mdev_link_scope_lookup(dev, fl6); in l3mdev_link_scope_lookup()
240 * l3mdev_fib_rule_match - Determine if flowi references an
242 * @net: network namespace for device index lookup
244 * @arg: store the table the rule matched with here
254 if (!fl->flowi_l3mdev) in l3mdev_fib_rule_match()
259 dev = dev_get_by_index_rcu(net, fl->flowi_l3mdev); in l3mdev_fib_rule_match()
261 dev->l3mdev_ops->l3mdev_fib_table) { in l3mdev_fib_rule_match()
262 arg->table = dev->l3mdev_ops->l3mdev_fib_table(dev); in l3mdev_fib_rule_match()
277 if (fl->flowi_oif) { in l3mdev_update_flow()
278 dev = dev_get_by_index_rcu(net, fl->flowi_oif); in l3mdev_update_flow()
280 if (!fl->flowi_l3mdev) in l3mdev_update_flow()
281 fl->flowi_l3mdev = l3mdev_master_ifindex_rcu(dev); in l3mdev_update_flow()
283 /* oif set to L3mdev directs lookup to its table; in l3mdev_update_flow()
287 fl->flowi_oif = 0; in l3mdev_update_flow()
292 if (fl->flowi_iif > LOOPBACK_IFINDEX && !fl->flowi_l3mdev) { in l3mdev_update_flow()
293 dev = dev_get_by_index_rcu(net, fl->flowi_iif); in l3mdev_update_flow()
295 fl->flowi_l3mdev = l3mdev_master_ifindex_rcu(dev); in l3mdev_update_flow()