mlog(1, " local sge[%d] addr %p len %d lkey 0x%x\n",
i, m_sge->addr, m_sge->length, m_sge->lkey);
- m_sge++;
l_len -= seg_len;
r_off += seg_len;
- total_len += (seg_len - cacheln_off);
- len -= (seg_len - cacheln_off);
+ total_len += m_sge->length;
+ len -= m_sge->length;
cacheln_off = 0; /* only apply to the first segment of a sge */
+ m_sge++;
/* if enough for this WR, then set up DMA signal, and move to next WR */
if (seg_len == m_qp->m_seg || i == pmsg->wr.num_sge - 1) {