[PATCH net v2 0/2] net/smc: Fix effective buffer size

Gerd Bayer posted 2 patches 2 years, 1 month ago
There is a newer version of this series
net/smc/af_smc.c     | 77 ++++++++++++++++++++++++++++++--------------
net/smc/smc.h        |  2 +-
net/smc/smc_clc.c    |  4 +--
net/smc/smc_core.c   | 25 +++++++-------
net/smc/smc_sysctl.c | 10 ++++--
5 files changed, 76 insertions(+), 42 deletions(-)
[PATCH net v2 0/2] net/smc: Fix effective buffer size
Posted by Gerd Bayer 2 years, 1 month ago
Hi all,

commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock
and make them tunable") started to derive the effective buffer size for
SMC connections inconsistently in case a TCP fallback was used and
memory consumption of SMC with the default settings was doubled when
a connection negotiated SMC. That was not what we want.

This series consolidates the resulting effective buffer size that is
used with SMC sockets, which is based on Jan Karcher's effort (see 
[1]). For all TCP exchanges (in particular in case of a fall back when
no SMC connection was possible) the values from net.ipv4.tcp_[rw]mem
are used. If SMC succeeds in establishing a SMC connection, the newly
introduced values from net.smc.[rw]mem are used.

net.smc.[rw]mem is initialized to 64kB, respectively. Internal test 
have show this to be a good compromise between throughput/latency 
and memory consumption. Also net.smc.[rw]mem is now decoupled completely
from any tuning through net.ipv4.tcp_[rw]mem.

If a user chose to tune a socket's receive or send buffer size with
setsockopt, this tuning is now consistently applied to either fall-back
TCP or proper SMC connections over the socket.

Thanks,
Gerd 

v1 - v2:
 - In second patch, use sock_net() helper as suggested by Tony and demanded
   by kernel test robot.

[1] https://lore.kernel.org/netdev/20221123104907.14624-1-jaka@linux.ibm.com


Gerd Bayer (2):
  net/smc: Fix setsockopt and sysctl to specify same buffer size again
  net/smc: Use correct buffer sizes when switching between TCP and SMC

 net/smc/af_smc.c     | 77 ++++++++++++++++++++++++++++++--------------
 net/smc/smc.h        |  2 +-
 net/smc/smc_clc.c    |  4 +--
 net/smc/smc_core.c   | 25 +++++++-------
 net/smc/smc_sysctl.c | 10 ++++--
 5 files changed, 76 insertions(+), 42 deletions(-)


base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4
-- 
2.41.0
Re: [PATCH net v2 0/2] net/smc: Fix effective buffer size
Posted by Simon Horman 2 years, 1 month ago
On Thu, Aug 03, 2023 at 04:46:03PM +0200, Gerd Bayer wrote:
> Hi all,
> 
> commit 0227f058aa29 ("net/smc: Unbind r/w buffer size from clcsock
> and make them tunable") started to derive the effective buffer size for
> SMC connections inconsistently in case a TCP fallback was used and
> memory consumption of SMC with the default settings was doubled when
> a connection negotiated SMC. That was not what we want.
> 
> This series consolidates the resulting effective buffer size that is
> used with SMC sockets, which is based on Jan Karcher's effort (see 
> [1]). For all TCP exchanges (in particular in case of a fall back when
> no SMC connection was possible) the values from net.ipv4.tcp_[rw]mem
> are used. If SMC succeeds in establishing a SMC connection, the newly
> introduced values from net.smc.[rw]mem are used.
> 
> net.smc.[rw]mem is initialized to 64kB, respectively. Internal test 
> have show this to be a good compromise between throughput/latency 
> and memory consumption. Also net.smc.[rw]mem is now decoupled completely
> from any tuning through net.ipv4.tcp_[rw]mem.
> 
> If a user chose to tune a socket's receive or send buffer size with
> setsockopt, this tuning is now consistently applied to either fall-back
> TCP or proper SMC connections over the socket.
> 
> Thanks,
> Gerd 
> 
> v1 - v2:
>  - In second patch, use sock_net() helper as suggested by Tony and demanded
>    by kernel test robot.
> 
> [1] https://lore.kernel.org/netdev/20221123104907.14624-1-jaka@linux.ibm.com

Hi Gerd,

unfortunately this patchset does not appear to apply to current 'net'.

Could you rebase and send a v3?

-- 
pw-bot: changes-requested
Re: [PATCH net v2 0/2] net/smc: Fix effective buffer size
Posted by Gerd Bayer 2 years, 1 month ago
On Fri, 2023-08-04 at 16:17 +0200, Simon Horman wrote:
> On Thu, Aug 03, 2023 at 04:46:03PM +0200, Gerd Bayer wrote:
> > Hi all,
> > 
[...]
> > v1 - v2:
> >  - In second patch, use sock_net() helper as suggested by Tony and
> > demanded
> >    by kernel test robot.
> > 
> > [1]
> > https://lore.kernel.org/netdev/20221123104907.14624-1-jaka@linux.ibm.com
> 
> Hi Gerd,
> 
> unfortunately this patchset does not appear to apply to current
> 'net'.
> 
> Could you rebase and send a v3?
> 
Hi Simon,

sure, working on it.

Thanks,
Gerd