mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 08:39:52 +00:00
IB/iser: Add missing counter increment in iser_data_buf_aligned_len()
While adding sg chaining support to iSER, a "for" loop was replaced with a "for_each_sg" loop. The "for" loop included the incrementation of 2 variables. Only one of them is incremented in the current "for_each_sg" loop. This caused iSER to think that all data is unaligned, and all data was copied to aligned buffers. This patch increments the missing counter inside the "for_each_sg" loop whenever necessary. Signed-off-by: Erez Zilber <erezz@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
3fe2ed344d
commit
a316b79c33
@ -310,13 +310,15 @@ static unsigned int iser_data_buf_aligned_len(struct iser_data_buf *data,
|
|||||||
if (i + 1 < data->dma_nents) {
|
if (i + 1 < data->dma_nents) {
|
||||||
next_addr = ib_sg_dma_address(ibdev, sg_next(sg));
|
next_addr = ib_sg_dma_address(ibdev, sg_next(sg));
|
||||||
/* are i, i+1 fragments of the same page? */
|
/* are i, i+1 fragments of the same page? */
|
||||||
if (end_addr == next_addr)
|
if (end_addr == next_addr) {
|
||||||
|
cnt++;
|
||||||
continue;
|
continue;
|
||||||
else if (!IS_4K_ALIGNED(end_addr)) {
|
} else if (!IS_4K_ALIGNED(end_addr)) {
|
||||||
ret_len = cnt + 1;
|
ret_len = cnt + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cnt++;
|
||||||
}
|
}
|
||||||
if (i == data->dma_nents)
|
if (i == data->dma_nents)
|
||||||
ret_len = cnt; /* loop ended */
|
ret_len = cnt; /* loop ended */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user