提交 e048fc50 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net/mlx5e: Do not recycle pages from emergency reserve

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: 4415a031 ("net/mlx5e: Implement RX mapped page cache for page recycle")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Acked-by: NSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cdb749ce
...@@ -193,6 +193,9 @@ static inline bool mlx5e_rx_cache_put(struct mlx5e_rq *rq, ...@@ -193,6 +193,9 @@ static inline bool mlx5e_rx_cache_put(struct mlx5e_rq *rq,
return false; return false;
} }
if (unlikely(page_is_pfmemalloc(dma_info->page)))
return false;
cache->page_cache[cache->tail] = *dma_info; cache->page_cache[cache->tail] = *dma_info;
cache->tail = tail_next; cache->tail = tail_next;
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册