Lines Matching refs:hash
50 spin_lock_irqsave(&vif->hash.cache.lock, flags); in xenvif_add_hash()
54 list_for_each_entry_rcu(entry, &vif->hash.cache.list, link, in xenvif_add_hash()
55 lockdep_is_held(&vif->hash.cache.lock)) { in xenvif_add_hash()
65 new->seq = atomic_inc_return(&vif->hash.cache.seq); in xenvif_add_hash()
66 list_add_rcu(&new->link, &vif->hash.cache.list); in xenvif_add_hash()
68 if (++vif->hash.cache.count > xenvif_hash_cache_size) { in xenvif_add_hash()
70 vif->hash.cache.count--; in xenvif_add_hash()
75 spin_unlock_irqrestore(&vif->hash.cache.lock, flags); in xenvif_add_hash()
86 val = xen_netif_toeplitz_hash(vif->hash.key, in xenvif_new_hash()
87 sizeof(vif->hash.key), in xenvif_new_hash()
104 spin_lock_irqsave(&vif->hash.cache.lock, flags); in xenvif_flush_hash()
106 list_for_each_entry_rcu(entry, &vif->hash.cache.list, link, in xenvif_flush_hash()
107 lockdep_is_held(&vif->hash.cache.lock)) { in xenvif_flush_hash()
109 vif->hash.cache.count--; in xenvif_flush_hash()
113 spin_unlock_irqrestore(&vif->hash.cache.lock, flags); in xenvif_flush_hash()
133 list_for_each_entry_rcu(entry, &vif->hash.cache.list, link) { in xenvif_find_hash()
137 entry->seq = atomic_inc_return(&vif->hash.cache.seq); in xenvif_find_hash()
154 u32 hash = 0; in xenvif_set_skb_hash() local
156 u32 flags = vif->hash.flags; in xenvif_set_skb_hash()
200 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
208 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
224 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
232 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
243 __skb_set_sw_hash(skb, hash, type == PKT_HASH_TYPE_L4); in xenvif_set_skb_hash()
257 vif->hash.alg = alg; in xenvif_set_hash_alg()
264 if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE) in xenvif_get_hash_flags()
283 if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE) in xenvif_set_hash_flags()
286 vif->hash.flags = flags; in xenvif_set_hash_flags()
293 u8 *key = vif->hash.key; in xenvif_set_hash_key()
328 vif->hash.size = size; in xenvif_set_hash_mapping_size()
329 memset(vif->hash.mapping[vif->hash.mapping_sel], 0, in xenvif_set_hash_mapping_size()
338 u32 *mapping = vif->hash.mapping[!vif->hash.mapping_sel]; in xenvif_set_hash_mapping()
348 if ((off + len < off) || (off + len > vif->hash.size) || in xenvif_set_hash_mapping()
364 memcpy(mapping, vif->hash.mapping[vif->hash.mapping_sel], in xenvif_set_hash_mapping()
365 vif->hash.size * sizeof(*mapping)); in xenvif_set_hash_mapping()
379 vif->hash.mapping_sel = !vif->hash.mapping_sel; in xenvif_set_hash_mapping()
389 switch (vif->hash.alg) { in xenvif_dump_hash_info()
401 if (vif->hash.flags) { in xenvif_dump_hash_info()
404 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV4) in xenvif_dump_hash_info()
406 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV4_TCP) in xenvif_dump_hash_info()
408 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV6) in xenvif_dump_hash_info()
410 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV6_TCP) in xenvif_dump_hash_info()
426 seq_printf(m, "%02x ", vif->hash.key[i]); in xenvif_dump_hash_info()
431 if (vif->hash.size != 0) { in xenvif_dump_hash_info()
432 const u32 *mapping = vif->hash.mapping[vif->hash.mapping_sel]; in xenvif_dump_hash_info()
436 for (i = 0; i < vif->hash.size; ) { in xenvif_dump_hash_info()
440 if (i + n >= vif->hash.size) in xenvif_dump_hash_info()
441 n = vif->hash.size - i; in xenvif_dump_hash_info()
459 BUG_ON(vif->hash.cache.count); in xenvif_init_hash()
461 spin_lock_init(&vif->hash.cache.lock); in xenvif_init_hash()
462 INIT_LIST_HEAD(&vif->hash.cache.list); in xenvif_init_hash()