RE: [PATCH net-next v2] net: mana: Improve mana_set_channels() in low mem conditions

Haiyang Zhang
2024-09-04T19:33:15Z

> -----Original Message-----
> From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Sent: Sunday, September 1, 2024 11:46 PM
> To: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-rdma@vger.kernel.org
> Cc: Shradha Gupta <shradhagupta@linux.microsoft.com>; KY Srinivasan
> <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Wei Liu
> <wei.liu@kernel.org>; Dexuan Cui <decui@microsoft.com>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski
> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Long Li
> <longli@microsoft.com>; Simon Horman <horms@kernel.org>; Konstantin
> Taranov <kotaranov@microsoft.com>; Souradeep Chakrabarti
> <schakrabarti@linux.microsoft.com>; Erick Archer
> <erick.archer@outlook.com>; Pavan Chebbi <pavan.chebbi@broadcom.com>;
> Ahmed Zaki <ahmed.zaki@intel.com>; Colin Ian King
> <colin.i.king@gmail.com>; Shradha Gupta <shradhagupta@microsoft.com>
> Subject: [PATCH net-next v2] 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>

Thanks.
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>