diff options
author | Shradha Gupta <shradhagupta@linux.microsoft.com> | 2024-09-01 20:45:34 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-09-04 16:28:51 -0700 |
commit | 1705341485ff1eec097dfa26891d03afe5907e16 (patch) | |
tree | 7cc6d82566ddb862d9c1b5d3b9df737421b1b088 /include/net | |
parent | 7808012003004b5b31e24795af33480d5eed20f1 (diff) |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/mana/mana.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h index 1f869624811d..dfbf78d4e557 100644 --- a/include/net/mana/mana.h +++ b/include/net/mana/mana.h @@ -488,7 +488,7 @@ struct bpf_prog *mana_xdp_get(struct mana_port_context *apc); void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog); int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf); void mana_query_gf_stats(struct mana_port_context *apc); -int mana_pre_alloc_rxbufs(struct mana_port_context *apc, int mtu); +int mana_pre_alloc_rxbufs(struct mana_port_context *apc, int mtu, int num_queues); void mana_pre_dealloc_rxbufs(struct mana_port_context *apc); extern const struct ethtool_ops mana_ethtool_ops; |