]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_en: Add resilience in low memory systems
authorEugenia Emantayev <eugenia@mellanox.com>
Mon, 18 Jul 2016 15:35:12 +0000 (18:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Jul 2016 23:44:11 +0000 (16:44 -0700)
commit9d0750234dbf97837cf652cfc871a94590233ead
tree5562fa1edf8e165aed2a5cb8cce657c10f9c06f6
parentae5ee75403507adc6e184fa54a15ebd6efc1ef92
net/mlx4_en: Add resilience in low memory systems

This patch fixes the lost of Ethernet port on low memory system,
when driver frees its resources and fails to allocate new resources.
Issue could happen while changing number of channels, rings size or
changing the timestamp configuration.
This fix is necessary because of removing vmap use in the code.
When vmap was in use driver could allocate non-contiguous memory
and make it contiguous with vmap. Now it could fail to allocate
a large chunk of contiguous memory and lose the port.
Current code tries to allocate new resources and then upon success
frees the old resources.

Fixes: 63950a0862f2 ('net/mlx4: Avoid wrong virtual mappings')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h