diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2013-07-04 17:55:52 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2013-07-04 17:55:52 +0000 |
commit | c337fa30af502e3f683e3f5992e1a9ef3570994e (patch) | |
tree | 853000ce00f8f4c6086a95f30ad12462810cb882 /sys/dev/cxgbe/tom/t4_connect.c | |
parent | 6f7e608220a110be02e055befc8e311a0e9f5fe0 (diff) | |
download | src-c337fa30af502e3f683e3f5992e1a9ef3570994e.tar.gz src-c337fa30af502e3f683e3f5992e1a9ef3570994e.zip |
- Read all TP parameters in one place.
- Read the filter mode, calculate various shifts, and use them
properly during active open (in select_ntuple).
MFC after: 1 day
Notes
Notes:
svn path=/head/; revision=252705
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_connect.c')
-rw-r--r-- | sys/dev/cxgbe/tom/t4_connect.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index ac48d313a0ad..69dca96c66ae 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "common/t4_regs_values.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -384,10 +385,18 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); - INIT_TP_WR(cpl, 0); + if (is_t4(sc)) { + INIT_TP_WR(cpl, 0); + cpl->params = select_ntuple(pi, toep->l2te); + } else { + struct cpl_t5_act_open_req6 *c5 = (void *)cpl; + + INIT_TP_WR(c5, 0); + c5->rsvd = 0; + c5->params = select_ntuple(pi, toep->l2te); + } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, qid_atid)); - cpl->local_port = inp->inp_lport; cpl->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0]; cpl->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8]; @@ -397,20 +406,19 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, toep->rx_credits, toep->ulp_mode); cpl->opt2 = calc_opt2a(so, toep); + } else { + struct cpl_act_open_req *cpl = wrtod(wr); + if (is_t4(sc)) { - cpl->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); + INIT_TP_WR(cpl, 0); + cpl->params = select_ntuple(pi, toep->l2te); } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; + struct cpl_t5_act_open_req *c5 = (void *)cpl; + INIT_TP_WR(c5, 0); c5->rsvd = 0; - c5->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); + c5->params = select_ntuple(pi, toep->l2te); } - } else { - struct cpl_act_open_req *cpl = wrtod(wr); - - INIT_TP_WR(cpl, 0); OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, @@ -418,16 +426,6 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt, cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, toep->rx_credits, toep->ulp_mode); cpl->opt2 = calc_opt2a(so, toep); - if (is_t4(sc)) { - cpl->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); - } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; - - c5->rsvd = 0; - c5->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); - } } CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, |