s390/qeth: fix underestimated count of buffer elements

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/89271c65edd599207dd982007900506283c90ae3
Commit:     89271c65edd599207dd982007900506283c90ae3
Parent:     0bf7800f1799b5b1fd7d4f024e9ece53ac489011
Refname:    refs/heads/master
Author:     Ursula Braun <[email protected]>
AuthorDate: Fri Feb 9 11:03:49 2018 +0100
Committer:  David S. Miller <[email protected]>
CommitDate: Fri Feb 9 14:30:23 2018 -0500

    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: 2863c61334aa ("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]>
---
 drivers/s390/net/qeth_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index db42107bf2f5..c33fbc4c2e91 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -846,7 +846,7 @@ struct qeth_trap_id {
  */
 static inline int qeth_get_elements_for_range(addr_t start, addr_t end)
 {
-	return PFN_UP(end - 1) - PFN_DOWN(start);
+	return PFN_UP(end) - PFN_DOWN(start);
 }
 
 static inline int qeth_get_micros(void)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.