netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve
@ 2017-01-19  7:03 Eric Dumazet
  2017-01-19 19:14 ` Saeed Mahameed
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eric Dumazet @ 2017-01-19  7:03 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Tariq Toukan, Saeed Mahameed

From: Eric Dumazet <edumazet@google.com>

A driver using dev_alloc_page() must not reuse a page allocated from
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 received
packets would be dropped.

Fixes: 4415a0319f92 ("net/mlx5e: Implement RX mapped page cache for page recycle")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 0e2fb3ed1790900ccdc0bbbef8bc5c33267df092..ce46409bde2736ea4d1246ca97855098f052f271 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -193,6 +193,9 @@ static inline bool mlx5e_rx_cache_put(struct mlx5e_rq *rq,
 		return false;
 	}
 
+	if (unlikely(page_is_pfmemalloc(dma_info->page)))
+		return false;
+
 	cache->page_cache[cache->tail] = *dma_info;
 	cache->tail = tail_next;
 	return true;

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-01-24  9:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19  7:03 [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve Eric Dumazet
2017-01-19 19:14 ` Saeed Mahameed
2017-01-19 19:25   ` Eric Dumazet
2017-01-19 19:39     ` Saeed Mahameed
2017-01-21 18:09   ` Tom Herbert
     [not found]     ` <CAPe+=50xs=MMqxHPgTiGa3qytL7633Cygf_vBWuAuq=ceLyacg@mail.gmail.com>
2017-01-21 19:26       ` Eric Dumazet
2017-01-23  9:14         ` Jesper Dangaard Brouer
2017-01-24  9:21           ` Saeed Mahameed
2017-01-21 20:31       ` Saeed Mahameed
2017-01-22 17:50         ` Tom Herbert
2017-01-24  9:29           ` Saeed Mahameed
2017-01-23  8:39         ` Jesper Dangaard Brouer
2017-01-23 15:45           ` David Miller
2017-01-22 18:09       ` Tom Herbert
2017-01-20 10:28 ` Saeed Mahameed
2017-01-20 17:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).