summaryrefslogtreecommitdiff
path: root/accel-pppd/net.c
diff options
context:
space:
mode:
authorSergey V. Lobanov <sergey@lobanov.in>2021-12-20 18:00:32 +0300
committerSergey V. Lobanov <sergey@lobanov.in>2021-12-20 18:00:32 +0300
commit5249bf6428e70aa489aa9b8c44b16935c391a7fe (patch)
tree8234db2351aca96b5c957ad99d47fdea37697a20 /accel-pppd/net.c
parent385c4038c451f5c181136070846cab0664dae43a (diff)
downloadaccel-ppp-5249bf6428e70aa489aa9b8c44b16935c391a7fe.tar.gz
accel-ppp-5249bf6428e70aa489aa9b8c44b16935c391a7fe.zip
T55: add netlink buffer size configuration parameters
Netlink buffers may overflow so it might be useful to increase send and receive netlink buffer sizes. Two parameters to [common] configuration section added: nl-rcv-buffer, nl-snd-buffer. It is required to set (sysctl) net.core.wmem_max>=nl-snd-buffer and net.core.rmem_max>=nl-rcv-buffer before running accel-pppd To check current netlink buffer size and related info use the following command: % ss -f netlink -m 0 0 rtnl:kernel * skmem:(r0,rb212992,t0,tb212992,f0,w0,o0,bl0,d0) 0 0 rtnl:-1140221812 * skmem:(r0,rb2048000,t0,tb80000,f0,w0,o0,bl0,d0) 0 0 rtnl:accel-pppd/14285 * skmem:(r0,rb2048000,t0,tb65536,f0,w0,o0,bl0,d0) ... (Please check man ss to get the meaning for r,rb,t,tb,f,w,o,bl and d params) In the ss output you will see the values doubled from configured. First accel-pppd netlink socket will use default values (rcv=1048576, snd=32768) regardless of configured nl-rcv-buffer and nl-snd-buffer values. Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
Diffstat (limited to 'accel-pppd/net.c')
-rw-r--r--accel-pppd/net.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pppd/net.c b/accel-pppd/net.c
index 26373fc..c619dee 100644
--- a/accel-pppd/net.c
+++ b/accel-pppd/net.c
@@ -45,6 +45,9 @@ __export __thread struct ap_net *net;
__export struct ap_net *def_net;
static int def_ns_fd;
+__export int conf_nl_rcvbuf = 1024 * 1024;
+__export int conf_nl_sndbuf = -1;
+
static int def_socket(int domain, int type, int proto)
{
return socket(domain, type, proto);
@@ -432,6 +435,14 @@ static void __init init()
{
const char *opt;
+ opt = conf_get_opt("common", "nl-rcv-buffer");
+ if (opt)
+ conf_nl_rcvbuf = atoi(opt);
+
+ opt = conf_get_opt("common", "nl-snd-buffer");
+ if (opt)
+ conf_nl_sndbuf = atoi(opt);
+
opt = conf_get_opt("common", "netns-run-dir");
if (opt)
conf_netns_run_dir = opt;