Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b52a8b7f authored by Brice Goglin's avatar Brice Goglin Committed by Jeff Garzik
Browse files

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: default avatarBrice Goglin <brice@myri.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f761fae1
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -905,6 +905,14 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
		    (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) {
		    (rx->page_offset + bytes <= MYRI10GE_ALLOC_SIZE)) {
			/* we can use part of previous page */
			/* we can use part of previous page */
			get_page(rx->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 {
		} else {
			/* we need a new page */
			/* we need a new page */
			page =
			page =