FreeBSD/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
/*
 * The ISS and IRS are from after the exchange of SYNs and are off by 1.
 */
The ISS and IRS are from after the exchange of SYNs and are off by 1.
The ISS and IRS are from after the exchange of SYNs and are off by 1 .
void
make_established(struct socket *so, uint32_t cpl_iss, uint32_t cpl_irs,
    uint16_t cpl_tcpopt)
{
	struct inpcb *inp = sotoinpcb(so);
	struct tcpcb *tp = intotcpcb(inp);
	struct toepcb *toep = tp->t_toe;
	long bufsize;
	uint32_t iss = be32toh(cpl_iss) - 1;	
	uint32_t irs = be32toh(cpl_irs) - 1;	
	uint16_t tcpopt = be16toh(cpl_tcpopt);
	INP_WLOCK_ASSERT(inp);
	tp->t_state = TCPS_ESTABLISHED;
	tp->t_starttime = ticks;
	TCPSTAT_INC(tcps_connects);
	CTR4(KTR_CXGB, "%s tid %u, toep %p, inp %p", tcpstates[tp->t_state],
	    toep->tp_tid, toep, inp);
	tp->irs = irs;
	tcp_rcvseqinit(tp);
	tp->rcv_wnd = toep->tp_rx_credits << 10;
	tp->rcv_adv += tp->rcv_wnd;
	tp->last_ack_sent = tp->rcv_nxt;
	SOCKBUF_LOCK(&so->so_rcv);
	bufsize = select_rcv_wnd(so);
	SOCKBUF_UNLOCK(&so->so_rcv);
	toep->tp_rx_credits = bufsize - tp->rcv_wnd;
	tp->iss = iss;
	tcp_sendseqinit(tp);
	tp->snd_una = iss + 1;
	tp->snd_nxt = iss + 1;
	tp->snd_max = iss + 1;
	assign_rxopt(tp, tcpopt);
	soisconnected(so);
}
void make_established ( struct socket * so , uint32_t cpl_iss , uint32_t cpl_irs , uint16_t cpl_tcpopt ) { struct inpcb * inp = sotoinpcb ( so ) ; struct tcpcb * tp = intotcpcb ( inp ) ; struct toepcb * toep = tp -> t_toe ; long bufsize ; uint32_t iss = be32toh ( cpl_iss ) - 1 ; uint32_t irs = be32toh ( cpl_irs ) - 1 ; uint16_t tcpopt = be16toh ( cpl_tcpopt ) ; INP_WLOCK_ASSERT ( inp ) ; tp -> t_state = TCPS_ESTABLISHED ; tp -> t_starttime = ticks ; TCPSTAT_INC ( tcps_connects ) ; CTR4 ( KTR_CXGB , " " , tcpstates [ tp -> t_state ] , toep -> tp_tid , toep , inp ) ; tp -> irs = irs ; tcp_rcvseqinit ( tp ) ; tp -> rcv_wnd = toep -> tp_rx_credits << 10 ; tp -> rcv_adv += tp -> rcv_wnd ; tp -> last_ack_sent = tp -> rcv_nxt ; SOCKBUF_LOCK ( & so -> so_rcv ) ; bufsize = select_rcv_wnd ( so ) ; SOCKBUF_UNLOCK ( & so -> so_rcv ) ; toep -> tp_rx_credits = bufsize - tp -> rcv_wnd ; tp -> iss = iss ; tcp_sendseqinit ( tp ) ; tp -> snd_una = iss + 1 ; tp -> snd_nxt = iss + 1 ; tp -> snd_max = iss + 1 ; assign_rxopt ( tp , tcpopt ) ; soisconnected ( so ) ; }
The ISS and IRS are from after the exchange of SYNs and are off by 1.
The ISS and IRS are from after the exchange of SYNs and are off by 1 .
/* true ISS */ /* true IRS */ /*
	 * If we were unable to send all rx credits via opt0, save the remainder
	 * in rx_credits so that they can be handed over with the next credit
	 * update.
	 */