Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
Show First 20 Lines • Show All 569 Lines • ▼ Show 20 Lines | send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) | ||||
if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) | if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) | ||||
toep->txsd_pidx = 0; | toep->txsd_pidx = 0; | ||||
toep->txsd_avail--; | toep->txsd_avail--; | ||||
t4_wrq_tx(sc, wr); | t4_wrq_tx(sc, wr); | ||||
} | } | ||||
static void | static void | ||||
set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, int hcrc, int dcrc) | set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, u_int ulp_submode) | ||||
{ | { | ||||
uint64_t val = ULP_MODE_ISCSI; | uint64_t val; | ||||
if (hcrc) | CTR3(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, submode=%#x", | ||||
val |= ULP_CRC_HEADER << 4; | __func__, toep->tid, ulp_submode); | ||||
if (dcrc) | |||||
val |= ULP_CRC_DATA << 4; | |||||
CTR4(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, CRC hdr=%d data=%d", | val = V_TCB_ULP_TYPE(ULP_MODE_ISCSI) | V_TCB_ULP_RAW(ulp_submode); | ||||
__func__, toep->tid, hcrc, dcrc); | |||||
t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_ULP_TYPE, | t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_ULP_TYPE, | ||||
V_TCB_ULP_TYPE(M_TCB_ULP_TYPE) | V_TCB_ULP_RAW(M_TCB_ULP_RAW), val, | V_TCB_ULP_TYPE(M_TCB_ULP_TYPE) | V_TCB_ULP_RAW(M_TCB_ULP_RAW), val, | ||||
0, 0); | 0, 0); | ||||
} | } | ||||
/* | /* | ||||
* XXXNP: Who is responsible for cleaning up the socket if this returns with an | * XXXNP: Who is responsible for cleaning up the socket if this returns with an | ||||
* error? Review all error paths. | * error? Review all error paths. | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | if (ic->ic_data_crc32c) { | ||||
ic->ic_max_data_segment_length -= | ic->ic_max_data_segment_length -= | ||||
ISCSI_DATA_DIGEST_SIZE; | ISCSI_DATA_DIGEST_SIZE; | ||||
} | } | ||||
so->so_options |= SO_NO_DDP; | so->so_options |= SO_NO_DDP; | ||||
toep->params.ulp_mode = ULP_MODE_ISCSI; | toep->params.ulp_mode = ULP_MODE_ISCSI; | ||||
toep->ulpcb = icc; | toep->ulpcb = icc; | ||||
send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); | send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); | ||||
set_ulp_mode_iscsi(icc->sc, toep, ic->ic_header_crc32c, | set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); | ||||
ic->ic_data_crc32c); | |||||
error = 0; | error = 0; | ||||
} | } | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
if (error == 0) { | if (error == 0) { | ||||
error = icl_cxgbei_setsockopt(ic, so, ci->max_tx_pdu_len, | error = icl_cxgbei_setsockopt(ic, so, ci->max_tx_pdu_len, | ||||
ci->max_rx_pdu_len); | ci->max_rx_pdu_len); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 384 Lines • Show Last 20 Lines |