Skip to content

Commit 89271c6

Browse files
Ursula Braundavem330
authored andcommitted
s390/qeth: fix underestimated count of buffer elements
For a memory range/skb where the last byte falls onto a page boundary (ie. 'end' is of the form xxx...xxx001), the PFN_UP() part of the calculation currently doesn't round up to the next PFN due to an off-by-one error. Thus qeth believes that the skb occupies one page less than it actually does, and may select a IO buffer that doesn't have enough spare buffer elements to fit all of the skb's data. HW detects this as a malformed buffer descriptor, and raises an exception which then triggers device recovery. Fixes: 2863c61 ("qeth: refactor calculation of SBALE count") Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0bf7800 commit 89271c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ struct qeth_trap_id {
846846
*/
847847
static inline int qeth_get_elements_for_range(addr_t start, addr_t end)
848848
{
849-
return PFN_UP(end - 1) - PFN_DOWN(start);
849+
return PFN_UP(end) - PFN_DOWN(start);
850850
}
851851

852852
static inline int qeth_get_micros(void)

0 commit comments

Comments
 (0)