Skip to content

Commit e048fc5

Browse files
edumazetdavem330
authored andcommitted
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: 4415a03 ("net/mlx5e: Implement RX mapped page cache for page recycle") Signed-off-by: Eric Dumazet <[email protected]> Cc: Tariq Toukan <[email protected]> Cc: Saeed Mahameed <[email protected]> Acked-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cdb749c commit e048fc5

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+3
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ static inline bool mlx5e_rx_cache_put(struct mlx5e_rq *rq,
193193
return false;
194194
}
195195

196+
if (unlikely(page_is_pfmemalloc(dma_info->page)))
197+
return false;
198+
196199
cache->page_cache[cache->tail] = *dma_info;
197200
cache->tail = tail_next;
198201
return true;

0 commit comments

Comments
 (0)