]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: mana: Improve mana_set_channels() in low mem conditions
authorShradha Gupta <shradhagupta@linux.microsoft.com>
Mon, 2 Sep 2024 03:45:34 +0000 (20:45 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Sep 2024 23:28:51 +0000 (16:28 -0700)
commit1705341485ff1eec097dfa26891d03afe5907e16
tree7cc6d82566ddb862d9c1b5d3b9df737421b1b088
parent7808012003004b5b31e24795af33480d5eed20f1
net: mana: Improve mana_set_channels() in low mem conditions

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@linux.microsoft.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/1725248734-21760-1-git-send-email-shradhagupta@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_en.c
drivers/net/ethernet/microsoft/mana/mana_ethtool.c
include/net/mana/mana.h