summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_lro.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-09-01 08:01:13 +0000
committersephe <sephe@FreeBSD.org>2016-09-01 08:01:13 +0000
commit2affb9c948fba64f20c549b598427c39e4f51527 (patch)
treea4d3ef562323e55f8803cd9bfbb1e350a0972319 /sys/netinet/tcp_lro.c
parent12a1c9434d6e284a4bf07e498e91f4ae601ce172 (diff)
downloadFreeBSD-src-2affb9c948fba64f20c549b598427c39e4f51527.zip
FreeBSD-src-2affb9c948fba64f20c549b598427c39e4f51527.tar.gz
MFC 304202
tcp/lro: Make # of LRO entries tunable Reviewed by: hps, gallatin Obtained from: rrs, gallatin Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) Differential Revision: https://reviews.freebsd.org/D7499
Diffstat (limited to 'sys/netinet/tcp_lro.c')
-rw-r--r--sys/netinet/tcp_lro.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c
index 761d8f3..65e2e35 100644
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/socket.h>
+#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_var.h>
@@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_var.h>
#include <netinet/tcp.h>
#include <netinet/tcp_lro.h>
+#include <netinet/tcp_var.h>
#include <netinet6/ip6_var.h>
@@ -67,6 +69,14 @@ __FBSDID("$FreeBSD$");
#define TCP_LRO_INVALID_CSUM 0x0000
#endif
+SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "TCP LRO");
+
+static unsigned tcp_lro_entries = LRO_ENTRIES;
+SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries,
+ CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0,
+ "default number of LRO entries");
+
int
tcp_lro_init(struct lro_ctrl *lc)
{
@@ -81,7 +91,7 @@ tcp_lro_init(struct lro_ctrl *lc)
SLIST_INIT(&lc->lro_active);
error = 0;
- for (i = 0; i < LRO_ENTRIES; i++) {
+ for (i = 0; i < tcp_lro_entries; i++) {
le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF,
M_NOWAIT | M_ZERO);
if (le == NULL) {
OpenPOWER on IntegriCloud