mlx4: allow device removal by fixing dma unmap size
authorThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Mon, 6 Feb 2012 08:39:49 +0000 (08:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Feb 2012 19:42:28 +0000 (14:42 -0500)
commit68355f71132bec25e0d89b2d8d3ed01286307d31
tree3fc82e670f5946198fb2c657b9bf7c155f043440
parent4c41b3673759d096106e68bce586f103c51d4119
mlx4: allow device removal by fixing dma unmap size

After opening the network interface, Mellanox ConnectX device cannot be
removed by hotplug because it has not properly unmapped all DMA memory.

It happens that mlx4_en_activate_rx_rings overrides the variable that
keeps the size of the memory mapped.

This is fixed by passing to mlx4_en_destroy_rx_ring the same size that is
given to mlx4_en_create_rx_ring.

After applying this patch, hot unplugging the device works after opening
the interface.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h