Lines Matching refs:htbl

1254 static u32 ipoib_addr_hash(struct ipoib_neigh_hash *htbl, u8 *daddr)  in ipoib_addr_hash()  argument
1267 return hv & htbl->mask; in ipoib_addr_hash()
1274 struct ipoib_neigh_hash *htbl; in ipoib_neigh_get() local
1280 htbl = rcu_dereference_bh(ntbl->htbl); in ipoib_neigh_get()
1282 if (!htbl) in ipoib_neigh_get()
1285 hash_val = ipoib_addr_hash(htbl, daddr); in ipoib_neigh_get()
1286 for (neigh = rcu_dereference_bh(htbl->buckets[hash_val]); in ipoib_neigh_get()
1311 struct ipoib_neigh_hash *htbl; in __ipoib_reap_neigh() local
1320 htbl = rcu_dereference_protected(ntbl->htbl, in __ipoib_reap_neigh()
1323 if (!htbl) in __ipoib_reap_neigh()
1330 for (i = 0; i < htbl->size; i++) { in __ipoib_reap_neigh()
1332 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; in __ipoib_reap_neigh()
1396 struct ipoib_neigh_hash *htbl; in ipoib_neigh_alloc() local
1400 htbl = rcu_dereference_protected(ntbl->htbl, in ipoib_neigh_alloc()
1402 if (!htbl) { in ipoib_neigh_alloc()
1410 hash_val = ipoib_addr_hash(htbl, daddr); in ipoib_neigh_alloc()
1411 for (neigh = rcu_dereference_protected(htbl->buckets[hash_val], in ipoib_neigh_alloc()
1437 rcu_dereference_protected(htbl->buckets[hash_val], in ipoib_neigh_alloc()
1439 rcu_assign_pointer(htbl->buckets[hash_val], neigh); in ipoib_neigh_alloc()
1485 struct ipoib_neigh_hash *htbl; in ipoib_neigh_free() local
1490 htbl = rcu_dereference_protected(ntbl->htbl, in ipoib_neigh_free()
1492 if (!htbl) in ipoib_neigh_free()
1495 hash_val = ipoib_addr_hash(htbl, neigh->daddr); in ipoib_neigh_free()
1496 np = &htbl->buckets[hash_val]; in ipoib_neigh_free()
1520 struct ipoib_neigh_hash *htbl; in ipoib_neigh_hash_init() local
1525 ntbl->htbl = NULL; in ipoib_neigh_hash_init()
1526 htbl = kzalloc(sizeof(*htbl), GFP_KERNEL); in ipoib_neigh_hash_init()
1527 if (!htbl) in ipoib_neigh_hash_init()
1532 kfree(htbl); in ipoib_neigh_hash_init()
1535 htbl->size = size; in ipoib_neigh_hash_init()
1536 htbl->mask = (size - 1); in ipoib_neigh_hash_init()
1537 htbl->buckets = buckets; in ipoib_neigh_hash_init()
1538 RCU_INIT_POINTER(ntbl->htbl, htbl); in ipoib_neigh_hash_init()
1539 htbl->ntbl = ntbl; in ipoib_neigh_hash_init()
1551 struct ipoib_neigh_hash *htbl = container_of(head, in neigh_hash_free_rcu() local
1554 struct ipoib_neigh __rcu **buckets = htbl->buckets; in neigh_hash_free_rcu()
1555 struct ipoib_neigh_table *ntbl = htbl->ntbl; in neigh_hash_free_rcu()
1558 kfree(htbl); in neigh_hash_free_rcu()
1566 struct ipoib_neigh_hash *htbl; in ipoib_del_neighs_by_gid() local
1573 htbl = rcu_dereference_protected(ntbl->htbl, in ipoib_del_neighs_by_gid()
1576 if (!htbl) in ipoib_del_neighs_by_gid()
1579 for (i = 0; i < htbl->size; i++) { in ipoib_del_neighs_by_gid()
1581 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; in ipoib_del_neighs_by_gid()
1606 struct ipoib_neigh_hash *htbl; in ipoib_flush_neighs() local
1615 htbl = rcu_dereference_protected(ntbl->htbl, in ipoib_flush_neighs()
1617 if (!htbl) in ipoib_flush_neighs()
1624 for (i = 0; i < htbl->size; i++) { in ipoib_flush_neighs()
1626 struct ipoib_neigh __rcu **np = &htbl->buckets[i]; in ipoib_flush_neighs()
1640 rcu_assign_pointer(ntbl->htbl, NULL); in ipoib_flush_neighs()
1641 call_rcu(&htbl->rcu, neigh_hash_free_rcu); in ipoib_flush_neighs()