Lines Matching defs:hsh

322 hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r,
327 mtx_assert(&hsh->mtx, MA_OWNED);
391 TAILQ_INSERT_TAIL(&hsh->head, fle, fle_hash);
479 struct flow_hash_entry *hsh;
499 for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++) {
500 mtx_init(&hsh->mtx, "hash mutex", NULL, MTX_DEF);
501 TAILQ_INIT(&hsh->head);
510 for (i = 0, hsh = priv->hash6; i < NBUCKETS; i++, hsh++) {
511 mtx_init(&hsh->mtx, "hash mutex", NULL, MTX_DEF);
512 TAILQ_INIT(&hsh->head);
574 struct flow_hash_entry *hsh;
586 for (hsh = priv->hash, i = 0; i < NBUCKETS; hsh++, i++)
587 TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) {
588 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
593 for (hsh = priv->hash6, i = 0; i < NBUCKETS; hsh++, i++)
594 TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) {
595 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
603 for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++)
604 mtx_destroy(&hsh->mtx);
612 for (i = 0, hsh = priv->hash6; i < NBUCKETS; i++, hsh++)
613 mtx_destroy(&hsh->mtx);
658 struct flow_hash_entry *hsh;
717 hsh = &priv->hash[ip_hash(&r)];
719 mtx_lock(&hsh->mtx);
727 TAILQ_FOREACH_REVERSE_SAFE(fle, &hsh->head, fhead, fle_hash, fle1) {
731 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
753 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
763 if (fle != TAILQ_LAST(&hsh->head, fhead)) {
764 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
765 TAILQ_INSERT_TAIL(&hsh->head, fle, fle_hash);
769 error = hash_insert(priv, hsh, &r, plen, flags, tcp_flags);
771 mtx_unlock(&hsh->mtx);
786 struct flow_hash_entry *hsh;
836 hsh = &priv->hash6[ip6_hash(&r)];
838 mtx_lock(&hsh->mtx);
846 TAILQ_FOREACH_REVERSE_SAFE(fle, &hsh->head, fhead, fle_hash, fle1) {
853 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
876 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
886 if (fle != TAILQ_LAST(&hsh->head, fhead)) {
887 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
888 TAILQ_INSERT_TAIL(&hsh->head, fle, fle_hash);
892 error = hash6_insert(priv, hsh, &r, plen, flags, tcp_flags);
894 mtx_unlock(&hsh->mtx);
909 struct flow_hash_entry *hsh;
924 hsh = priv->hash6 + i;
930 hsh = priv->hash + i;
947 for (; i < NBUCKETS; hsh++, i++) {
950 if (mtx_trylock(&hsh->mtx) == 0) {
962 TAILQ_FOREACH(fle, &hsh->head, fle_hash) {
963 if (hsh->mtx.mtx_lock & MTX_CONTESTED) {
966 mtx_unlock(&hsh->mtx);
998 mtx_unlock(&hsh->mtx);
1002 mtx_unlock(&hsh->mtx);
1094 struct flow_hash_entry *hsh;
1102 for (hsh = priv->hash, i = 0; i < NBUCKETS; hsh++, i++) {
1106 if (mtx_trylock(&hsh->mtx) == 0)
1109 TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) {
1114 if (hsh->mtx.mtx_lock & MTX_CONTESTED)
1126 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
1133 mtx_unlock(&hsh->mtx);
1138 for (hsh = priv->hash6, i = 0; i < NBUCKETS; hsh++, i++) {
1144 if (mtx_trylock(&hsh->mtx) == 0)
1147 TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) {
1153 if (hsh->mtx.mtx_lock & MTX_CONTESTED)
1165 TAILQ_REMOVE(&hsh->head, fle, fle_hash);
1172 mtx_unlock(&hsh->mtx);