Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_tom.c
Show First 20 Lines • Show All 388 Lines • ▼ Show 20 Lines | #ifdef KTR | ||||
} else { | } else { | ||||
CTR6(KTR_CXGBE, | CTR6(KTR_CXGBE, | ||||
"t4_pcb_detach: tid %d (%s), toep %p (0x%x), inp %p (0x%x)", | "t4_pcb_detach: tid %d (%s), toep %p (0x%x), inp %p (0x%x)", | ||||
toep->tid, tcpstates[tp->t_state], toep, toep->flags, inp, | toep->tid, tcpstates[tp->t_state], toep, toep->flags, inp, | ||||
inp->inp_flags); | inp->inp_flags); | ||||
} | } | ||||
#endif | #endif | ||||
if (ulp_mode(toep) == ULP_MODE_TLS) | |||||
tls_detach(toep); | |||||
tp->tod = NULL; | tp->tod = NULL; | ||||
tp->t_toe = NULL; | tp->t_toe = NULL; | ||||
tp->t_flags &= ~TF_TOE; | tp->t_flags &= ~TF_TOE; | ||||
toep->flags &= ~TPF_ATTACHED; | toep->flags &= ~TPF_ATTACHED; | ||||
if (!(toep->flags & TPF_CPL_PENDING)) | if (!(toep->flags & TPF_CPL_PENDING)) | ||||
release_offload_resources(toep); | release_offload_resources(toep); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 607 Lines • ▼ Show 20 Lines | final_cpl_received(struct toepcb *toep) | ||||
KASSERT(toep->flags & TPF_CPL_PENDING, | KASSERT(toep->flags & TPF_CPL_PENDING, | ||||
("%s: CPL not pending already?", __func__)); | ("%s: CPL not pending already?", __func__)); | ||||
CTR6(KTR_CXGBE, "%s: tid %d, toep %p (0x%x), inp %p (0x%x)", | CTR6(KTR_CXGBE, "%s: tid %d, toep %p (0x%x), inp %p (0x%x)", | ||||
__func__, toep->tid, toep, toep->flags, inp, inp->inp_flags); | __func__, toep->tid, toep, toep->flags, inp, inp->inp_flags); | ||||
if (ulp_mode(toep) == ULP_MODE_TCPDDP) | if (ulp_mode(toep) == ULP_MODE_TCPDDP) | ||||
release_ddp_resources(toep); | release_ddp_resources(toep); | ||||
else if (ulp_mode(toep) == ULP_MODE_TLS) | |||||
tls_detach(toep); | |||||
toep->inp = NULL; | toep->inp = NULL; | ||||
need_wakeup = (toep->flags & TPF_WAITING_FOR_FINAL) != 0; | need_wakeup = (toep->flags & TPF_WAITING_FOR_FINAL) != 0; | ||||
toep->flags &= ~(TPF_CPL_PENDING | TPF_WAITING_FOR_FINAL); | toep->flags &= ~(TPF_CPL_PENDING | TPF_WAITING_FOR_FINAL); | ||||
mbufq_drain(&toep->ulp_pduq); | mbufq_drain(&toep->ulp_pduq); | ||||
mbufq_drain(&toep->ulp_pdu_reclaimq); | mbufq_drain(&toep->ulp_pdu_reclaimq); | ||||
if (!(toep->flags & TPF_ATTACHED)) | if (!(toep->flags & TPF_ATTACHED)) | ||||
release_offload_resources(toep); | release_offload_resources(toep); | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | select_ntuple(struct vi_info *vi, struct l2t_entry *e) | ||||
} | } | ||||
if (is_t4(sc)) | if (is_t4(sc)) | ||||
return (htobe32((uint32_t)ntuple)); | return (htobe32((uint32_t)ntuple)); | ||||
else | else | ||||
return (htobe64(V_FILTER_TUPLE(ntuple))); | return (htobe64(V_FILTER_TUPLE(ntuple))); | ||||
} | } | ||||
static int | |||||
is_tls_sock(struct socket *so, struct adapter *sc) | |||||
{ | |||||
struct inpcb *inp = sotoinpcb(so); | |||||
int i, rc; | |||||
/* XXX: Eventually add a SO_WANT_TLS socket option perhaps? */ | |||||
rc = 0; | |||||
ADAPTER_LOCK(sc); | |||||
for (i = 0; i < sc->tt.num_tls_rx_ports; i++) { | |||||
if (inp->inp_lport == htons(sc->tt.tls_rx_ports[i]) || | |||||
inp->inp_fport == htons(sc->tt.tls_rx_ports[i])) { | |||||
rc = 1; | |||||
break; | |||||
} | |||||
} | |||||
ADAPTER_UNLOCK(sc); | |||||
return (rc); | |||||
} | |||||
/* | /* | ||||
* Initialize various connection parameters. | * Initialize various connection parameters. | ||||
*/ | */ | ||||
void | void | ||||
init_conn_params(struct vi_info *vi , struct offload_settings *s, | init_conn_params(struct vi_info *vi , struct offload_settings *s, | ||||
struct in_conninfo *inc, struct socket *so, | struct in_conninfo *inc, struct socket *so, | ||||
const struct tcp_options *tcpopt, int16_t l2t_idx, struct conn_params *cp) | const struct tcp_options *tcpopt, int16_t l2t_idx, struct conn_params *cp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if (tt->tx_align >= 0) | ||||
cp->tx_align = tt->tx_align > 0 ? 1 : 0; | cp->tx_align = tt->tx_align > 0 ? 1 : 0; | ||||
else if (chip_id(sc) == CHELSIO_T5 && | else if (chip_id(sc) == CHELSIO_T5 && | ||||
(port_top_speed(pi) > 10 || sc->params.nports > 2)) | (port_top_speed(pi) > 10 || sc->params.nports > 2)) | ||||
cp->tx_align = 1; | cp->tx_align = 1; | ||||
else | else | ||||
cp->tx_align = 0; | cp->tx_align = 0; | ||||
/* ULP mode. */ | /* ULP mode. */ | ||||
if (can_tls_offload(sc) && | if (s->ddp > 0 || | ||||
(s->tls > 0 || (s->tls < 0 && is_tls_sock(so, sc)))) | |||||
cp->ulp_mode = ULP_MODE_TLS; | |||||
else if (s->ddp > 0 || | |||||
(s->ddp < 0 && sc->tt.ddp && (so_options_get(so) & SO_NO_DDP) == 0)) | (s->ddp < 0 && sc->tt.ddp && (so_options_get(so) & SO_NO_DDP) == 0)) | ||||
cp->ulp_mode = ULP_MODE_TCPDDP; | cp->ulp_mode = ULP_MODE_TCPDDP; | ||||
else | else | ||||
cp->ulp_mode = ULP_MODE_NONE; | cp->ulp_mode = ULP_MODE_NONE; | ||||
/* Rx coalescing. */ | /* Rx coalescing. */ | ||||
if (s->rx_coalesce >= 0) | if (s->rx_coalesce >= 0) | ||||
cp->rx_coalesce = s->rx_coalesce > 0 ? 1 : 0; | cp->rx_coalesce = s->rx_coalesce > 0 ? 1 : 0; | ||||
else if (cp->ulp_mode == ULP_MODE_TLS) | |||||
cp->rx_coalesce = 0; | |||||
else if (tt->rx_coalesce >= 0) | else if (tt->rx_coalesce >= 0) | ||||
cp->rx_coalesce = tt->rx_coalesce > 0 ? 1 : 0; | cp->rx_coalesce = tt->rx_coalesce > 0 ? 1 : 0; | ||||
else | else | ||||
cp->rx_coalesce = 1; /* default */ | cp->rx_coalesce = 1; /* default */ | ||||
/* | /* | ||||
* Index in the PMTU table. This controls the MSS that we announce in | * Index in the PMTU table. This controls the MSS that we announce in | ||||
* our SYN initially, but after ESTABLISHED it controls the MSS that we | * our SYN initially, but after ESTABLISHED it controls the MSS that we | ||||
▲ Show 20 Lines • Show All 735 Lines • Show Last 20 Lines |