Lines Matching refs:neigh_node
65 void neigh_node_free_ref(struct neigh_node *neigh_node) in neigh_node_free_ref() argument
67 if (atomic_dec_and_test(&neigh_node->refcount)) in neigh_node_free_ref()
68 kfree_rcu(neigh_node, rcu); in neigh_node_free_ref()
72 struct neigh_node *orig_node_get_router(struct orig_node *orig_node) in orig_node_get_router()
74 struct neigh_node *router; in orig_node_get_router()
86 struct neigh_node *create_neighbor(struct orig_node *orig_node, in create_neighbor()
92 struct neigh_node *neigh_node; in create_neighbor() local
97 neigh_node = kzalloc(sizeof(*neigh_node), GFP_ATOMIC); in create_neighbor()
98 if (!neigh_node) in create_neighbor()
101 INIT_HLIST_NODE(&neigh_node->list); in create_neighbor()
102 INIT_LIST_HEAD(&neigh_node->bonding_list); in create_neighbor()
103 spin_lock_init(&neigh_node->tq_lock); in create_neighbor()
105 memcpy(neigh_node->addr, neigh, ETH_ALEN); in create_neighbor()
106 neigh_node->orig_node = orig_neigh_node; in create_neighbor()
107 neigh_node->if_incoming = if_incoming; in create_neighbor()
110 atomic_set(&neigh_node->refcount, 2); in create_neighbor()
113 hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list); in create_neighbor()
115 return neigh_node; in create_neighbor()
121 struct neigh_node *neigh_node, *tmp_neigh_node; in orig_node_free_rcu() local
129 list_for_each_entry_safe(neigh_node, tmp_neigh_node, in orig_node_free_rcu()
131 list_del_rcu(&neigh_node->bonding_list); in orig_node_free_rcu()
132 neigh_node_free_ref(neigh_node); in orig_node_free_rcu()
136 hlist_for_each_entry_safe(neigh_node, node, node_tmp, in orig_node_free_rcu()
138 hlist_del_rcu(&neigh_node->list); in orig_node_free_rcu()
139 neigh_node_free_ref(neigh_node); in orig_node_free_rcu()
271 struct neigh_node **best_neigh_node) in purge_orig_neighbors()
274 struct neigh_node *neigh_node; in purge_orig_neighbors() local
282 hlist_for_each_entry_safe(neigh_node, node, node_tmp, in purge_orig_neighbors()
285 if ((has_timed_out(neigh_node->last_valid, PURGE_TIMEOUT)) || in purge_orig_neighbors()
286 (neigh_node->if_incoming->if_status == IF_INACTIVE) || in purge_orig_neighbors()
287 (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) || in purge_orig_neighbors()
288 (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) { in purge_orig_neighbors()
290 if ((neigh_node->if_incoming->if_status == in purge_orig_neighbors()
292 (neigh_node->if_incoming->if_status == in purge_orig_neighbors()
294 (neigh_node->if_incoming->if_status == in purge_orig_neighbors()
298 orig_node->orig, neigh_node->addr, in purge_orig_neighbors()
299 neigh_node->if_incoming->net_dev->name); in purge_orig_neighbors()
303 orig_node->orig, neigh_node->addr, in purge_orig_neighbors()
304 (neigh_node->last_valid / HZ)); in purge_orig_neighbors()
308 hlist_del_rcu(&neigh_node->list); in purge_orig_neighbors()
309 bonding_candidate_del(orig_node, neigh_node); in purge_orig_neighbors()
310 neigh_node_free_ref(neigh_node); in purge_orig_neighbors()
313 (neigh_node->tq_avg > (*best_neigh_node)->tq_avg)) in purge_orig_neighbors()
314 *best_neigh_node = neigh_node; in purge_orig_neighbors()
325 struct neigh_node *best_neigh_node; in purge_orig_node()
407 struct neigh_node *neigh_node, *neigh_node_tmp; in orig_seq_print_text() local
442 neigh_node = orig_node_get_router(orig_node); in orig_seq_print_text()
443 if (!neigh_node) in orig_seq_print_text()
446 if (neigh_node->tq_avg == 0) in orig_seq_print_text()
456 last_seen_msecs, neigh_node->tq_avg, in orig_seq_print_text()
457 neigh_node->addr, in orig_seq_print_text()
458 neigh_node->if_incoming->net_dev->name); in orig_seq_print_text()
471 neigh_node_free_ref(neigh_node); in orig_seq_print_text()