Lines Matching +full:wr +full:- +full:active

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
69 * Active open succeeded.
75 struct adapter *sc = iq->adapter;
78 u_int atid = G_TID_TID(ntohl(cpl->tos_atid));
80 struct inpcb *inp = toep->inp;
83 KASSERT(toep->tid == atid, ("%s: toep tid/atid mismatch", __func__));
88 CURVNET_SET(toep->vnet);
90 toep->tid = tid;
91 insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1);
92 if (sc->params.tid_qid_sel_mask != 0) {
93 update_tid_qid_sel(toep->vi, &toep->params, tid);
94 toep->ofld_txq = &sc->sge.ofld_txq[toep->params.txq_idx];
95 toep->ctrlq = &sc->sge.ctrlq[toep->params.ctrlq_idx];
98 if (inp->inp_flags & INP_DROPPED) {
103 send_reset(sc, toep, be32toh(cpl->snd_isn));
107 make_established(toep, be32toh(cpl->snd_isn) - 1,
108 be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt);
109 inp->inp_flowtype = M_HASHTYPE_OPAQUE;
110 inp->inp_flowid = tid;
121 struct inpcb *inp = toep->inp;
122 struct toedev *tod = &toep->td->tod;
124 struct tom_data *td = sc->tom_softc;
126 if (toep->tid >= 0) {
127 free_atid(sc, toep->tid);
128 toep->tid = -1;
129 mtx_lock(&td->toep_list_lock);
130 if (toep->flags & TPF_IN_TOEP_LIST) {
131 toep->flags &= ~TPF_IN_TOEP_LIST;
132 TAILQ_REMOVE(&td->toep_list, toep, link);
134 mtx_unlock(&td->toep_list_lock);
137 CURVNET_SET(toep->vnet);
149 * Active open failed.
155 struct adapter *sc = iq->adapter;
157 u_int atid = G_TID_TID(G_AOPEN_ATID(be32toh(cpl->atid_status)));
158 u_int status = G_AOPEN_STATUS(be32toh(cpl->atid_status));
163 KASSERT(toep->tid == atid, ("%s: toep tid/atid mismatch", __func__));
172 release_tid(sc, GET_TID(cpl), toep->ctrlq);
234 idx = min(chip_id(sc) - CHELSIO_T4, 3);
240 * active open (soconnect).
244 * tcbinfo not locked (This has changed - used to be WLOCKed)
246 * tp->t_state = TCPS_SYN_SENT
253 struct adapter *sc = tod->tod_softc;
256 struct wrqe *wr = NULL;
257 if_t rt_ifp = nh->nh_ifp;
271 KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6,
272 ("%s: dest addr %p has family %u", __func__, nam, nam->sa_family));
286 if (sc->flags & KERN_TLS_ON)
289 rw_rlock(&sc->policy_lock);
292 rw_runlock(&sc->policy_lock);
300 toep->tid = alloc_atid(sc, toep);
301 if (toep->tid < 0)
304 toep->l2te = t4_l2t_get(vi->pi, rt_ifp,
305 nh->nh_flags & NHF_GATEWAY ? &nh->gw_sa : nam);
306 if (toep->l2te == NULL)
309 toep->vnet = so->so_vnet;
310 init_conn_params(vi, &settings, &inp->inp_inc, so, NULL,
311 toep->l2te->idx, &toep->params);
314 isipv6 = nam->sa_family == AF_INET6;
315 wr = alloc_wrqe(act_open_cpl_size(sc, isipv6), toep->ctrlq);
316 if (wr == NULL)
319 qid_atid = V_TID_QID(toep->ofld_rxq->iq.abs_id) | V_TID_TID(toep->tid) |
322 ntuple = select_ntuple(vi, toep->l2te);
324 struct cpl_act_open_req6 *cpl = wrtod(wr);
329 if ((inp->inp_vflag & INP_IPV6) == 0)
332 toep->ce = t4_get_clip_entry(sc, &inp->in6p_laddr, true);
333 if (toep->ce == NULL)
339 cpl->params = htobe32((uint32_t)ntuple);
343 cpl5->iss = htobe32(tp->iss);
344 cpl5->params = htobe64(V_FILTER_TUPLE(ntuple));
348 cpl6->iss = htobe32(tp->iss);
349 cpl6->params = htobe64(V_FILTER_TUPLE(ntuple));
354 cpl7->iss = htobe32(tp->iss);
355 cpl7->params = htobe64(V_T7_FILTER_TUPLE(ntuple));
360 cpl->local_port = inp->inp_lport;
361 cpl->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0];
362 cpl->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8];
363 cpl->peer_port = inp->inp_fport;
364 cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0];
365 cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8];
366 cpl->opt0 = calc_options0(vi, &toep->params);
367 cpl->opt2 = calc_options2(vi, &toep->params);
371 __func__, toep->tid, toep, inp, be64toh(cpl->opt0),
372 be32toh(cpl->opt2));
374 struct cpl_act_open_req *cpl = wrtod(wr);
382 cpl->params = htobe32((uint32_t)ntuple);
386 cpl5->iss = htobe32(tp->iss);
387 cpl5->params = htobe64(V_FILTER_TUPLE(ntuple));
391 cpl6->iss = htobe32(tp->iss);
392 cpl6->params = htobe64(V_FILTER_TUPLE(ntuple));
397 cpl7->iss = htobe32(tp->iss);
398 cpl7->params = htobe64(V_T7_FILTER_TUPLE(ntuple));
402 inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port,
403 &cpl->peer_ip, &cpl->peer_port);
404 cpl->opt0 = calc_options0(vi, &toep->params);
405 cpl->opt2 = calc_options2(vi, &toep->params);
409 __func__, toep->tid, toep, inp, be64toh(cpl->opt0),
410 be32toh(cpl->opt2));
414 /* Add the TOE PCB to the active list */
415 td = toep->td;
416 mtx_lock(&td->toep_list_lock);
417 TAILQ_INSERT_TAIL(&td->toep_list, toep, link);
418 toep->flags |= TPF_IN_TOEP_LIST;
419 mtx_unlock(&td->toep_list_lock);
421 rc = t4_l2t_send(sc, wr, toep->l2te);
424 toep->flags |= TPF_CPL_PENDING;
435 if (wr)
436 free_wrqe(wr);
439 if (toep->tid >= 0)
440 free_atid(sc, toep->tid);
441 if (toep->l2te)
442 t4_l2t_release(toep->l2te);
443 if (toep->ce)
444 t4_release_clip_entry(sc, toep->ce);