FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
/*
 * Called after the last CPL for the toepcb has been received.
 *
 * The inp must be wlocked on entry and is unlocked (or maybe destroyed) by the
 * time this function exits.
 */
Called after the last CPL for the toepcb has been received.
The inp must be wlocked on entry and is unlocked (or maybe destroyed) by the
time this function exits.
Called after the last CPL for the toepcb has been received . The inp must be wlocked on entry and is unlocked ( or maybe destroyed ) by the time this function exits .
static int
toepcb_release(struct toepcb *toep)
{
	struct inpcb *inp = toep->tp_inp;
	struct toedev *tod = toep->tp_tod;
	struct tom_data *td = t3_tomdata(tod);
	int rc;
	INP_WLOCK_ASSERT(inp);
	KASSERT(!(toep->tp_flags & TP_CPL_DONE),
	    ("%s: double release?", __func__));
	CTR2(KTR_CXGB, "%s: tid %d", __func__, toep->tp_tid);
	toep->tp_flags |= TP_CPL_DONE;
	toep->tp_inp = NULL;
	mtx_lock(&td->toep_list_lock);
	TAILQ_REMOVE(&td->toep_list, toep, link);
	mtx_unlock(&td->toep_list_lock);
	if (!(toep->tp_flags & TP_ATTACHED))
		t3_release_offload_resources(toep);
	rc = in_pcbrele_wlocked(inp);
	if (!rc)
		INP_WUNLOCK(inp);
	return (rc);
}
static int toepcb_release ( struct toepcb * toep ) { struct inpcb * inp = toep -> tp_inp ; struct toedev * tod = toep -> tp_tod ; struct tom_data * td = t3_tomdata ( tod ) ; int rc ; INP_WLOCK_ASSERT ( inp ) ; KASSERT ( ! ( toep -> tp_flags & TP_CPL_DONE ) , ( " " , __func__ ) ) ; CTR2 ( KTR_CXGB , " " , __func__ , toep -> tp_tid ) ; toep -> tp_flags |= TP_CPL_DONE ; toep -> tp_inp = NULL ; mtx_lock ( & td -> toep_list_lock ) ; TAILQ_REMOVE ( & td -> toep_list , toep , link ) ; mtx_unlock ( & td -> toep_list_lock ) ; if ( ! ( toep -> tp_flags & TP_ATTACHED ) ) t3_release_offload_resources ( toep ) ; rc = in_pcbrele_wlocked ( inp ) ; if ( ! rc ) INP_WUNLOCK ( inp ) ; return ( rc ) ; }
Called after the last CPL for the toepcb has been received.
Called after the last CPL for the toepcb has been received .