Lines Matching refs:neigh

29 	struct mctp_neigh *neigh;  in mctp_neigh_add()  local
38 if (lladdr_len > sizeof(neigh->ha)) { in mctp_neigh_add()
43 neigh = kzalloc(sizeof(*neigh), GFP_KERNEL); in mctp_neigh_add()
44 if (!neigh) { in mctp_neigh_add()
48 INIT_LIST_HEAD(&neigh->list); in mctp_neigh_add()
49 neigh->dev = mdev; in mctp_neigh_add()
50 mctp_dev_hold(neigh->dev); in mctp_neigh_add()
51 neigh->eid = eid; in mctp_neigh_add()
52 neigh->source = source; in mctp_neigh_add()
53 memcpy(neigh->ha, lladdr, lladdr_len); in mctp_neigh_add()
55 list_add_rcu(&neigh->list, &net->mctp.neighbours); in mctp_neigh_add()
64 struct mctp_neigh *neigh = container_of(rcu, struct mctp_neigh, rcu); in __mctp_neigh_free() local
66 mctp_dev_put(neigh->dev); in __mctp_neigh_free()
67 kfree(neigh); in __mctp_neigh_free()
74 struct mctp_neigh *neigh, *tmp; in mctp_neigh_remove_dev() local
77 list_for_each_entry_safe(neigh, tmp, &net->mctp.neighbours, list) { in mctp_neigh_remove_dev()
78 if (neigh->dev == mdev) { in mctp_neigh_remove_dev()
79 list_del_rcu(&neigh->list); in mctp_neigh_remove_dev()
81 call_rcu(&neigh->rcu, __mctp_neigh_free); in mctp_neigh_remove_dev()
92 struct mctp_neigh *neigh, *tmp; in mctp_neigh_remove() local
96 list_for_each_entry_safe(neigh, tmp, &net->mctp.neighbours, list) { in mctp_neigh_remove()
97 if (neigh->dev == mdev && neigh->eid == eid && in mctp_neigh_remove()
98 neigh->source == source) { in mctp_neigh_remove()
99 list_del_rcu(&neigh->list); in mctp_neigh_remove()
101 call_rcu(&neigh->rcu, __mctp_neigh_free); in mctp_neigh_remove()
210 unsigned int flags, struct mctp_neigh *neigh) in mctp_fill_neigh() argument
212 struct net_device *dev = neigh->dev->dev; in mctp_fill_neigh()
224 if (neigh->source == MCTP_NEIGH_STATIC) in mctp_fill_neigh()
229 if (nla_put_u8(skb, NDA_DST, neigh->eid)) in mctp_fill_neigh()
232 if (nla_put(skb, NDA_LLADDR, dev->addr_len, neigh->ha)) in mctp_fill_neigh()
247 struct mctp_neigh *neigh; in mctp_rtm_getneigh() local
258 list_for_each_entry_rcu(neigh, &net->mctp.neighbours, list) { in mctp_rtm_getneigh()
263 if (req_ifindex == 0 || req_ifindex == neigh->dev->dev->ifindex) in mctp_rtm_getneigh()
266 RTM_NEWNEIGH, NLM_F_MULTI, neigh); in mctp_rtm_getneigh()
282 struct mctp_neigh *neigh; in mctp_neigh_lookup() local
286 list_for_each_entry_rcu(neigh, &net->mctp.neighbours, list) { in mctp_neigh_lookup()
287 if (mdev == neigh->dev && eid == neigh->eid) { in mctp_neigh_lookup()
289 memcpy(ret_hwaddr, neigh->ha, in mctp_neigh_lookup()
290 sizeof(neigh->ha)); in mctp_neigh_lookup()
312 struct mctp_neigh *neigh; in mctp_neigh_net_exit() local
314 list_for_each_entry(neigh, &ns->neighbours, list) in mctp_neigh_net_exit()
315 call_rcu(&neigh->rcu, __mctp_neigh_free); in mctp_neigh_net_exit()