Lines Matching defs:nce

225 	nce_t		*nce;
231 &nce);
235 *newnce = nce;
241 * triggers fastpath (if appropriate) and DAD on the newly added nce entry
245 nce_add_v6_postprocess(nce_t *nce)
247 ncec_t *ncec = nce->nce_common;
268 nce_fastpath_trigger(nce);
331 nce_t *nce, *upper_nce = NULL;
354 nce = nce_lookup_addr(ill, addr);
355 if (nce == NULL) {
357 &nce);
363 err = nce_add_v6_postprocess(nce);
364 if (in_ill != ill && nce != NULL) {
374 DTRACE_PROBE2(ill__not__in__group, nce_t *, nce,
378 nce_refrele(nce);
379 nce = NULL;
382 under_nce = nce_fastpath_create(in_ill, nce->nce_common);
386 nce_refrele(nce);
387 nce = NULL;
391 upper_nce = nce;
392 nce = under_nce; /* will be returned to caller */
393 if (NCE_ISREACHABLE(nce->nce_common))
397 if (nce != NULL) {
399 *newnce = nce;
401 nce_refrele(nce);
778 nce_t *nce;
784 nce = nce_lookup_addr(ill, &addr6);
786 return (nce);
797 nce_t *nce;
801 nce = nce_lookup_addr(ill, addr6);
803 return (nce);
809 nce_t *nce;
819 nce = nce_lookup(ill, addr);
821 return (nce);
866 nce_t *nce;
891 nce = nce_fastpath(ncec, B_TRUE, NULL);
893 if (nce != NULL)
894 nce_refrele(nce);
1015 nce_t *nce;
1022 nce = nce_lookup_addr(ill, dst);
1023 if (nce != NULL) {
1046 ND_UNCHANGED, &nce);
1049 err = nce_add_v6_postprocess(nce);
1057 ASSERT(nce->nce_common->ncec_state == ND_REACHABLE);
1059 *newnce = nce;
1061 nce_refrele(nce);
2422 * since the nce is REACHABLE,
2682 nce_t *nce = NULL;
2741 nce = nce_fastpath(ncec, B_TRUE, NULL);
2742 if (nce != NULL)
2743 nce_refrele(nce);
2868 nce_t *nce;
2907 nce = nce_lookup(ill, &ncec->ncec_addr);
2910 if (nce == NULL) {
2918 ip_drop_output("ipIfStatsOutDiscards - no nce",
2928 (void) ip_xmit(mp, nce, ixaflags, pkt_len, 0,
2930 nce_refrele(nce);
2949 nce_t *nce;
2967 nce = nce_lookup_addr(ill, addr);
2968 if (nce != NULL)
2969 new_flags = nce->nce_common->ncec_flags;
2980 if (nce != NULL)
2981 nce_refrele(nce);
2996 if (nce != NULL)
2997 nce_refrele(nce);
3001 if (nce == NULL) {
3008 &nce);
3017 ncec = nce->nce_common;
3023 err = nce_add_v6_postprocess(nce);
3024 nce_refrele(nce);
3030 err = nce_add_v6_postprocess(nce);
3047 nce_refrele(nce);
3060 nce_t *nce;
3062 nce = nce_ill_lookup_then_add(ill, ncec);
3064 if (nce == NULL || IS_LOOPBACK(nce->nce_ill) || IS_VNI(nce->nce_ill))
3065 return (nce);
3076 bcopy(ncec->ncec_lladdr, nce->nce_dlur_mp->b_rptr +
3079 nce->nce_dlur_mp = ill_dlur_gen(NULL, 0, ill->ill_sap,
3083 return (nce);
3090 * no need to hold the nce or ncec beyond this function.
3093 * ncec_nce must correspond to the nce for ncec with nce_ill == ncec->ncec_ill
3097 * nce_refrele of the returned nce (when it is non-null).
3102 nce_t *nce;
3113 * If the caller already has the nce corresponding to the ill, use
3114 * that one. Otherwise we have to lookup/add the nce. Calls from
3116 * the nce lookup/add that can be reused.
3119 nce = nce_fastpath_create(ill, ncec);
3121 nce = ncec_nce;
3123 if (nce == NULL || IS_LOOPBACK(nce->nce_ill) || IS_VNI(nce->nce_ill))
3124 return (nce);
3127 nce_fastpath_trigger(nce);
3128 return (nce);
3132 * Trigger fastpath on nce. No locks may be held.
3135 nce_fastpath_trigger(nce_t *nce)
3138 ill_t *ill = nce->nce_ill;
3139 ncec_t *ncec = nce->nce_common;
3141 res = ill_fastpath_probe(ill, nce->nce_dlur_mp);
3154 * Add ncec to the nce fastpath list on ill.
3159 nce_t *nce = NULL;
3174 nce = nce_lookup(ill, &ncec->ncec_addr);
3175 if (nce != NULL)
3177 nce = nce_add(ill, ncec);
3181 return (nce);
3187 nce_t *nce;
3190 nce = nce_ill_lookup_then_add_locked(ill, ncec);
3192 return (nce);
3198 * nce is added to the 'dead' list, and the caller must nce_refrele() the
3204 nce_t *nce;
3214 for (nce = list_head(&ill->ill_nce); nce != NULL;
3215 nce = list_next(&ill->ill_nce, nce)) {
3216 if (nce->nce_common == ncec) {
3217 nce_refhold(nce);
3218 nce_delete(nce);
3223 if (nce != NULL) {
3225 nce_refrele(nce);
3227 list_insert_tail(dead, nce);
3234 * add the nce to retrigger fastpath based on the information
3238 nce_delete_then_add(nce_t *nce)
3240 ill_t *ill = nce->nce_ill;
3243 ip0dbg(("nce_delete_then_add nce %p ill %s\n",
3244 (void *)nce, ill->ill_name));
3246 mutex_enter(&nce->nce_common->ncec_lock);
3247 nce_delete(nce);
3253 if (!NCE_ISCONDEMNED(nce->nce_common))
3254 newnce = nce_add(ill, nce->nce_common);
3255 mutex_exit(&nce->nce_common->ncec_lock);
3257 nce_refrele(nce);
3268 nce_fastpath_match_dlur(ill_t *ill, nce_t *nce, void *arg)
3271 ncec_t *ncec = nce->nce_common;
3274 mblk_t *ud_mp = nce->nce_dlur_mp;
3281 * fastpath ack is used to update the nce.
3301 nce_fp_marg->nce_fp_match_res = nce;
3303 nce_refhold(nce);
3321 nce_t *nce;
3329 if ((nce = nce_fp_marg.nce_fp_match_res) == NULL)
3332 mutex_enter(&nce->nce_lock);
3333 nce_fp_mp = nce->nce_fp_mp;
3339 mutex_exit(&nce->nce_lock);
3340 nce = nce_delete_then_add(nce);
3341 if (nce == NULL) {
3344 mutex_enter(&nce->nce_lock);
3345 nce_fp_mp = nce->nce_fp_mp;
3352 nce->nce_fp_mp = fp_mp;
3356 nce->nce_fp_mp->b_wptr = nce->nce_fp_mp->b_rptr
3359 mutex_exit(&nce->nce_lock);
3360 nce_refrele(nce);
3564 * nce on the ipmp_ill. Two nce_t entries (one on the ipmp_ill, and
3575 nce_t *nce, *upper_nce = NULL;
3619 nce = nce_lookup_addr(ill, &addr6);
3620 if (nce == NULL) {
3622 state, &nce);
3628 err = nce_add_v4_postprocess(nce);
3630 if (in_ill != ill && nce != NULL) {
3640 DTRACE_PROBE2(ill__not__in__group, nce_t *, nce,
3644 nce_refrele(nce);
3645 nce = NULL;
3648 under_nce = nce_fastpath_create(in_ill, nce->nce_common);
3652 nce_refrele(nce);
3653 nce = NULL;
3657 upper_nce = nce;
3658 nce = under_nce; /* will be returned to caller */
3659 if (NCE_ISREACHABLE(nce->nce_common))
3662 if (nce != NULL) {
3664 *newnce = nce;
3666 nce_refrele(nce);
3699 nce_t *nce;
3707 &nce);
3709 *newnce = nce;
3715 * triggers fastpath (if appropriate) and DAD on the newly added nce entry
3722 nce_add_v4_postprocess(nce_t *nce)
3724 ncec_t *ncec = nce->nce_common;
3744 nce_fastpath_trigger(nce);
3935 nce_t *nce;
3941 if ((nce = nce_lookup_addr(ill, &dst6)) != NULL) {
3968 ND_UNCHANGED, &nce);
3971 err = nce_add_v4_postprocess(nce);
3980 *newnce = nce;
3982 nce_refrele(nce);
4004 ncec_reschedule(ill_t *ill, nce_t *nce, void *arg)
4010 ncec_t *ncec = nce->nce_common;
4158 * After all the locks have been dropped we can restart nce timer,
4331 nce_t *nce;
4339 nce = nce_lookup_v4(ill, addr);
4340 if (nce != NULL) {
4341 ncec = nce->nce_common;
4350 nce_refrele(nce);
4377 * nce_add_common() will determine the state of the created nce based
4378 * on the ill_net_type and nce_flags used. Otherwise, the nce will
4394 nce_t *nce = NULL;
4425 * The caller has ensured that there is no nce on ill, but there could
4461 if (*retnce != NULL) /* caller must trigger fastpath on nce */
4631 * and adding the nce.
4633 nce = kmem_cache_alloc(nce_cache, KM_NOSLEEP);
4634 if (nce == NULL) {
4669 * before we add the nce.
4683 * condemned, and we can safely add the nce.
4685 *retnce = nce_add_impl(ill, ncec, nce, dlur_mp);
4695 if (nce != NULL)
4696 kmem_cache_free(nce_cache, nce);
4704 * take a ref on the nce
4707 nce_refhold(nce_t *nce)
4709 mutex_enter(&nce->nce_lock);
4710 nce->nce_refcnt++;
4711 ASSERT((nce)->nce_refcnt != 0);
4712 mutex_exit(&nce->nce_lock);
4716 * release a ref on the nce; In general, this
4725 nce_refrele(nce_t *nce)
4727 ASSERT((nce)->nce_refcnt != 0);
4728 mutex_enter(&nce->nce_lock);
4729 if (--nce->nce_refcnt == 0)
4730 nce_inactive(nce); /* destroys the mutex */
4732 mutex_exit(&nce->nce_lock);
4736 * free the nce after all refs have gone away.
4739 nce_inactive(nce_t *nce)
4741 ill_t *ill = nce->nce_ill;
4743 ASSERT(nce->nce_refcnt == 0);
4745 ncec_refrele_notr(nce->nce_common);
4746 nce->nce_common = NULL;
4747 freemsg(nce->nce_fp_mp);
4748 freemsg(nce->nce_dlur_mp);
4752 (char *), "nce", (void *), nce);
4754 nce->nce_ill = NULL;
4767 mutex_destroy(&nce->nce_lock);
4768 kmem_cache_free(nce_cache, nce);
4772 * Add an nce to the ill_nce list.
4775 nce_add_impl(ill_t *ill, ncec_t *ncec, nce_t *nce, mblk_t *dlur_mp)
4777 bzero(nce, sizeof (*nce));
4778 mutex_init(&nce->nce_lock, NULL, MUTEX_DEFAULT, NULL);
4779 nce->nce_common = ncec;
4780 nce->nce_addr = ncec->ncec_addr;
4781 nce->nce_ill = ill;
4783 (char *), "nce", (void *), nce);
4786 nce->nce_refcnt = 1; /* for the thread */
4788 nce->nce_dlur_mp = dlur_mp;
4790 /* add nce to the ill's fastpath list. */
4791 nce->nce_refcnt++; /* for the list */
4792 list_insert_head(&ill->ill_nce, nce);
4793 return (nce);
4799 nce_t *nce;
4805 nce = kmem_cache_alloc(nce_cache, KM_NOSLEEP);
4806 if (nce == NULL)
4814 kmem_cache_free(nce_cache, nce);
4818 return (nce_add_impl(ill, ncec, nce, dlur_mp));
4822 * remove the nce from the ill_faspath list
4825 nce_delete(nce_t *nce)
4827 ill_t *ill = nce->nce_ill;
4831 mutex_enter(&nce->nce_lock);
4832 if (nce->nce_is_condemned) {
4834 * some other thread has removed this nce from the ill_nce list
4836 mutex_exit(&nce->nce_lock);
4839 nce->nce_is_condemned = B_TRUE;
4840 mutex_exit(&nce->nce_lock);
4842 list_remove(&ill->ill_nce, nce);
4846 * at least 2 refs on the nce: one for the thread, and one
4850 nce_refrele(nce);
4856 nce_t *nce = NULL;
4861 for (nce = list_head(&ill->ill_nce); nce != NULL;
4862 nce = list_next(&ill->ill_nce, nce)) {
4863 if (IN6_ARE_ADDR_EQUAL(&nce->nce_addr, addr))
4868 * if we found the nce on the ill_nce list while holding
4871 if (nce != NULL) {
4872 ASSERT(!nce->nce_is_condemned);
4873 nce_refhold(nce);
4875 return (nce);
4885 nce_t *nce = NULL, *nce_next;
4888 for (nce = list_head(&ill->ill_nce); nce != NULL; ) {
4889 nce_next = list_next(&ill->ill_nce, nce);
4890 if (func(ill, nce, arg) != 0)
4892 nce = nce_next;
4907 nce_t *nce, *nce_next;
4912 for (nce = list_head(&ill->ill_nce); nce != NULL; ) {
4913 nce_next = list_next(&ill->ill_nce, nce);
4914 if (!flushall && NCE_PUBLISH(nce->nce_common)) {
4915 nce = nce_next;
4924 nce_refhold(nce);
4925 nce_delete(nce);
4926 list_insert_tail(&dead, nce);
4927 nce = nce_next;
4930 while ((nce = list_head(&dead)) != NULL) {
4931 list_remove(&dead, nce);
4932 nce_refrele(nce);
5007 * find a new nce based on an under_ill. The first IPMP probe