FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
/*
 * One sided detach.  The tcpcb is going away and we need to unhook the toepcb
 * hanging off it.  If the TOE driver is also done with the toepcb we'll release
 * all offload resources.
 */
One sided detach.  The tcpcb is going away and we need to unhook the toepcb
hanging off it.  If the TOE driver is also done with the toepcb we'll release
all offload resources.
One sided detach . The tcpcb is going away and we need to unhook the toepcb hanging off it . If the TOE driver is also done with the toepcb we ' ll release all offload resources .
static void
toepcb_detach(struct inpcb *inp)
{
	struct toepcb *toep;
	struct tcpcb *tp;
	KASSERT(inp, ("%s: inp is NULL", __func__));
	INP_WLOCK_ASSERT(inp);
	tp = intotcpcb(inp);
	toep = tp->t_toe;
	KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
	KASSERT(toep->tp_flags & TP_ATTACHED, ("%s: not attached", __func__));
	CTR6(KTR_CXGB, "%s: %s %u, toep %p, inp %p, tp %p", __func__,
	    tp->t_state == TCPS_SYN_SENT ? "atid" : "tid", toep->tp_tid,
	    toep, inp, tp);
	tp->t_toe = NULL;
	tp->t_flags &= ~TF_TOE;
	toep->tp_flags &= ~TP_ATTACHED;
	if (toep->tp_flags & TP_CPL_DONE)
		t3_release_offload_resources(toep);
}
static void toepcb_detach ( struct inpcb * inp ) { struct toepcb * toep ; struct tcpcb * tp ; KASSERT ( inp , ( " " , __func__ ) ) ; INP_WLOCK_ASSERT ( inp ) ; tp = intotcpcb ( inp ) ; toep = tp -> t_toe ; KASSERT ( toep != NULL , ( " " , __func__ ) ) ; KASSERT ( toep -> tp_flags & TP_ATTACHED , ( " " , __func__ ) ) ; CTR6 ( KTR_CXGB , " " , __func__ , tp -> t_state == TCPS_SYN_SENT ? " " : " " , toep -> tp_tid , toep , inp , tp ) ; tp -> t_toe = NULL ; tp -> t_flags &= ~ TF_TOE ; toep -> tp_flags &= ~ TP_ATTACHED ; if ( toep -> tp_flags & TP_CPL_DONE ) t3_release_offload_resources ( toep ) ; }
One sided detach.
One sided detach .