Lines Matching refs:ila
10 #include "ila.h"
54 static inline int ila_cmp_wildcards(struct ila_map *ila,
57 return (ila->xp.ifindex && ila->xp.ifindex != ifindex);
60 static inline int ila_cmp_params(struct ila_map *ila,
63 return (ila->xp.ifindex != xp->ifindex);
69 const struct ila_map *ila = obj;
71 return (ila->xp.ip.locator_match.v64 != *(__be64 *)arg->key);
74 static inline int ila_order(struct ila_map *ila)
78 if (ila->xp.ifindex)
130 struct ila_map *ila;
132 ila = rhashtable_lookup_fast(&ilan->xlat.rhash_table, &iaddr->loc,
134 while (ila) {
135 if (!ila_cmp_wildcards(ila, iaddr, ifindex))
136 return ila;
137 ila = rcu_access_pointer(ila->next);
147 struct ila_map *ila;
149 ila = rhashtable_lookup_fast(&ilan->xlat.rhash_table,
152 while (ila) {
153 if (!ila_cmp_params(ila, xp))
154 return ila;
155 ila = rcu_access_pointer(ila->next);
161 static inline void ila_release(struct ila_map *ila)
163 kfree_rcu(ila, rcu);
166 static void ila_free_node(struct ila_map *ila)
171 while (ila) {
172 next = rcu_access_pointer(ila->next);
173 ila_release(ila);
174 ila = next;
206 struct ila_map *ila, *head;
222 ila = kzalloc(sizeof(*ila), GFP_KERNEL);
223 if (!ila)
228 ila->xp = *xp;
230 order = ila_order(ila);
240 &ila->node, rht_params);
260 RCU_INIT_POINTER(ila->next, tila);
261 rcu_assign_pointer(prev->next, ila);
263 /* Make this ila new head */
264 RCU_INIT_POINTER(ila->next, head);
267 &ila->node, rht_params);
277 kfree(ila);
285 struct ila_map *ila, *head, *prev;
293 ila = head;
297 while (ila) {
298 if (ila_cmp_params(ila, xp)) {
299 prev = ila;
300 ila = rcu_dereference_protected(ila->next,
309 rcu_assign_pointer(prev->next, ila->next);
314 head = rcu_dereference_protected(ila->next,
321 &ilan->xlat.rhash_table, &ila->node,
329 &ila->node, rht_params);
333 ila_release(ila);
373 struct ila_map *ila)
375 return ila_get_lock(ilan, ila->xp.ip.locator_match);
383 struct ila_map *ila;
391 ila = rhashtable_walk_next(&iter);
393 if (IS_ERR(ila)) {
394 if (PTR_ERR(ila) == -EAGAIN)
396 ret = PTR_ERR(ila);
398 } else if (!ila) {
402 lock = lock_from_ila_map(ilan, ila);
407 &ila->node, rht_params);
409 ila_free_node(ila);
423 static int ila_fill_info(struct ila_map *ila, struct sk_buff *msg)
426 (__force u64)ila->xp.ip.locator.v64,
429 (__force u64)ila->xp.ip.locator_match.v64,
431 nla_put_s32(msg, ILA_ATTR_IFINDEX, ila->xp.ifindex) ||
432 nla_put_u8(msg, ILA_ATTR_CSUM_MODE, ila->xp.ip.csum_mode) ||
433 nla_put_u8(msg, ILA_ATTR_IDENT_TYPE, ila->xp.ip.ident_type))
439 static int ila_dump_info(struct ila_map *ila,
449 if (ila_fill_info(ila, skb) < 0)
466 struct ila_map *ila;
480 ila = ila_lookup_by_params(&xp, ilan);
481 if (ila) {
482 ret = ila_dump_info(ila,
539 struct ila_map *ila;
545 ila = rhashtable_walk_peek(rhiter);
547 if (ila && !IS_ERR(ila) && skip) {
550 while (ila && skip) {
551 /* Skip over any ila entries in this list that we
554 ila = rcu_access_pointer(ila->next);
562 if (IS_ERR(ila)) {
563 ret = PTR_ERR(ila);
575 } else if (!ila) {
580 while (ila) {
581 ret = ila_dump_info(ila, NETLINK_CB(cb->skb).portid,
588 ila = rcu_access_pointer(ila->next);
592 ila = rhashtable_walk_next(rhiter);
637 struct ila_map *ila;
652 ila = ila_lookup_wildcards(iaddr, skb->dev->ifindex, ilan);
653 if (ila)
654 ila_update_ipv6_locator(skb, &ila->xp.ip, sir2ila);