Commit d4165e3a authored by Henry Orosco's avatar Henry Orosco Committed by Doug Ledford

i40iw: Fix incorrect assignment of SQ head

The SQ head is incorrectly incremented when the number
of WQEs required is greater than the number available.
The fix is to use the I40IW_RING_MOV_HEAD_BY_COUNT
macro. This checks for the SQ full condition first and
only if SQ has room for the request, then we move the
head appropriately.
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarHenry Orosco <henry.orosco@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 78e945aa
...@@ -175,12 +175,10 @@ u64 *i40iw_qp_get_next_send_wqe(struct i40iw_qp_uk *qp, ...@@ -175,12 +175,10 @@ u64 *i40iw_qp_get_next_send_wqe(struct i40iw_qp_uk *qp,
if (!*wqe_idx) if (!*wqe_idx)
qp->swqe_polarity = !qp->swqe_polarity; qp->swqe_polarity = !qp->swqe_polarity;
} }
I40IW_RING_MOVE_HEAD_BY_COUNT(qp->sq_ring,
for (i = 0; i < wqe_size / I40IW_QP_WQE_MIN_SIZE; i++) { wqe_size / I40IW_QP_WQE_MIN_SIZE, ret_code);
I40IW_RING_MOVE_HEAD(qp->sq_ring, ret_code); if (ret_code)
if (ret_code) return NULL;
return NULL;
}
wqe = qp->sq_base[*wqe_idx].elem; wqe = qp->sq_base[*wqe_idx].elem;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment