Separate SMC parameter settings from TCP sysctls
Subsystems (5)
Wen Gu
reviewercover Separate SMC parameter settings from TCP sysctls
SMC shares some sysctls with TCP, but considering the difference between these two protocols, it may not be very suitable for SMC to reuse TCP parameter settings in some cases, such as keepalive time or buffer size.
So this patch set aims to introduce some SMC specific sysctls to independently and flexibly set the parameters that suit SMC.
Tony Lu (1):
net/smc: Unbind r/w buffer size from clcsock and make them tunable
Wen Gu (1):
net/smc: Introduce a specific sysctl for TEST_LINK time
Documentation/networking/smc-sysctl.rst | 25 ++++++++++++++++++++++++ include/net/netns/smc.h | 3 +++ net/smc/af_smc.c | 5 ++--- net/smc/smc_core.c | 8 ++++---- net/smc/smc_llc.c | 2 +- net/smc/smc_llc.h | 1 + net/smc/smc_sysctl.c | 34 +++++++++++++++++++++++++++++++++ 7 files changed, 70 insertions(+), 8 deletions(-)
Signature · 1 line
1.8.3.1
Wen Gu
reviewerPATCH 1/2 net/smc: Introduce a specific sysctl for TEST_LINK time
SMC-R tests the viability of link by sending out TEST_LINK LLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time).
But using tcp_keepalive_time as testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until get IB_WC_RETRY_EXC_ERR error CQEs, which takes more time than TEST_LINK timeout (SMC_LLC_WAIT_TIME) normally.
So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds.
[1] https://www.rfc-editor.org/rfc/rfc1122#page-101
--- Documentation/networking/smc-sysctl.rst | 7 +++++++ include/net/netns/smc.h | 1 + net/smc/smc_llc.c | 2 +- net/smc/smc_llc.h | 1 + net/smc/smc_sysctl.c | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 1 deletion(-)
Documentation/networking/smc-sysctl.rst +7 -0
@@ -34,3 +34,10 @@ smcr_buf_type - INTEGER - 1 - Use virtually contiguous buffers - 2 - Mixed use of the two types. Try physically contiguous buffers first. If not available, use virtually contiguous buffers then. + +smcr_testlink_time - INTEGER + How frequently SMC-R link sends out TEST_LINK LLC messages to confirm + viability, after the last activity of connections on it. The maximum + value is (INT_MAX / HZ) seconds, the minimum value is 1 second. + + Default: 30 seconds.
include/net/netns/smc.h +1 -0
@@ -19,5 +19,6 @@ struct netns_smc {#endif unsigned int sysctl_autocorking_size;unsigned int sysctl_smcr_buf_type; + int sysctl_smcr_testlink_time; };#endif
net/smc/smc_llc.c +1 -1
@@ -2127,7 +2127,7 @@ void smc_llc_lgr_init(struct smc_link_group *lgr, struct smc_sock *smc)init_waitqueue_head (&lgr->llc_flow_waiter);init_waitqueue_head (&lgr->llc_msg_waiter);mutex_init (&lgr->llc_conf_mutex); - lgr->llc_testlink_time =READ_ONCE (net->ipv4.sysctl_tcp_keepalive_time); + lgr->llc_testlink_time =READ_ONCE (net->smc.sysctl_smcr_testlink_time) *HZ ; }/* called after lgr was removed from lgr_list */
net/smc/smc_llc.h +1 -0
@@ -19,6 +19,7 @@#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30enum smc_llc_reqresp {SMC_LLC_REQ ,
net/smc/smc_sysctl.c +14 -0
@@ -16,8 +16,12 @@#include "smc.h" #include "smc_core.h" +#include "smc_llc.h" #include "smc_sysctl.h" +static int smcr_testlink_time_min =1 ; +static int smcr_testlink_time_max = (INT_MAX /HZ ); +static struct ctl_table smc_table[] = { { .procname ="autocorking_size" ,
@@ -35,6 +39,15 @@ .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_TWO, }, + { + .procname = "smcr_testlink_time", + .data = &init_net.smc.sysctl_smcr_testlink_time, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &smcr_testlink_time_min, + .extra2 = &smcr_testlink_time_max, + }, { } };
@@ -60,6 +73,7 @@ int __net_init smc_sysctl_net_init(struct net *net) net->smc.sysctl_autocorking_size =SMC_AUTOCORKING_DEFAULT_SIZE ; net->smc.sysctl_smcr_buf_type =SMCR_PHYS_CONT_BUFS ; + net->smc.sysctl_smcr_testlink_time =SMC_LLC_TESTLINK_DEFAULT_TIME ;return 0 ;
Signature · 1 line
1.8.3.1
Re: [PATCH net-next 1/2] net/smc: Introduce a specific sysctl for TEST_LINK time
Quoted 11 lines · Wen Gu
SMC-R tests the viability of link by sending out
TEST_LINKLLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time).But using
tcp_keepalive_timeas testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until getIB_WC_RETRY_EXC_ERRerror CQEs, which takes more time thanTEST_LINKtimeout (SMC_LLC_WAIT_TIME) normally.
Quoted 7 lines
So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds.
[1] https://www.rfc-editor.org/rfc/rfc1122#page-101
Signed-off-by Wen Gu <[email protected]>
LGTM.
Quoted 102 lines
--- Documentation/networking/smc-sysctl.rst | 7 +++++++ include/net/netns/smc.h | 1 + net/smc/smc_llc.c | 2 +- net/smc/smc_llc.h | 1 + net/smc/smc_sysctl.c | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 1 deletion(-)Documentation/networking/smc-sysctl.rst +7
-0@@ -34,3 +34,10 @@ smcr_buf_type - INTEGER - 1 - Use virtually contiguous buffers - 2 - Mixed use of the two types. Try physically contiguous buffers first. If not available, use virtually contiguous buffers then. + +smcr_testlink_time - INTEGER + How frequently SMC-R link sends out TEST_LINK LLC messages to confirm + viability, after the last activity of connections on it. The maximum + value is (INT_MAX / HZ) seconds, the minimum value is 1 second. + + Default: 30 seconds.include/net/netns/smc.h +1
-0@@ -19,5 +19,6 @@ struct netns_smc {#endif unsigned int sysctl_autocorking_size;unsigned int sysctl_smcr_buf_type; + int sysctl_smcr_testlink_time; };#endif net/smc/smc_llc.c +1
-1@@ -2127,7 +2127,7 @@ void smc_llc_lgr_init(struct smc_link_group *lgr, struct smc_sock *smc)init_waitqueue_head (&lgr->llc_flow_waiter);init_waitqueue_head (&lgr->llc_msg_waiter);mutex_init (&lgr->llc_conf_mutex); - lgr->llc_testlink_time =READ_ONCE (net->ipv4.sysctl_tcp_keepalive_time); + lgr->llc_testlink_time =READ_ONCE (net->smc.sysctl_smcr_testlink_time) *HZ ; }/* called after lgr was removed from lgr_list */ net/smc/smc_llc.h +1
-0@@ -19,6 +19,7 @@#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30enum smc_llc_reqresp {SMC_LLC_REQ ,net/smc/smc_sysctl.c +14
-0@@ -16,8 +16,12 @@#include "smc.h" #include "smc_core.h" +#include "smc_llc.h" #include "smc_sysctl.h" +static int smcr_testlink_time_min =1 ; +static int smcr_testlink_time_max = (INT_MAX /HZ ); +static struct ctl_table smc_table[] = { { .procname ="autocorking_size" ,@@ -35,6 +39,15 @@ .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_TWO, }, + { + .procname = "smcr_testlink_time", + .data = &init_net.smc.sysctl_smcr_testlink_time, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &smcr_testlink_time_min, + .extra2 = &smcr_testlink_time_max, + }, { } };@@ -60,6 +73,7 @@ int __net_init smc_sysctl_net_init(struct net *net) net->smc.sysctl_autocorking_size =SMC_AUTOCORKING_DEFAULT_SIZE ; net->smc.sysctl_smcr_buf_type =SMCR_PHYS_CONT_BUFS ; + net->smc.sysctl_smcr_testlink_time =SMC_LLC_TESTLINK_DEFAULT_TIME ;return 0 ;Signature · 1 line
1.8.3.1
dust.li
maintainerRe: [PATCH net-next 1/2] net/smc: Introduce a specific sysctl for TEST_LINK time
In reply to Wen GuQuoted 70 lines · Wen Gu
SMC-R tests the viability of link by sending out
TEST_LINKLLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time).But using
tcp_keepalive_timeas testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until getIB_WC_RETRY_EXC_ERRerror CQEs, which takes more time thanTEST_LINKtimeout (SMC_LLC_WAIT_TIME) normally.So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds.
[1] https://www.rfc-editor.org/rfc/rfc1122#page-101
Signed-off-by Wen Gu <[email protected]>---
Documentation/networking/smc-sysctl.rst | 7 +++++++ include/net/netns/smc.h | 1 + net/smc/smc_llc.c | 2 +- net/smc/smc_llc.h | 1 + net/smc/smc_sysctl.c | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 1 deletion(-)Documentation/networking/smc-sysctl.rst +7
-0@@ -34,3 +34,10 @@ smcr_buf_type - INTEGER - 1 - Use virtually contiguous buffers - 2 - Mixed use of the two types. Try physically contiguous buffers first. If not available, use virtually contiguous buffers then. + +smcr_testlink_time - INTEGER + How frequently SMC-R link sends out TEST_LINK LLC messages to confirm + viability, after the last activity of connections on it. The maximum + value is (INT_MAX / HZ) seconds, the minimum value is 1 second. + + Default: 30 seconds.include/net/netns/smc.h +1
-0@@ -19,5 +19,6 @@ struct netns_smc {#endif unsigned int sysctl_autocorking_size;unsigned int sysctl_smcr_buf_type; + int sysctl_smcr_testlink_time; };#endif net/smc/smc_llc.c +1
-1@@ -2127,7 +2127,7 @@ void smc_llc_lgr_init(struct smc_link_group *lgr, struct smc_sock *smc)init_waitqueue_head (&lgr->llc_flow_waiter);init_waitqueue_head (&lgr->llc_msg_waiter);mutex_init (&lgr->llc_conf_mutex); - lgr->llc_testlink_time =READ_ONCE (net->ipv4.sysctl_tcp_keepalive_time); + lgr->llc_testlink_time =READ_ONCE (net->smc.sysctl_smcr_testlink_time) *HZ ; }/* called after lgr was removed from lgr_list */ net/smc/smc_llc.h +0
-0
net/smc/smc_llc.h line 22
Quoted 4 lines
net/smc/smc_llc.h +1
-0@@ -19,6 +19,7 @@#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30
I'm wondering why we don't follow the upper to macros using (30 * HZ) ?
Quoted 46 lines
net/smc/smc_llc.h +0
-0enum smc_llc_reqresp {SMC_LLC_REQ ,net/smc/smc_sysctl.c +14
-0@@ -16,8 +16,12 @@#include "smc.h" #include "smc_core.h" +#include "smc_llc.h" #include "smc_sysctl.h" +static int smcr_testlink_time_min =1 ; +static int smcr_testlink_time_max = (INT_MAX /HZ ); +static struct ctl_table smc_table[] = { { .procname ="autocorking_size" ,@@ -35,6 +39,15 @@ .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_TWO, }, + { + .procname = "smcr_testlink_time", + .data = &init_net.smc.sysctl_smcr_testlink_time, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &smcr_testlink_time_min, + .extra2 = &smcr_testlink_time_max, + }, { } };@@ -60,6 +73,7 @@ int __net_init smc_sysctl_net_init(struct net *net) net->smc.sysctl_autocorking_size =SMC_AUTOCORKING_DEFAULT_SIZE ; net->smc.sysctl_smcr_buf_type =SMCR_PHYS_CONT_BUFS ; + net->smc.sysctl_smcr_testlink_time =SMC_LLC_TESTLINK_DEFAULT_TIME ;return 0 ;Signature · 1 line
1.8.3.1
Wen Gu
reviewerRe: [PATCH net-next 1/2] net/smc: Introduce a specific sysctl for TEST_LINK time
Quoted 28 lines · dust.li
Quoted 27 lines · Wen Gu
SMC-R tests the viability of link by sending out
TEST_LINKLLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time).But using
tcp_keepalive_timeas testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until getIB_WC_RETRY_EXC_ERRerror CQEs, which takes more time thanTEST_LINKtimeout (SMC_LLC_WAIT_TIME) normally.So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds.
[1] https://www.rfc-editor.org/rfc/rfc1122#page-101
Signed-off-by Wen Gu <[email protected]>---
/* called after lgr was removed from
lgr_list*/net/smc/smc_llc.h +0
-0@@ -19,6 +19,7 @@
Quoted 6 lines
net/smc/smc_llc.h line 22
Quoted 3 lines
net/smc/smc_llc.h +1
-0#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30I'm wondering why we don't follow the upper to macros using (30 * HZ) ?
Thanks for the reivew.
Because the value of sysctl_smcr_testlink_time is in seconds, and the value of llc_testlink_time is jiffies.
I have thought about
1) using proc_dointvec_jiffies as sysctl's proc_handler just like TCP does. But proc_dointvec_jiffies has no minimum limit, value 0 makes no sense for SMC testlink.
2) using proc_dointvec_ms_jiffies_minmax as proc_handler. But millisecond interval seems expensive for SMC test link.
So, I choose to use proc_dointvec_minmax, make sysctl_smcr_testlink_time in seconds, and convert to jiffies when assigning to llc_testlink_time.
Thanks,
Wen Gu.
dust.li
maintainerRe: [PATCH net-next 1/2] net/smc: Introduce a specific sysctl for TEST_LINK time
Quoted 38 lines · Wen Gu
Quoted 28 lines · dust.li
Quoted 27 lines · Wen Gu
SMC-R tests the viability of link by sending out
TEST_LINKLLC messages over RoCE fabric when connections on link have been idle for a time longer than keepalive interval (testlink time).But using
tcp_keepalive_timeas testlink time maybe not quite suitable because it is default no less than two hours[1], which is too long for single link to find peer dead. The active host will still use peer-dead link (QP) sending messages, and can't find out until getIB_WC_RETRY_EXC_ERRerror CQEs, which takes more time thanTEST_LINKtimeout (SMC_LLC_WAIT_TIME) normally.So this patch introduces a independent sysctl for SMC-R to set link keepalive time, in order to detect link down in time. The default value is 30 seconds.
[1] https://www.rfc-editor.org/rfc/rfc1122#page-101
Signed-off-by Wen Gu <[email protected]>---
/* called after lgr was removed from
lgr_list*/net/smc/smc_llc.h +0
-0@@ -19,6 +19,7 @@Quoted 6 lines
net/smc/smc_llc.h line 22
Quoted 3 lines
net/smc/smc_llc.h +1
-0#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30I'm wondering why we don't follow the upper to macros using (30 * HZ) ?
Quoted 8 lines
Thanks for the reivew.
Because the value of
sysctl_smcr_testlink_timeis in seconds, and the value ofllc_testlink_timeis jiffies.I have thought about
1) usingproc_dointvec_jiffiesas sysctl'sproc_handlerjust like TCP does. Butproc_dointvec_jiffieshas no minimum limit, value 0 makes no sense for SMC testlink.
Maybe 0 means disable the LLC TEST LINK ?
Quoted 5 lines
2) using
proc_dointvec_ms_jiffies_minmaxasproc_handler. But millisecond interval seems expensive for SMC test link.So, I choose to use
proc_dointvec_minmax, makesysctl_smcr_testlink_timein seconds, and convert to jiffies when assigning tollc_testlink_time.
If proc_dointvec_jiffies_minmax is really the problem, maybe you can write your own proc handler.
Thanks
Wen Gu
reviewerRe: [PATCH net-next 1/2] net/smc: Introduce a specific sysctl for TEST_LINK time
Quoted 28 lines · dust.li
Quoted 15 lines · Wen Gu
Quoted 11 lines · dust.li
net/smc/smc_llc.h line 22
Quoted 6 lines · Wen Gu
+++
b/net/smc/smc_llc.hnet/smc/smc_llc.h +1
-0@@ -19,6 +19,7 @@#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)#define SMC_LLC_WAIT_TIME (2 * HZ) +#define SMC_LLC_TESTLINK_DEFAULT_TIME 30I'm wondering why we don't follow the upper to macros using (30 * HZ) ?
Quoted 8 lines
Thanks for the reivew.
Because the value of
sysctl_smcr_testlink_timeis in seconds, and the value ofllc_testlink_timeis jiffies.I have thought about
1) usingproc_dointvec_jiffiesas sysctl'sproc_handlerjust like TCP does. Butproc_dointvec_jiffieshas no minimum limit, value 0 makes no sense for SMC testlink.Maybe 0 means disable the LLC TEST LINK ?
Quoted 9 lines
Quoted 5 lines
2) using
proc_dointvec_ms_jiffies_minmaxasproc_handler. But millisecond interval seems expensive for SMC test link.So, I choose to use
proc_dointvec_minmax, makesysctl_smcr_testlink_timein seconds, and convert to jiffies when assigning tollc_testlink_time.If
proc_dointvec_jiffies_minmaxis really the problem, maybe you can write your own proc handler.
Oops, I didn't noticed that value 0 means disabling LLC testlink in smc_llc_link_active().
So no need to set the minimum limit and proc_dointvec_jiffies will be fine. I will send a v2 to improve it.
Thanks,
Wen Gu
Wen Gu
reviewerPATCH 2/2 net/smc: Unbind r/w buffer size from clcsock and make them tunable
In reply to Wen GuFrom: Tony Lu <[email protected]>
Currently, SMC uses smc->sk.sk_{rcv|snd}buf to create buffers for send buffer and RMB. And the values of buffer size are from tcp_{w|r}mem in clcsock.
The buffer size from TCP socket doesn't fit SMC well. Generally, buffers are usually larger than TCP for SMC-R/-D to get higher performance, for they are different underlay devices and paths.
So this patch unbinds buffer size from TCP, and introduces two sysctl knobs to tune them independently. Also, these knobs are per net namespace and work for containers.
--- Documentation/networking/smc-sysctl.rst | 18 ++++++++++++++++++ include/net/netns/smc.h | 2 ++ net/smc/af_smc.c | 5 ++--- net/smc/smc_core.c | 8 ++++---- net/smc/smc_sysctl.c | 20 ++++++++++++++++++++ 5 files changed, 46 insertions(+), 7 deletions(-)
Documentation/networking/smc-sysctl.rst +18 -0
@@ -41,3 +41,21 @@ smcr_testlink_time - INTEGER value is (INT_MAX / HZ) seconds, the minimum value is 1 second. Default: 30 seconds. + +wmem - INTEGER + Initial size of send buffer used by SMC sockets. + The default value inherits from net.ipv4.tcp_wmem[1]. + + The minimum value is 16KiB and there is no hard limit for max value, but + only allowed 512KiB for SMC-R and 1MiB for SMC-D. + + Default: 16K + +rmem - INTEGER + Initial size of receive buffer (RMB) used by SMC sockets. + The default value inherits from net.ipv4.tcp_rmem[1]. + + The minimum value is 16KiB and there is no hard limit for max value, but + only allowed 512KiB for SMC-R and 1MiB for SMC-D. + + Default: 128K
include/net/netns/smc.h +2 -0
@@ -20,5 +20,7 @@ struct netns_smc {unsigned int sysctl_autocorking_size;unsigned int sysctl_smcr_buf_type;int sysctl_smcr_testlink_time; +int sysctl_wmem; + int sysctl_rmem; };#endif
net/smc/af_smc.c +2 -3
@@ -379,6 +379,8 @@ static struct sock *smc_sock_alloc(struct net *net, struct socket *sock, sk->sk_state =SMC_INIT ; sk->sk_destruct = smc_destruct; sk->sk_protocol = protocol; +WRITE_ONCE (sk->sk_sndbuf,READ_ONCE (net->smc.sysctl_wmem)); +WRITE_ONCE (sk->sk_rcvbuf,READ_ONCE (net->smc.sysctl_rmem)); smc =smc_sk (sk);INIT_WORK (&smc->tcp_listen_work, smc_tcp_listen_work);INIT_WORK (&smc->connect_work, smc_connect_work);
@@ -3253,9 +3255,6 @@ static int __smc_create(struct net *net, struct socket *sock, int protocol, smc->clcsock = clcsock; } - smc->sk.sk_sndbuf =max (smc->clcsock->sk->sk_sndbuf,SMC_BUF_MIN_SIZE ); - smc->sk.sk_rcvbuf =max (smc->clcsock->sk->sk_rcvbuf,SMC_BUF_MIN_SIZE ); - out:return rc; }
net/smc/smc_core.c +4 -4
@@ -2307,10 +2307,10 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb)if (is_rmb)/* use socket recv buffer size (w/o overhead) as start value */ - sk_buf_size = smc->sk.sk_rcvbuf /2 ; + sk_buf_size = smc->sk.sk_rcvbuf;else /* use socket send buffer size (w/o overhead) as start value */ - sk_buf_size = smc->sk.sk_sndbuf /2 ; + sk_buf_size = smc->sk.sk_sndbuf;for (bufsize_short =smc_compress_bufsize (sk_buf_size, is_smcd, is_rmb); bufsize_short >=0 ; bufsize_short--) {
@@ -2369,7 +2369,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb)if (is_rmb) { conn->rmb_desc = buf_desc; conn->rmbe_size_short = bufsize_short; - smc->sk.sk_rcvbuf = bufsize *2 ; + smc->sk.sk_rcvbuf = bufsize;atomic_set (&conn->bytes_to_rcv,0 ); conn->rmbe_update_limit =smc_rmb_wnd_update_limit (buf_desc->len);
@@ -2377,7 +2377,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb)smc_ism_set_conn (conn);/* map RMB/smcd_dev to conn */ }else { conn->sndbuf_desc = buf_desc; - smc->sk.sk_sndbuf = bufsize *2 ; + smc->sk.sk_sndbuf = bufsize;atomic_set (&conn->sndbuf_space, bufsize); }return 0 ;
net/smc/smc_sysctl.c +20 -0
@@ -21,6 +21,8 @@static int smcr_testlink_time_min =1 ;static int smcr_testlink_time_max = (INT_MAX /HZ ); +static int min_sndbuf =SMC_BUF_MIN_SIZE ; +static int min_rcvbuf =SMC_BUF_MIN_SIZE ;static struct ctl_table smc_table[] = { {
@@ -48,6 +50,22 @@ .extra1 = &smcr_testlink_time_min, .extra2 = &smcr_testlink_time_max, }, + { + .procname = "wmem", + .data = &init_net.smc.sysctl_wmem, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &min_sndbuf, + }, + { + .procname = "rmem", + .data = &init_net.smc.sysctl_rmem, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &min_rcvbuf, + }, { } };
@@ -74,6 +92,8 @@ int __net_init smc_sysctl_net_init(struct net *net) net->smc.sysctl_autocorking_size =SMC_AUTOCORKING_DEFAULT_SIZE ; net->smc.sysctl_smcr_buf_type =SMCR_PHYS_CONT_BUFS ; net->smc.sysctl_smcr_testlink_time =SMC_LLC_TESTLINK_DEFAULT_TIME ; +WRITE_ONCE (net->smc.sysctl_wmem,READ_ONCE (net->ipv4.sysctl_tcp_wmem[1 ])); +WRITE_ONCE (net->smc.sysctl_rmem,READ_ONCE (net->ipv4.sysctl_tcp_rmem[1 ]));return 0 ;
Signature · 1 line
1.8.3.1