Lines Matching refs:ce

138 	struct clip_entry *ce;  in alloc_clip_entry()  local
142 ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT | M_ZERO); in alloc_clip_entry()
143 if (__predict_true(ce != NULL)) { in alloc_clip_entry()
144 ce->cde = cde; in alloc_clip_entry()
146 ce->clip_idx = -1; in alloc_clip_entry()
149 return (ce); in alloc_clip_entry()
187 struct clip_entry *ce; in lookup_clip_entry() local
196 LIST_FOREACH(ce, &sc->clip_table[bucket], link) { in lookup_clip_entry()
197 if (ce->cde == cde) in lookup_clip_entry()
198 return (ce); in lookup_clip_entry()
203 ce = alloc_clip_entry(cde); in lookup_clip_entry()
204 if (ce != NULL) { in lookup_clip_entry()
205 LIST_INSERT_HEAD(&sc->clip_table[bucket], ce, link); in lookup_clip_entry()
206 TAILQ_INSERT_TAIL(&sc->clip_pending, ce, plink); in lookup_clip_entry()
207 ce->pending = true; in lookup_clip_entry()
211 return (ce); in lookup_clip_entry()
257 struct clip_entry *ce; in t4_get_clip_entry() local
261 ce = lookup_clip_entry(sc, in6, add); in t4_get_clip_entry()
262 if (ce != NULL) { in t4_get_clip_entry()
263 MPASS(ce->cde->adp_ref > 0); in t4_get_clip_entry()
264 if (++ce->refcount == 1 && ce->pending && ce->clip_idx != -1) { in t4_get_clip_entry()
269 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in t4_get_clip_entry()
270 ce->pending = false; in t4_get_clip_entry()
272 if (ce->clip_idx == -1 && update_hw_clip_table(sc) != 0) in t4_get_clip_entry()
279 return (ce); in t4_get_clip_entry()
286 t4_hold_clip_entry(struct adapter *sc, struct clip_entry *ce) in t4_hold_clip_entry() argument
289 MPASS(ce != NULL); in t4_hold_clip_entry()
290 MPASS(ce->cde->adp_ref > 0); in t4_hold_clip_entry()
293 MPASS(ce->refcount > 0); /* Caller should already have a reference */ in t4_hold_clip_entry()
294 ce->refcount++; in t4_hold_clip_entry()
301 release_clip_entry_locked(struct adapter *sc, struct clip_entry *ce) in release_clip_entry_locked() argument
306 MPASS(ce->refcount > 0); in release_clip_entry_locked()
307 cde = ce->cde; in release_clip_entry_locked()
309 if (--ce->refcount == 0 && cde->krn_ref == 0) { in release_clip_entry_locked()
310 if (ce->clip_idx == -1) { in release_clip_entry_locked()
312 MPASS(ce->pending); in release_clip_entry_locked()
313 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in release_clip_entry_locked()
314 LIST_REMOVE(ce, link); in release_clip_entry_locked()
315 free(ce, M_CXGBE); in release_clip_entry_locked()
326 MPASS(!ce->pending); in release_clip_entry_locked()
327 TAILQ_INSERT_HEAD(&sc->clip_pending, ce, plink); in release_clip_entry_locked()
328 ce->pending = true; in release_clip_entry_locked()
335 t4_release_clip_entry(struct adapter *sc, struct clip_entry *ce) in t4_release_clip_entry() argument
338 MPASS(ce != NULL); in t4_release_clip_entry()
341 release_clip_entry_locked(sc, ce); in t4_release_clip_entry()
356 struct clip_entry *ce; in t4_release_clip_addr() local
360 ce = lookup_clip_entry(sc, in6, false); in t4_release_clip_addr()
361 if (ce == NULL) in t4_release_clip_addr()
363 else if (ce->refcount == 0) in t4_release_clip_addr()
366 release_clip_entry_locked(sc, ce); in t4_release_clip_addr()
483 struct clip_entry *ce, *ce_temp; in update_sw_clip_table() local
501 LIST_FOREACH_SAFE(ce, &sc->clip_table[i], link, ce_temp) { in update_sw_clip_table()
502 cde = ce->cde; in update_sw_clip_table()
504 if (ce->refcount != 0 || cde->krn_ref != 0) { in update_sw_clip_table()
509 if (ce->clip_idx != -1) { in update_sw_clip_table()
510 ce->pending = false; in update_sw_clip_table()
513 MPASS(ce->pending); in update_sw_clip_table()
514 TAILQ_INSERT_TAIL(&sc->clip_pending, ce, in update_sw_clip_table()
524 if (ce->clip_idx != -1) { in update_sw_clip_table()
525 ce->pending = true; in update_sw_clip_table()
526 TAILQ_INSERT_HEAD(&sc->clip_pending, ce, plink); in update_sw_clip_table()
529 MPASS(ce->pending); in update_sw_clip_table()
530 LIST_REMOVE(ce, link); in update_sw_clip_table()
531 free(ce, M_CXGBE); in update_sw_clip_table()
546 LIST_FOREACH(ce, &sc->clip_table[i], link) { in update_sw_clip_table()
547 if (ce->cde == cde) { in update_sw_clip_table()
554 ce = alloc_clip_entry(cde); in update_sw_clip_table()
555 if (ce == NULL) in update_sw_clip_table()
557 LIST_INSERT_HEAD(&sc->clip_table[i], ce, link); in update_sw_clip_table()
558 TAILQ_INSERT_TAIL(&sc->clip_pending, ce, plink); in update_sw_clip_table()
559 ce->pending = true; in update_sw_clip_table()
571 struct clip_entry *ce; in update_hw_clip_table() local
582 ce = TAILQ_FIRST(&sc->clip_pending); in update_hw_clip_table()
583 MPASS(ce->pending); in update_hw_clip_table()
584 cde = ce->cde; in update_hw_clip_table()
587 if (ce->clip_idx == -1) { in update_hw_clip_table()
592 if (ce->refcount == 0 && cde->krn_ref == 0) { in update_hw_clip_table()
594 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in update_hw_clip_table()
595 LIST_REMOVE(ce, link); in update_hw_clip_table()
596 free(ce, M_CXGBE); in update_hw_clip_table()
603 rc = add_lip(sc, &cde->lip, &ce->clip_idx); in update_hw_clip_table()
616 MPASS(ce->clip_idx != -1); in update_hw_clip_table()
617 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in update_hw_clip_table()
618 ce->pending = false; in update_hw_clip_table()
625 if (ce->refcount == 0 && cde->krn_ref == 0) { in update_hw_clip_table()
641 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in update_hw_clip_table()
642 LIST_REMOVE(ce, link); in update_hw_clip_table()
643 free(ce, M_CXGBE); in update_hw_clip_table()
650 TAILQ_REMOVE(&sc->clip_pending, ce, plink); in update_hw_clip_table()
651 ce->pending = false; in update_hw_clip_table()
692 struct clip_entry *ce, *ce_temp; in t4_destroy_clip_table() local
699 LIST_FOREACH_SAFE(ce, &sc->clip_table[i], link, ce_temp) { in t4_destroy_clip_table()
700 MPASS(ce->refcount == 0); in t4_destroy_clip_table()
701 MPASS(ce->cde->adp_ref > 0); in t4_destroy_clip_table()
703 del_lip(sc, &ce->lip); in t4_destroy_clip_table()
705 LIST_REMOVE(ce, link); in t4_destroy_clip_table()
706 if (--ce->cde->adp_ref == 0 && ce->cde->krn_ref == 0) { in t4_destroy_clip_table()
707 LIST_REMOVE(ce->cde, link); in t4_destroy_clip_table()
708 free(ce->cde, M_CXGBE); in t4_destroy_clip_table()
710 free(ce, M_CXGBE); in t4_destroy_clip_table()
742 struct clip_entry *ce; in sysctl_clip() local
757 LIST_FOREACH(ce, &sc->clip_table[i], link) { in sysctl_clip()
763 inet_ntop(AF_INET6, &ce->cde->lip, &ip[0], sizeof(ip)); in sysctl_clip()
764 if (ce->clip_idx == -1) { in sysctl_clip()
766 ce->refcount, ip); in sysctl_clip()
768 sbuf_printf(sb, "\n%-4d %-4d %s", ce->clip_idx, in sysctl_clip()
769 ce->refcount, ip); in sysctl_clip()