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

mlx4: reduce OOM risk on arches with large pages

Since mlx4 NIC are used on PowerPC with 64K pages, we need to adapt
MLX4_EN_ALLOC_PREFER_ORDER definition.

Otherwise, a fragment sitting in an out of order TCP queue can hold
0.5 Mbytes and it is a serious OOM risk.

Fixes: 51151a16 ("mlx4: allow order-0 memory allocations in RX path")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b9ef4ab3
...@@ -102,7 +102,8 @@ ...@@ -102,7 +102,8 @@
/* Use the maximum between 16384 and a single page */ /* Use the maximum between 16384 and a single page */
#define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384) #define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384)
#define MLX4_EN_ALLOC_PREFER_ORDER PAGE_ALLOC_COSTLY_ORDER #define MLX4_EN_ALLOC_PREFER_ORDER min_t(int, get_order(32768), \
PAGE_ALLOC_COSTLY_ORDER)
/* Receive fragment sizes; we use at most 3 fragments (for 9600 byte MTU /* Receive fragment sizes; we use at most 3 fragments (for 9600 byte MTU
* and 4K allocations) */ * and 4K allocations) */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册