From: Brice Goglin Date: Wed, 21 Mar 2007 18:46:57 +0000 (+0100) Subject: myri10ge: fix management of >4kB allocated pages X-Git-Tag: v2.6.21-rc5~21^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b52a8b7f0aeff5b91921cd53728ac781cdb4cccf;p=linux-2.6-omap-h63xx.git myri10ge: fix management of >4kB allocated pages Fix management of allocated physical pages when the architecture page size is not 4kB since the firmware cannot cross 4K boundary. Signed-off-by: Brice Goglin Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 2449b9fd736..c89ca3fec16 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -905,6 +905,14 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx, (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) { /* we can use part of previous page */ get_page(rx->page); +#if MYRI10GE_ALLOC_SIZE > 4096 + /* Firmware cannot cross 4K boundary.. */ + if ((rx->page_offset >> 12) != + ((rx->page_offset + bytes - 1) >> 12)) { + rx->page_offset = + (rx->page_offset + bytes) & ~4095; + } +#endif } else { /* we need a new page */ page =