summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/smc/smc_sysctl.c10
-rw-r--r--net/smc/smc_tx.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c
index 8a3a8e145976..3b59876aaac9 100644
--- a/net/smc/smc_sysctl.c
+++ b/net/smc/smc_sysctl.c
@@ -14,9 +14,17 @@
#include <linux/sysctl.h>
#include <net/net_namespace.h>
+#include "smc.h"
#include "smc_sysctl.h"
static struct ctl_table smc_table[] = {
+ {
+ .procname = "autocorking_size",
+ .data = &init_net.smc.sysctl_autocorking_size,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_douintvec,
+ },
{ }
};
@@ -40,6 +48,8 @@ static __net_init int smc_sysctl_init_net(struct net *net)
if (!net->smc.smc_hdr)
goto err_reg;
+ net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE;
+
return 0;
err_reg:
diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c
index 062c6b1535e3..257dc0d0aeb1 100644
--- a/net/smc/smc_tx.c
+++ b/net/smc/smc_tx.c
@@ -147,7 +147,7 @@ static bool smc_should_autocork(struct smc_sock *smc)
struct smc_connection *conn = &smc->conn;
int corking_size;
- corking_size = min(SMC_AUTOCORKING_DEFAULT_SIZE,
+ corking_size = min(sock_net(&smc->sk)->smc.sysctl_autocorking_size,
conn->sndbuf_desc->len >> 1);
if (atomic_read(&conn->cdc_pend_tx_wr) == 0 ||