From ac65d38fe6b57b8cb83351dcc64faeaec7512f1d Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Mon, 10 Dec 2012 17:09:01 +0800 Subject: [PATCH] polling: Add tunable for net.ifpoll.X.rx.user_frac --- share/man/man4/polling.4 | 5 +++++ sys/net/if_poll.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man4/polling.4 b/share/man/man4/polling.4 index 3caaf0fa60..a48e4cd9c8 100644 --- a/share/man/man4/polling.4 +++ b/share/man/man4/polling.4 @@ -109,6 +109,11 @@ Default value for .Va net.ifpoll.X.rx.each_burst sysctl nodes. .Pp +.It Va net.ifpoll.user_frac +Default value for +.Va net.ifpoll.X.rx.user_frac +sysctl nodes. +.Pp .It Va net.ifpoll.pollhz Default value for .Va net.ifpoll.X.pollhz diff --git a/sys/net/if_poll.c b/sys/net/if_poll.c index 5384f4c79f..00dbfa3735 100644 --- a/sys/net/if_poll.c +++ b/sys/net/if_poll.c @@ -110,6 +110,7 @@ #define IOPOLL_BURST_MAX 375 /* good for 1000Mbit net and HZ=4000 */ #define IOPOLL_EACH_BURST 15 +#define IOPOLL_USER_FRAC 50 #define IFPOLL_FREQ_DEFAULT 4000 @@ -259,6 +260,7 @@ SYSCTL_NODE(_net, OID_AUTO, ifpoll, CTLFLAG_RW, 0, static int iopoll_burst_max = IOPOLL_BURST_MAX; static int iopoll_each_burst = IOPOLL_EACH_BURST; +static int iopoll_user_frac = IOPOLL_USER_FRAC; static int ifpoll_pollhz = IFPOLL_FREQ_DEFAULT; static int ifpoll_stfrac = IFPOLL_STFRAC_DEFAULT; @@ -266,6 +268,7 @@ static int ifpoll_txfrac = IFPOLL_TXFRAC_DEFAULT; TUNABLE_INT("net.ifpoll.burst_max", &iopoll_burst_max); TUNABLE_INT("net.ifpoll.each_burst", &iopoll_each_burst); +TUNABLE_INT("net.ifpoll.user_frac", &iopoll_user_frac); TUNABLE_INT("net.ifpoll.pollhz", &ifpoll_pollhz); TUNABLE_INT("net.ifpoll.status_frac", &ifpoll_stfrac); TUNABLE_INT("net.ifpoll.tx_frac", &ifpoll_txfrac); @@ -679,7 +682,7 @@ iopoll_ctx_create(int cpuid, int poll_type) io_ctx->poll_each_burst = iopoll_each_burst; io_ctx->poll_burst_max = iopoll_burst_max; - io_ctx->user_frac = 50; + io_ctx->user_frac = iopoll_user_frac; if (poll_type == IFPOLL_RX) io_ctx->pollhz = comm->pollhz; else -- 2.41.0