2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 13:13:57 +08:00

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 <brice@myri.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Brice Goglin 2007-03-21 19:46:57 +01:00 committed by Jeff Garzik
parent f761fae1ae
commit b52a8b7f0a

View File

@ -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 =