Lines Matching full: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_safe(entry, n, &vif->hash.cache.list, link) { in xenvif_flush_hash()
108 vif->hash.cache.count--; in xenvif_flush_hash()
112 spin_unlock_irqrestore(&vif->hash.cache.lock, flags); in xenvif_flush_hash()
132 list_for_each_entry_rcu(entry, &vif->hash.cache.list, link) { in xenvif_find_hash()
136 entry->seq = atomic_inc_return(&vif->hash.cache.seq); in xenvif_find_hash()
153 u32 hash = 0; in xenvif_set_skb_hash() local
155 u32 flags = vif->hash.flags; in xenvif_set_skb_hash()
159 * correspond to any enabled hash type then there's no point in xenvif_set_skb_hash()
199 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
207 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
223 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
231 hash = xenvif_find_hash(vif, data, sizeof(data)); in xenvif_set_skb_hash()
242 __skb_set_sw_hash(skb, hash, type == PKT_HASH_TYPE_L4); in xenvif_set_skb_hash()
256 vif->hash.alg = alg; in xenvif_set_hash_alg()
263 if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE) in xenvif_get_hash_flags()
282 if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE) in xenvif_set_hash_flags()
285 vif->hash.flags = flags; in xenvif_set_hash_flags()
292 u8 *key = vif->hash.key; in xenvif_set_hash_key()
327 vif->hash.size = size; in xenvif_set_hash_mapping_size()
328 memset(vif->hash.mapping[vif->hash.mapping_sel], 0, in xenvif_set_hash_mapping_size()
337 u32 *mapping = vif->hash.mapping[!vif->hash.mapping_sel]; in xenvif_set_hash_mapping()
347 if ((off + len < off) || (off + len > vif->hash.size) || in xenvif_set_hash_mapping()
363 memcpy(mapping, vif->hash.mapping[vif->hash.mapping_sel], in xenvif_set_hash_mapping()
364 vif->hash.size * sizeof(*mapping)); in xenvif_set_hash_mapping()
378 vif->hash.mapping_sel = !vif->hash.mapping_sel; in xenvif_set_hash_mapping()
388 switch (vif->hash.alg) { in xenvif_dump_hash_info()
390 seq_puts(m, "Hash Algorithm: TOEPLITZ\n"); in xenvif_dump_hash_info()
394 seq_puts(m, "Hash Algorithm: NONE\n"); in xenvif_dump_hash_info()
400 if (vif->hash.flags) { in xenvif_dump_hash_info()
403 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV4) in xenvif_dump_hash_info()
405 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV4_TCP) in xenvif_dump_hash_info()
407 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV6) in xenvif_dump_hash_info()
409 if (vif->hash.flags & XEN_NETIF_CTRL_HASH_TYPE_IPV6_TCP) in xenvif_dump_hash_info()
425 seq_printf(m, "%02x ", vif->hash.key[i]); in xenvif_dump_hash_info()
430 if (vif->hash.size != 0) { in xenvif_dump_hash_info()
431 const u32 *mapping = vif->hash.mapping[vif->hash.mapping_sel]; in xenvif_dump_hash_info()
435 for (i = 0; i < vif->hash.size; ) { in xenvif_dump_hash_info()
439 if (i + n >= vif->hash.size) in xenvif_dump_hash_info()
440 n = vif->hash.size - i; in xenvif_dump_hash_info()
458 BUG_ON(vif->hash.cache.count); in xenvif_init_hash()
460 spin_lock_init(&vif->hash.cache.lock); in xenvif_init_hash()
461 INIT_LIST_HEAD(&vif->hash.cache.list); in xenvif_init_hash()