From: Eric Dumazet <hidden> Date: 2017-02-18 18:34:58
From: Eric Dumazet <edumazet@google.com>
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: 51151a16a60f ("mlx4: allow order-0 memory allocations in RX path")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -102,7 +102,8 @@/* Use the maximum between 16384 and a single page */#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*and4Kallocations)*/
From: Eric Dumazet <edumazet@google.com>
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: 51151a16a60f ("mlx4: allow order-0 memory allocations in RX path")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -102,7 +102,8 @@/* Use the maximum between 16384 and a single page */#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*and4Kallocations)*/
From: David Miller <davem@davemloft.net> Date: 2017-02-20 15:32:10
From: Eric Dumazet <redacted>
Date: Sat, 18 Feb 2017 10:34:18 -0800
From: Eric Dumazet <edumazet@google.com>
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: 51151a16a60f ("mlx4: allow order-0 memory allocations in RX path")
Signed-off-by: Eric Dumazet <edumazet@google.com>