net/mlx4_en: Fix pages never dma unmapped on rx
authorAmir Vadai <amirv@mellanox.com>
Mon, 7 Oct 2013 11:38:13 +0000 (13:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Oct 2013 20:09:50 +0000 (16:09 -0400)
This patch fixes a bug introduced by commit 51151a16 (mlx4: allow
order-0 memory allocations in RX path).

dma_unmap_page never reached because condition to detect last fragment
in page is wrong. offset+frag_stride can't be greater than size, need to
make sure no additional frag will fit in page => compare offset +
frag_stride + next_frag_size instead.
next_frag_size is the same as the current one, since page is shared only
with frags of the same size.

CC: Eric Dumazet <edumazet@google.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found