From ea4abb82bc6e613ddebd6235f792dd5bbbc469c9 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 7 May 2020 20:30:03 +0100 Subject: [PATCH 1/1] Disable copybreak Some network interface drivers employ a scheme known as "copybreak" in which they make a copy of a received skb if the size of the buffer is below a particular threshold, then return the original receive skb back to the pool. Since these drivers initially allocate a buffer size that is larger than the largest possible packet, this scheme returns that large buffer to the pool quickly, and uses a smaller one. The primary benefit of copybreak is better memory utilization. On systems where the data is ultimately going to be copied out to user space, the copybreak scheme is "low cost" because it has the side benefit of priming the cache for that later copy. But on a router that only touches the header fields of a received packet, the cost can be relatively higher. And on modern systems the memory savings is rarely an important consideration. Some of the drivers that employ copybreak make the feature configurable via a module parameter. This file disables copybreak in some of those drivers. Generally this results in an improvement in forwarding performance for traffic using these drivers. Fixes: #11930 Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- Makefile.am | 6 +++++ src/modprobe.d/no-copybreak.conf | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/modprobe.d/no-copybreak.conf diff --git a/Makefile.am b/Makefile.am index a5ea1235..4aa7314b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,7 @@ AUTOMAKE_OPTIONS = color-tests configdir = $(sysconfdir)/network bashcompletiondir= $(datadir)/bash-completion/completions libexecdir = $(prefix)/lib +modprobedir = $(prefix)/lib/modprobe.d pkgconfigdir = $(libdir)/pkgconfig pppdir = $(sysconfdir)/ppp systemconfigdir = $(datadir)/network @@ -396,6 +397,11 @@ dist_sysctl_DATA = \ # ------------------------------------------------------------------------------ +dist_modprobe_DATA = \ + src/modprobe.d/no-copybreak.conf + +# ------------------------------------------------------------------------------ + dist_bashcompletion_SCRIPTS = \ src/bash-completion/network diff --git a/src/modprobe.d/no-copybreak.conf b/src/modprobe.d/no-copybreak.conf new file mode 100644 index 00000000..97ea8866 --- /dev/null +++ b/src/modprobe.d/no-copybreak.conf @@ -0,0 +1,44 @@ +# +# Some network interface drivers employ a scheme known as "copybreak" +# in which they make a copy of a received skb if the size of the +# buffer is below a particular threshold, then return the original +# receive skb back to the pool. Since these drivers initially +# allocate a buffer size that is larger than the largest possible +# packet, this scheme returns that large buffer to the pool quickly, +# and uses a smaller one. +# +# The primary benefit of copybreak is better memory utilization. On +# systems where the data is ultimately going to be copied out to user +# space, the copybreak scheme is "low cost" because it has the side +# benefit of priming the cache for that later copy. But on a router +# that only touches the header fields of a received packet, the cost +# can be relatively higher. And on modern systems the memory savings +# is rarely an important consideration. +# +# Some of the drivers that employ copybreak make the feature +# configurable via a module parameter. This file disables copybreak +# in some of those drivers. Generally this results in an improvement +# in forwarding performance for traffic using these drivers. +# + +options 3c515 rx_copybreak=0 +options 3c59x rx_copybreak=0 +options bcm63xx copybreak=0 +options cxgb copybreak=0 +options e1000 copybreak=0 +options e1000e copybreak=0 +options epic100 rx_copybreak=0 +options fealnx rx_copybreak=0 +options hamachi rx_copybreak=0 +options ixgb copybreak=0 +options natsemi rx_copybreak=0 +options pch_gbe copybreak=0 +options pcnet32 rx_copybreak=0 +options sis190 rx_copybreak=0 +options sky2 copybreak=0 +options starfire rx_copybreak=0 +options sundance rx_copybreak=0 +options typhoon rx_copybreak=0 +options via-rhine rx_copybreak=0 +options via-velocity rx_copybreak=0 +options yellowfin rx_copybreak=0 -- 2.39.2