net: mana: Fix MANA VF unload when hardware is unresponsive
authorSouradeep Chakrabarti <schakrabarti@linux.microsoft.com>
Wed, 9 Aug 2023 10:22:05 +0000 (03:22 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Aug 2023 17:27:58 +0000 (10:27 -0700)
commita7dfeda6fdeccab4c7c3dce9a72c4262b9530c80
treef693e94900a31d638a191fe4e2955cb0da240d53
parent048c796beb6eb4fa3a5a647ee1c81f5c6f0f6a2a
net: mana: Fix MANA VF unload when hardware is unresponsive

When unloading the MANA driver, mana_dealloc_queues() waits for the MANA
hardware to complete any inflight packets and set the pending send count
to zero. But if the hardware has failed, mana_dealloc_queues()
could wait forever.

Fix this by adding a timeout to the wait. Set the timeout to 120 seconds,
which is a somewhat arbitrary value that is more than long enough for
functional hardware to complete any sends.

Cc: stable@vger.kernel.org
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Souradeep Chakrabarti <schakrabarti@linux.microsoft.com>
Link: https://lore.kernel.org/r/1691576525-24271-1-git-send-email-schakrabarti@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_en.c