FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_listen.c
/*
 * Stop a listening server by sending a close_listsvr request to HW.
 * The server TID is freed when we get the reply.
 */
Stop a listening server by sending a close_listsvr request to HW.
The server TID is freed when we get the reply.
Stop a listening server by sending a close_listsvr request to HW . The server TID is freed when we get the reply .
int
t3_listen_stop(struct toedev *tod, struct tcpcb *tp)
{
	struct listen_ctx *lctx;
	struct adapter *sc = tod->tod_softc;
	struct tom_data *td = t3_tomdata(tod);
	struct inpcb *inp = tp->t_inpcb;
	struct synq_entry *synqe;
	INP_WLOCK_ASSERT(inp);
	lctx = listen_hash_del(td, inp);
	if (lctx == NULL)
		return (ENOENT);	
	CTR4(KTR_CXGB, "%s: stid %u, lctx %p, flags %x", __func__, lctx->stid,
	    lctx, lctx->flags);
	if (lctx->flags & LCTX_RPL_PENDING) {
		KASSERT(TAILQ_EMPTY(&lctx->synq),
		    ("%s: synq not empty.", __func__));
		return (EINPROGRESS);
	}
	TAILQ_FOREACH(synqe, &lctx->synq, link) {
		KASSERT(synqe->lctx == lctx, ("%s: synq corrupt", __func__));
		t3_send_reset_synqe(tod, synqe);
	}
	destroy_server(sc, lctx);
	return (0);
}
int t3_listen_stop ( struct toedev * tod , struct tcpcb * tp ) { struct listen_ctx * lctx ; struct adapter * sc = tod -> tod_softc ; struct tom_data * td = t3_tomdata ( tod ) ; struct inpcb * inp = tp -> t_inpcb ; struct synq_entry * synqe ; INP_WLOCK_ASSERT ( inp ) ; lctx = listen_hash_del ( td , inp ) ; if ( lctx == NULL ) return ( ENOENT ) ; CTR4 ( KTR_CXGB , " " , __func__ , lctx -> stid , lctx , lctx -> flags ) ; if ( lctx -> flags & LCTX_RPL_PENDING ) { KASSERT ( TAILQ_EMPTY ( & lctx -> synq ) , ( " " , __func__ ) ) ; return ( EINPROGRESS ) ; } TAILQ_FOREACH ( synqe , & lctx -> synq , link ) { KASSERT ( synqe -> lctx == lctx , ( " " , __func__ ) ) ; t3_send_reset_synqe ( tod , synqe ) ; } destroy_server ( sc , lctx ) ; return ( 0 ) ; }
Stop a listening server by sending a close_listsvr request to HW.
Stop a listening server by sending a close_listsvr request to HW .
/* no hardware listener for this inp */ /*
	 * If the reply to the PASS_OPEN is still pending we'll wait for it to
	 * arrive and clean up when it does.
	 */ /*
	 * The host stack will abort all the connections on the listening
	 * socket's so_comp.  It doesn't know about the connections on the synq
	 * so we need to take care of those.
	 */