Lines Matching refs:ila
8 #include <net/ila.h>
11 #include "ila.h"
55 static inline int ila_cmp_wildcards(struct ila_map *ila,
58 return (ila->xp.ifindex && ila->xp.ifindex != ifindex);
61 static inline int ila_cmp_params(struct ila_map *ila,
64 return (ila->xp.ifindex != xp->ifindex);
70 const struct ila_map *ila = obj;
72 return (ila->xp.ip.locator_match.v64 != *(__be64 *)arg->key);
75 static inline int ila_order(struct ila_map *ila)
79 if (ila->xp.ifindex)
131 struct ila_map *ila;
133 ila = rhashtable_lookup_fast(&ilan->xlat.rhash_table, &iaddr->loc,
135 while (ila) {
136 if (!ila_cmp_wildcards(ila, iaddr, ifindex))
137 return ila;
138 ila = rcu_access_pointer(ila->next);
148 struct ila_map *ila;
150 ila = rhashtable_lookup_fast(&ilan->xlat.rhash_table,
153 while (ila) {
154 if (!ila_cmp_params(ila, xp))
155 return ila;
156 ila = rcu_access_pointer(ila->next);
162 static inline void ila_release(struct ila_map *ila)
164 kfree_rcu(ila, rcu);
167 static void ila_free_node(struct ila_map *ila)
172 while (ila) {
173 next = rcu_access_pointer(ila->next);
174 ila_release(ila);
175 ila = next;
207 struct ila_map *ila, *head;
223 ila = kzalloc(sizeof(*ila), GFP_KERNEL);
224 if (!ila)
229 ila->xp = *xp;
231 order = ila_order(ila);
241 &ila->node, rht_params);
261 RCU_INIT_POINTER(ila->next, tila);
262 rcu_assign_pointer(prev->next, ila);
264 /* Make this ila new head */
265 RCU_INIT_POINTER(ila->next, head);
268 &ila->node, rht_params);
278 kfree(ila);
286 struct ila_map *ila, *head, *prev;
294 ila = head;
298 while (ila) {
299 if (ila_cmp_params(ila, xp)) {
300 prev = ila;
301 ila = rcu_dereference_protected(ila->next,
310 rcu_assign_pointer(prev->next, ila->next);
315 head = rcu_dereference_protected(ila->next,
322 &ilan->xlat.rhash_table, &ila->node,
330 &ila->node, rht_params);
334 ila_release(ila);
374 struct ila_map *ila)
376 return ila_get_lock(ilan, ila->xp.ip.locator_match);
384 struct ila_map *ila;
392 ila = rhashtable_walk_next(&iter);
394 if (IS_ERR(ila)) {
395 if (PTR_ERR(ila) == -EAGAIN)
397 ret = PTR_ERR(ila);
399 } else if (!ila) {
403 lock = lock_from_ila_map(ilan, ila);
408 &ila->node, rht_params);
410 ila_free_node(ila);
424 static int ila_fill_info(struct ila_map *ila, struct sk_buff *msg)
427 (__force u64)ila->xp.ip.locator.v64,
430 (__force u64)ila->xp.ip.locator_match.v64,
432 nla_put_s32(msg, ILA_ATTR_IFINDEX, ila->xp.ifindex) ||
433 nla_put_u8(msg, ILA_ATTR_CSUM_MODE, ila->xp.ip.csum_mode) ||
434 nla_put_u8(msg, ILA_ATTR_IDENT_TYPE, ila->xp.ip.ident_type))
440 static int ila_dump_info(struct ila_map *ila,
450 if (ila_fill_info(ila, skb) < 0)
467 struct ila_map *ila;
481 ila = ila_lookup_by_params(&xp, ilan);
482 if (ila) {
483 ret = ila_dump_info(ila,
540 struct ila_map *ila;
546 ila = rhashtable_walk_peek(rhiter);
548 if (ila && !IS_ERR(ila) && skip) {
551 while (ila && skip) {
552 /* Skip over any ila entries in this list that we
555 ila = rcu_access_pointer(ila->next);
563 if (IS_ERR(ila)) {
564 ret = PTR_ERR(ila);
576 } else if (!ila) {
581 while (ila) {
582 ret = ila_dump_info(ila, NETLINK_CB(cb->skb).portid,
589 ila = rcu_access_pointer(ila->next);
593 ila = rhashtable_walk_next(rhiter);
634 struct ila_map *ila;
649 ila = ila_lookup_wildcards(iaddr, skb->dev->ifindex, ilan);
650 if (ila)
651 ila_update_ipv6_locator(skb, &ila->xp.ip, sir2ila);