Skip to content

Commit 961efcd

Browse files
edumazetgregkh
authored andcommitted
gianfar: Do not reuse pages from emergency reserve
[ Upstream commit 69fed99baac186013840ced3524562841296034f ] A driver using dev_alloc_page() must not reuse a page that had to use emergency memory reserve. Otherwise all packets using this page will be immediately dropped, unless for very specific sockets having SOCK_MEMALLOC bit set. This issue might be hard to debug, because only a fraction of the RX ring buffer would suffer from drops. Fixes: 7535414 ("gianfar: Add paged allocation and Rx S/G") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Claudiu Manoil <claudiu.manoil@freescale.com> Acked-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 477a235 commit 961efcd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2939,7 +2939,7 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus,
29392939
size, GFAR_RXB_TRUESIZE);
29402940

29412941
/* try reuse page */
2942-
if (unlikely(page_count(page) != 1))
2942+
if (unlikely(page_count(page) != 1 || page_is_pfmemalloc(page)))
29432943
return false;
29442944

29452945
/* change offset to the other half */

0 commit comments

Comments
 (0)