FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
/*
 * Send an ABORT_REQ message.  Cannot fail.  This routine makes sure we do not
 * send multiple ABORT_REQs for the same connection and also that we do not try
 * to send a message after the connection has closed.
 */
Send an ABORT_REQ message.  Cannot fail.  This routine makes sure we do not
send multiple ABORT_REQs for the same connection and also that we do not try
to send a message after the connection has closed.
Send an ABORT_REQ message . Cannot fail . This routine makes sure we do not send multiple ABORT_REQs for the same connection and also that we do not try to send a message after the connection has closed .
static void
send_reset(struct toepcb *toep)
{
	struct cpl_abort_req *req;
	unsigned int tid = toep->tp_tid;
	struct inpcb *inp = toep->tp_inp;
	struct socket *so = inp->inp_socket;
	struct tcpcb *tp = intotcpcb(inp);
	struct toedev *tod = toep->tp_tod;
	struct adapter *sc = tod->tod_softc;
	struct mbuf *m;
	INP_INFO_RLOCK_ASSERT(&V_tcbinfo);
	INP_WLOCK_ASSERT(inp);
	CTR4(KTR_CXGB, "%s: tid %d, toep %p (%x)", __func__, tid, toep,
	    toep->tp_flags);
	if (toep->tp_flags & TP_ABORT_SHUTDOWN)
		return;
	toep->tp_flags |= (TP_ABORT_RPL_PENDING | TP_ABORT_SHUTDOWN);
	sbflush(so_sockbuf_snd(so));
	purge_wr_queue(toep);
	m = M_GETHDR_OFLD(toep->tp_qset, CPL_PRIORITY_DATA, req);
	if (m == NULL)
		CXGB_UNIMPLEMENTED();
	req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_HOST_ABORT_CON_REQ));
	req->wr.wrh_lo = htonl(V_WR_TID(tid));
	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_ABORT_REQ, tid));
	req->rsvd0 = htonl(tp->snd_nxt);
	req->rsvd1 = !(toep->tp_flags & TP_DATASENT);
	req->cmd = CPL_ABORT_SEND_RST;
	if (tp->t_state == TCPS_SYN_SENT)
		(void )mbufq_enqueue(&toep->out_of_order_queue, m); 
	else
		l2t_send(sc, m, toep->tp_l2t);
}
static void send_reset ( struct toepcb * toep ) { struct cpl_abort_req * req ; unsigned int tid = toep -> tp_tid ; struct inpcb * inp = toep -> tp_inp ; struct socket * so = inp -> inp_socket ; struct tcpcb * tp = intotcpcb ( inp ) ; struct toedev * tod = toep -> tp_tod ; struct adapter * sc = tod -> tod_softc ; struct mbuf * m ; INP_INFO_RLOCK_ASSERT ( & V_tcbinfo ) ; INP_WLOCK_ASSERT ( inp ) ; CTR4 ( KTR_CXGB , " " , __func__ , tid , toep , toep -> tp_flags ) ; if ( toep -> tp_flags & TP_ABORT_SHUTDOWN ) return ; toep -> tp_flags |= ( TP_ABORT_RPL_PENDING | TP_ABORT_SHUTDOWN ) ; sbflush ( so_sockbuf_snd ( so ) ) ; purge_wr_queue ( toep ) ; m = M_GETHDR_OFLD ( toep -> tp_qset , CPL_PRIORITY_DATA , req ) ; if ( m == NULL ) CXGB_UNIMPLEMENTED ( ) ; req -> wr . wrh_hi = htonl ( V_WR_OP ( FW_WROPCODE_OFLD_HOST_ABORT_CON_REQ ) ) ; req -> wr . wrh_lo = htonl ( V_WR_TID ( tid ) ) ; OPCODE_TID ( req ) = htonl ( MK_OPCODE_TID ( CPL_ABORT_REQ , tid ) ) ; req -> rsvd0 = htonl ( tp -> snd_nxt ) ; req -> rsvd1 = ! ( toep -> tp_flags & TP_DATASENT ) ; req -> cmd = CPL_ABORT_SEND_RST ; if ( tp -> t_state == TCPS_SYN_SENT ) ( void ) mbufq_enqueue ( & toep -> out_of_order_queue , m ) ; else l2t_send ( sc , m , toep -> tp_l2t ) ; }
Send an ABORT_REQ message.
Send an ABORT_REQ message .
/* Purge the send queue */ /* defer */