diff options
author | np <np@FreeBSD.org> | 2013-07-04 18:41:21 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2013-07-04 18:41:21 +0000 |
commit | c783f2d418ec47de984f91de9ebf58d9312a249b (patch) | |
tree | 3e0e08aa393c13debad579ebc994c93325109ba3 | |
parent | 9b554dcd02e15b115e6aa09edcc4ed77c2019510 (diff) | |
download | FreeBSD-src-c783f2d418ec47de984f91de9ebf58d9312a249b.zip FreeBSD-src-c783f2d418ec47de984f91de9ebf58d9312a249b.tar.gz |
The T5 allows the driver to specify the ISS. Do so; use the ISS picked
by the kernel.
MFC after: 1 day
-rw-r--r-- | sys/dev/cxgbe/common/t4_msg.h | 13 | ||||
-rw-r--r-- | sys/dev/cxgbe/tom/t4_connect.c | 8 | ||||
-rw-r--r-- | sys/dev/cxgbe/tom/t4_listen.c | 21 |
3 files changed, 34 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/common/t4_msg.h b/sys/dev/cxgbe/common/t4_msg.h index 5988070..ef8fbe6 100644 --- a/sys/dev/cxgbe/common/t4_msg.h +++ b/sys/dev/cxgbe/common/t4_msg.h @@ -678,6 +678,15 @@ struct cpl_pass_accept_rpl { __be64 opt0; }; +struct cpl_t5_pass_accept_rpl { + WR_HDR; + union opcode_tid ot; + __be32 opt2; + __be64 opt0; + __be32 iss; + __be32 rsvd; +}; + struct cpl_act_open_req { WR_HDR; union opcode_tid ot; @@ -702,7 +711,7 @@ struct cpl_t5_act_open_req { __be32 local_ip; __be32 peer_ip; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; @@ -731,7 +740,7 @@ struct cpl_t5_act_open_req6 { __be64 peer_ip_hi; __be64 peer_ip_lo; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index 69dca96..11cb4fc 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -247,8 +247,10 @@ calc_opt2a(struct socket *so, struct toepcb *toep) /* RX_COALESCE is always a valid value (M_RX_COALESCE). */ if (is_t4(sc)) opt2 |= F_RX_COALESCE_VALID; - else + else { opt2 |= F_T5_OPT_2_VALID; + opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ + } opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL @@ -392,7 +394,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, struct cpl_t5_act_open_req6 *c5 = (void *)cpl; INIT_TP_WR(c5, 0); - c5->rsvd = 0; + c5->iss = htobe32(tp->iss); c5->params = select_ntuple(pi, toep->l2te); } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, @@ -416,7 +418,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, struct cpl_t5_act_open_req *c5 = (void *)cpl; INIT_TP_WR(c5, 0); - c5->rsvd = 0; + c5->iss = htobe32(tp->iss); c5->params = select_ntuple(pi, toep->l2te); } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index 7db4126..7259a29 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -674,6 +674,12 @@ t4_syncache_respond(struct toedev *tod, void *arg, struct mbuf *m) synqe->iss = be32toh(th->th_seq); synqe->ts = to.to_tsval; + if (is_t5(sc)) { + struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); + + rpl5->iss = th->th_seq; + } + e = &sc->l2t->l2tab[synqe->l2e_idx]; t4_l2t_send(sc, wr, e); @@ -1011,8 +1017,10 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, /* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */ if (is_t4(sc)) opt2 |= F_RX_COALESCE_VALID; - else + else { opt2 |= F_T5_OPT_2_VALID; + opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ + } opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL @@ -1287,7 +1295,8 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss, if (synqe == NULL) REJECT_PASS_ACCEPT(); - wr = alloc_wrqe(sizeof(*rpl), &sc->sge.ctrlq[pi->port_id]); + wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : + sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[pi->port_id]); if (wr == NULL) REJECT_PASS_ACCEPT(); rpl = wrtod(wr); @@ -1328,7 +1337,13 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss, save_qids_in_mbuf(m, pi); get_qids_from_mbuf(m, NULL, &rxqid); - INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + if (is_t4(sc)) + INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + else { + struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; + + INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + } if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { ulp_mode = ULP_MODE_TCPDDP; synqe->flags |= TPF_SYNQE_TCPDDP; |