Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/cxgbei/cxgbei.c
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Lines | if (val & F_DDP_PDU && ip->ip_data_mbuf == NULL) { | ||||
* The difference between the end of the last burst | * The difference between the end of the last burst | ||||
* and the offset of the last PDU in this burst is | * and the offset of the last PDU in this burst is | ||||
* the additional data received via DDP. | * the additional data received via DDP. | ||||
*/ | */ | ||||
prev_seg_len = be32toh(bhsdo->bhsdo_buffer_offset) - | prev_seg_len = be32toh(bhsdo->bhsdo_buffer_offset) - | ||||
cmp->next_buffer_offset; | cmp->next_buffer_offset; | ||||
if (prev_seg_len != 0) { | if (prev_seg_len != 0) { | ||||
uint32_t orig_datasn; | |||||
/* | /* | ||||
* Since cfiscsi doesn't know about previous | * Return a "large" PDU representing the burst | ||||
* headers, pretend that the entire r2t data | * of PDUs. Adjust the offset and length of | ||||
* length was received in this single segment. | * this PDU to represent the entire burst. | ||||
*/ | */ | ||||
ip->ip_data_len += prev_seg_len; | ip->ip_data_len += prev_seg_len; | ||||
bhsdo->bhsdo_data_segment_len[2] = ip->ip_data_len; | bhsdo->bhsdo_data_segment_len[2] = ip->ip_data_len; | ||||
bhsdo->bhsdo_data_segment_len[1] = ip->ip_data_len >> 8; | bhsdo->bhsdo_data_segment_len[1] = ip->ip_data_len >> 8; | ||||
bhsdo->bhsdo_data_segment_len[0] = ip->ip_data_len >> 16; | bhsdo->bhsdo_data_segment_len[0] = ip->ip_data_len >> 16; | ||||
bhsdo->bhsdo_buffer_offset = | bhsdo->bhsdo_buffer_offset = | ||||
htobe32(cmp->next_buffer_offset); | htobe32(cmp->next_buffer_offset); | ||||
npdus = htobe32(bhsdo->bhsdo_datasn) - cmp->last_datasn; | orig_datasn = htobe32(bhsdo->bhsdo_datasn); | ||||
npdus = orig_datasn - cmp->last_datasn; | |||||
bhsdo->bhsdo_datasn = htobe32(cmp->last_datasn + 1); | |||||
cmp->last_datasn = orig_datasn; | |||||
ip->ip_additional_pdus = npdus - 1; | |||||
} else { | } else { | ||||
MPASS(htobe32(bhsdo->bhsdo_datasn) == | MPASS(htobe32(bhsdo->bhsdo_datasn) == | ||||
cmp->last_datasn + 1); | cmp->last_datasn + 1); | ||||
npdus = 1; | npdus = 1; | ||||
cmp->last_datasn = htobe32(bhsdo->bhsdo_datasn); | |||||
} | } | ||||
cmp->next_buffer_offset += ip->ip_data_len; | cmp->next_buffer_offset += ip->ip_data_len; | ||||
cmp->last_datasn = htobe32(bhsdo->bhsdo_datasn); | |||||
bhsdo->bhsdo_datasn = htobe32(cmp->next_datasn); | |||||
cmp->next_datasn++; | |||||
toep->ofld_rxq->rx_iscsi_ddp_pdus += npdus; | toep->ofld_rxq->rx_iscsi_ddp_pdus += npdus; | ||||
toep->ofld_rxq->rx_iscsi_ddp_octets += ip->ip_data_len; | toep->ofld_rxq->rx_iscsi_ddp_octets += ip->ip_data_len; | ||||
} else { | } else { | ||||
MPASS(icp->icp_flags & (ICPF_RX_FLBUF)); | MPASS(icp->icp_flags & (ICPF_RX_FLBUF)); | ||||
MPASS(ip->ip_data_len == ip->ip_data_mbuf->m_pkthdr.len); | MPASS(ip->ip_data_len == ip->ip_data_mbuf->m_pkthdr.len); | ||||
} | } | ||||
tp->rcv_nxt = icp->icp_seq + pdu_len; | tp->rcv_nxt = icp->icp_seq + pdu_len; | ||||
▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines |