The mana_set_channels() function requires detaching the mana
driver and reattaching it with changed channel values.
During this operation if the system is low on memory, the reattach
might fail, causing the network device being down.
To avoid this we pre-allocate buffers at the beginning of set operation,
to prevent complete network loss
Signed-off-by: Shradha Gupta <shradhagupta@xxxxxxxxxxxxxxxxxxx>
---
Changes in v2
* Pass num_queues as argument in mana_pre_alloc_rxbufs()
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++--
.../ethernet/microsoft/mana/mana_ethtool.c | 28 ++++++++++---------
include/net/mana/mana.h | 2 +-
3 files changed, 19 insertions(+), 17 deletions(-)