Author: np
Date: Thu Jul  4 18:41:21 2013
New Revision: 252711
URL: http://svnweb.freebsd.org/changeset/base/252711

Log:
  The T5 allows the driver to specify the ISS.  Do so; use the ISS picked
  by the kernel.
  
  MFC after:    1 day

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/cxgbe/tom/t4_listen.c

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==============================================================================
--- head/sys/dev/cxgbe/common/t4_msg.h  Thu Jul  4 18:38:00 2013        
(r252710)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Thu Jul  4 18:41:21 2013        
(r252711)
@@ -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;
 };

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul  4 18:38:00 2013        
(r252710)
+++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul  4 18:41:21 2013        
(r252711)
@@ -247,8 +247,10 @@ calc_opt2a(struct socket *so, struct toe
        /* 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 so
                        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 so
                        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,

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_listen.c  Thu Jul  4 18:38:00 2013        
(r252710)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Thu Jul  4 18:41:21 2013        
(r252711)
@@ -674,6 +674,12 @@ t4_syncache_respond(struct toedev *tod, 
        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 po
        /* 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, co
        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, co
        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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to