cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved

in work requests that end at the end of the descriptor ring, even though
the pidx wraps around to 0.

MFC after:	3 days
This commit is contained in:
Navdeep Parhar 2017-01-09 22:18:08 +00:00
parent 129adb62dc
commit f50c49cca7

View File

@ -2298,7 +2298,7 @@ start_wrq_wr(struct sge_wrq *wrq, int len16, struct wrq_cookie *cookie)
w = &eq->desc[eq->pidx];
IDXINCR(eq->pidx, ndesc, eq->sidx);
if (__predict_false(eq->pidx < ndesc - 1)) {
if (__predict_false(cookie->pidx + ndesc > eq->sidx)) {
w = &wrq->ss[0];
wrq->ss_pidx = cookie->pidx;
wrq->ss_len = len16 * 16;