nexthop
fm10k_record_global_table_data(&err_msg.nexthop, &hw->swapi.nexthop);
struct fm10k_global_table_data nexthop;
struct fm10k_swapi_table_info nexthop;
struct nsim_nexthop *nexthop;
nexthop = kzalloc_obj(*nexthop);
if (!nexthop)
nexthop->id = info->id;
nexthop->is_resilient = true;
kfree(nexthop);
nexthop->occ = occ;
return nexthop;
static void nsim_nexthop_destroy(struct nsim_nexthop *nexthop)
kfree(nexthop);
const struct nsim_nexthop *nexthop,
nexthop_set_hw_flags(net, nexthop->id, false, trap);
if (!nexthop->is_resilient)
for (i = 0; i < nexthop->occ; i++)
nexthop_bucket_set_hw_flags(net, nexthop->id, i, false, trap);
struct nsim_nexthop *nexthop,
err = nsim_nexthop_account(data, nexthop->occ, true, extack);
err = rhashtable_insert_fast(&data->nexthop_ht, &nexthop->ht_node,
nsim_nexthop_hw_flags_set(net, nexthop, true);
nsim_nexthop_account(data, nexthop->occ, false, extack);
struct nsim_nexthop *nexthop,
err = nsim_nexthop_account(data, nexthop->occ, true, extack);
&nexthop_old->ht_node, &nexthop->ht_node,
nsim_nexthop_hw_flags_set(net, nexthop, true);
nsim_nexthop_account(data, nexthop->occ, false, extack);
struct nsim_nexthop *nexthop, *nexthop_old;
nexthop = nsim_nexthop_create(data, info);
if (IS_ERR(nexthop))
return PTR_ERR(nexthop);
err = nsim_nexthop_add(data, nexthop, info->extack);
err = nsim_nexthop_replace(data, nexthop, nexthop_old,
nsim_nexthop_destroy(nexthop);
struct nsim_nexthop *nexthop;
nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &info->id,
if (!nexthop)
rhashtable_remove_fast(&data->nexthop_ht, &nexthop->ht_node,
nsim_nexthop_account(data, nexthop->occ, false, info->extack);
nsim_nexthop_destroy(nexthop);
struct nsim_nexthop *nexthop = ptr;
nsim_nexthop_hw_flags_set(net, nexthop, false);
nsim_nexthop_account(data, nexthop->occ, false, NULL);
nsim_nexthop_destroy(nexthop);
struct nsim_nexthop *nexthop;
nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &nhid,
if (!nexthop || !nexthop->is_resilient ||
bucket_index >= nexthop->occ) {
activity = bitmap_zalloc(nexthop->occ, GFP_KERNEL);
nexthop_res_grp_activity_update(net, nhid, nexthop->occ, activity);
const struct in6_addr *nexthop;
nexthop = rt6_nexthop(dst_rt6_info(dst), &ipv6_hdr(skb)->daddr);
neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop);
neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false);
struct nexthop *nh;
struct nexthop *nh;
struct nexthop *nh;
struct nexthop *nh = rtnl_dereference(f->nh);
static void vxlan_fdb_nh_flush(struct nexthop *nh)
struct nexthop *nh;
struct nexthop *old_nh = rtnl_dereference(fdb->nh);
struct nexthop *nh;
struct nexthop *nh;
struct nexthop __rcu *nh;
__be32 nexthop;
struct nexthop *nh;
struct nexthop;
struct nexthop *nh;
mctp_eid_t nexthop;
struct netns_nexthop nexthop;
struct nexthop *nh;
struct nexthop *nh_parent; /* nexthop of group with this entry */
struct nexthop;
struct nexthop *nexthop_find_by_id(struct net *net, u32 id);
static inline bool nexthop_get(struct nexthop *nh)
static inline void nexthop_put(struct nexthop *nh)
static inline bool nexthop_cmp(const struct nexthop *nh1,
const struct nexthop *nh2)
static inline bool nexthop_is_fdb(const struct nexthop *nh)
static inline bool nexthop_has_v4(const struct nexthop *nh)
static inline bool nexthop_is_multipath(const struct nexthop *nh)
struct nexthop *nexthop_select_path(struct nexthop *nh, int hash);
static inline unsigned int nexthop_num_path(const struct nexthop *nh)
struct nexthop *nexthop_mpath_select(const struct nh_group *nhg, int nhsel)
int nexthop_mpath_fill_node(struct sk_buff *skb, struct nexthop *nh,
struct nexthop *nhe = nhg->nh_entries[i].nh;
static inline bool nexthop_is_blackhole(const struct nexthop *nh)
struct nexthop *nh;
struct fib_nh_common *nexthop_fib_nhc(struct nexthop *nh, int nhsel)
struct fib_nh_common *nexthop_get_nhc_lookup(const struct nexthop *nh,
struct nexthop *nhe = nhg->nh_entries[i].nh;
static inline bool nexthop_uses_dev(const struct nexthop *nh,
struct nexthop *nhe = nhg->nh_entries[i].nh;
int fib_check_nexthop(struct nexthop *nh, u8 scope,
int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
static inline struct fib6_nh *nexthop_fib6_nh(struct nexthop *nh)
struct nexthop *nh = res->f6i->nh;
int nexthop_for_each_fib6_nh(struct nexthop *nh,
static inline int nexthop_get_family(struct nexthop *nh)
struct fib_nh_common *nexthop_fdb_nhc(struct nexthop *nh)
static inline struct fib_nh_common *nexthop_path_fdb_result(struct nexthop *nh,
struct nexthop *nhp;
struct nexthop *nh_parent;
static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
const struct in6_addr *nexthop;
nexthop = daddr;
nexthop = &lowpan_cb(skb)->gw;
nexthop = rt6_nexthop(rt, daddr);
memcpy(&lowpan_cb(skb)->gw, nexthop, sizeof(struct in6_addr));
BT_DBG("gw %pI6c", nexthop);
if (!ipv6_addr_cmp(&peer->peer_addr, nexthop)) {
neigh = __ipv6_neigh_lookup(dev->netdev, nexthop);
const struct in6_addr *nexthop;
nexthop = rt6_nexthop(dst_rt6_info(dst),
nexthop = &nh->ipv6_nh;
neigh = ip_neigh_gw6(dev, nexthop);
struct nexthop *nh = NULL;
if (memcmp(&opt->nexthop, &optptr[srrptr-1], 4) == 0)
ip_hdr(skb)->daddr = opt->nexthop;
__be32 nexthop;
memcpy(&nexthop, &optptr[srrptr-1], 4);
err = ip_route_input(skb, nexthop, iph->saddr, ip4h_dscp(iph),
iph->daddr = nexthop;
opt->nexthop = nexthop;
static size_t nh_nlmsg_size_grp(struct nexthop *nh, u32 op_flags)
static size_t nh_nlmsg_size_single(struct nexthop *nh)
static size_t nh_nlmsg_size(struct nexthop *nh, u32 op_flags)
static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info)
const struct nexthop *nh)
static int nh_fill_res_bucket(struct sk_buff *skb, struct nexthop *nh,
struct nexthop *nh = nhge->nh_parent;
static bool valid_group_nh(struct nexthop *nh, unsigned int npaths,
static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family,
struct nexthop *nh;
static bool nexthop_is_good_nh(const struct nexthop *nh)
static struct nexthop *nexthop_select_path_fdb(struct nh_group *nhg, int hash)
static struct nexthop *nexthop_select_path_hthr(struct nh_group *nhg, int hash)
static struct nexthop *nexthop_select_path_res(struct nh_group *nhg, int hash)
struct nexthop *nexthop_select_path(struct nexthop *nh, int hash)
int nexthop_for_each_fib6_nh(struct nexthop *nh,
int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
static int fib6_check_nh_list(struct nexthop *old, struct nexthop *new,
int fib_check_nexthop(struct nexthop *nh, u8 scope,
static int fib_check_nh_list(struct nexthop *old, struct nexthop *new,
const struct nexthop *nh)
struct nexthop *nhp = nhge->nh_parent;
struct nexthop *nh = nhge->nh;
const struct nexthop *nh)
static void remove_nexthop_from_groups(struct net *net, struct nexthop *nh,
static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo)
static void __remove_nexthop_fib(struct net *net, struct nexthop *nh)
const struct nexthop *nh)
static void __remove_nexthop(struct net *net, struct nexthop *nh,
static void remove_nexthop(struct net *net, struct nexthop *nh,
rb_erase(&nh->rb_node, &net->nexthop.rb_root);
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh,
struct nexthop *replaced_nh)
static int replace_nexthop_grp(struct net *net, struct nexthop *old,
struct nexthop *new, const struct nh_config *cfg,
const struct nexthop *nh)
static void remove_nexthop(struct net *net, struct nexthop *nh,
struct nexthop *old,
struct nexthop *nh,
struct nexthop *group_nh,
struct nexthop *old,
static int replace_nexthop_single(struct net *net, struct nexthop *old,
struct nexthop *new,
struct nexthop *nhp = nhge->nh_parent;
struct nexthop *nhp = nhge->nh_parent;
struct nexthop *nhp = nhge->nh_parent;
static void __nexthop_replace_notify(struct net *net, struct nexthop *nh,
static void nexthop_replace_notify(struct net *net, struct nexthop *nh,
static int replace_nexthop(struct net *net, struct nexthop *old,
struct nexthop *new, const struct nh_config *cfg,
err = blocking_notifier_call_chain(&net->nexthop.notifier_chain,
static int insert_nexthop(struct net *net, struct nexthop *new_nh,
struct rb_root *root = &net->nexthop.rb_root;
struct nexthop *nh;
nh = rb_entry(parent, struct nexthop, rb_node);
rb_erase(&new_nh->rb_node, &net->nexthop.rb_root);
struct hlist_head *head = &net->nexthop.devhash[hash];
struct nexthop *nh;
struct rb_root *root = &net->nexthop.rb_root;
struct nexthop *nh;
nh = rb_entry(node, struct nexthop, rb_node);
static struct nexthop *nexthop_create_group(struct net *net,
struct nexthop *nh;
struct nexthop *nhe;
static int nh_create_ipv4(struct net *net, struct nexthop *nh,
static int nh_create_ipv6(struct net *net, struct nexthop *nh,
static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg,
struct nexthop *nh;
static struct nexthop *nexthop_add(struct net *net, struct nh_config *cfg,
struct nexthop *nh;
struct nexthop *nh;
struct nexthop *nh;
struct nexthop *nh;
static bool nh_dump_filtered(struct nexthop *nh,
struct nexthop *nh, void *data),
struct nexthop *nh;
nh = rb_entry(tmp, struct nexthop, rb_node);
err = blocking_notifier_call_chain(&net->nexthop.notifier_chain,
struct nexthop *nh;
nh = rb_entry(node, struct nexthop, rb_node);
struct nexthop *nh, void *data)
struct rb_root *root = &net->nexthop.rb_root;
cb->seq = net->nexthop.seq;
static struct nexthop *
struct nexthop *nh;
struct nexthop *nh,
struct nexthop *nh, void *data)
struct nexthop *nh;
struct rb_root *root = &net->nexthop.rb_root;
cb->seq = net->nexthop.seq;
struct nexthop *nh;
struct nexthop *old_nh,
struct nexthop *new_nh,
struct hlist_head *head = &net->nexthop.devhash[hash];
struct rb_root *root = &net->nexthop.rb_root;
struct nexthop *nh;
nh = rb_entry(node, struct nexthop, rb_node);
err = blocking_notifier_chain_register(&net->nexthop.notifier_chain,
err = blocking_notifier_chain_unregister(&net->nexthop.notifier_chain,
static int call_nexthop_res_table_notifiers(struct net *net, struct nexthop *nh,
struct nexthop *nexthop;
nexthop = nexthop_find_by_id(net, id);
if (!nexthop)
nexthop->nh_flags &= ~(RTNH_F_OFFLOAD | RTNH_F_TRAP);
nexthop->nh_flags |= RTNH_F_OFFLOAD;
nexthop->nh_flags |= RTNH_F_TRAP;
struct nexthop *nexthop;
nexthop = nexthop_find_by_id(net, id);
if (!nexthop || !nexthop->is_group)
nhg = rcu_dereference(nexthop->nh_grp);
struct nexthop *nexthop;
nexthop = nexthop_find_by_id(net, id);
if (!nexthop || !nexthop->is_group)
nhg = rcu_dereference(nexthop->nh_grp);
kfree(net->nexthop.devhash);
net->nexthop.devhash = NULL;
net->nexthop.rb_root = RB_ROOT;
net->nexthop.devhash = kzalloc(sz, GFP_KERNEL);
if (!net->nexthop.devhash)
BLOCKING_INIT_NOTIFIER_HEAD(&net->nexthop.notifier_chain);
err = blocking_notifier_call_chain(&net->nexthop.notifier_chain,
struct nexthop *nh,
head = &net->nexthop.devhash[hash];
static void nexthop_free_group(struct nexthop *nh)
static void nexthop_free_single(struct nexthop *nh)
struct nexthop *nh = container_of(head, struct nexthop, rcu);
static struct nexthop *nexthop_alloc(void)
struct nexthop *nh;
nh = kzalloc_obj(struct nexthop);
while (++net->nexthop.seq == 0)
struct nexthop *nexthop_find_by_id(struct net *net, u32 id)
pp = &net->nexthop.rb_root.rb_node;
struct nexthop *nh;
nh = rb_entry(parent, struct nexthop, rb_node);
u32 id_start = net->nexthop.last_id_allocated;
net->nexthop.last_id_allocated++;
if (net->nexthop.last_id_allocated == id_start)
if (!nexthop_find_by_id(net, net->nexthop.last_id_allocated))
return net->nexthop.last_id_allocated;
const struct nexthop *nh)
static void nh_grp_hw_stats_apply_update(struct nexthop *nh,
static int nh_grp_hw_stats_update(struct nexthop *nh, bool *hw_stats_used)
err = blocking_notifier_call_chain(&net->nexthop.notifier_chain,
static int nla_put_nh_group_stats(struct sk_buff *skb, struct nexthop *nh,
static int nla_put_nh_group(struct sk_buff *skb, struct nexthop *nh,
static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh,
return !net->nexthop.notifier_chain.head;
__be32 daddr, nexthop;
nexthop = daddr = usin->sin_addr.s_addr;
nexthop = inet_opt->opt.faddr;
rt = ip_route_connect(fl4, nexthop, inet->inet_saddr,
nexthop = rt6_nexthop(dst_rt6_info(dst), daddr);
neigh = __ipv6_neigh_lookup_noref(dev, nexthop);
neigh = __neigh_create(&nd_tbl, nexthop, dev, false);
const struct in6_addr *daddr, *nexthop;
struct nexthop *nh;
static struct fib6_nh *rt6_nh_dev_match(struct net *net, struct nexthop *nh,
static int rt6_fill_node_nexthop(struct sk_buff *skb, struct nexthop *nh,
if (mctp_neigh_lookup(dst->dev, dst->nexthop, daddr_buf) == 0)
dst->nexthop = eid;
dst->nexthop = 0;
KUNIT_EXPECT_EQ(test, dst.nexthop, 9);
dst.nexthop = 9;
struct nexthop *nh;