cifs: distribute channels across interfaces based on speed
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 26 Dec 2022 11:24:56 +0000 (11:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:33:08 +0000 (07:33 +0100)
commit1cd8c353708de99d8bfa7db8a0c961a800b1fa7f
tree5db8ddc0d1b4eba160379c9ba21435890c596ea4
parent7e2cde1813418b39b5e95d86e10d6701dccf18af
cifs: distribute channels across interfaces based on speed

[ Upstream commit a6d8fb54a515f0546ffdb7870102b1238917e567 ]

Today, if the server interfaces RSS capable, we simply
choose the fastest interface to setup a channel. This is not
a scalable approach, and does not make a lot of attempt to
distribute the connections.

This change does a weighted distribution of channels across
all the available server interfaces, where the weight is
a function of the advertised interface speed.

Also make sure that we don't mix rdma and non-rdma for channels.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Stable-dep-of: fa1d0508bdd4 ("cifs: account for primary channel in the interface list")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cifs_debug.c
fs/smb/client/cifsglob.h
fs/smb/client/sess.c