svn commit: r304202 - head/sys/netinet

Sepherosa Ziehau sephe at FreeBSD.org
Tue Aug 16 06:40:28 UTC 2016


Author: sephe
Date: Tue Aug 16 06:40:27 2016
New Revision: 304202
URL: https://svnweb.freebsd.org/changeset/base/304202

Log:
  tcp/lro: Make # of LRO entries tunable
  
  Reviewed by:	hps, gallatin
  Obtained from:	rrs, gallatin
  MFC after:	2 weeks
  Sponsored by:	Netflix (rrs, gallatin), Microsoft (sephe)
  Differential Revision:	https://reviews.freebsd.org/D7499

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==============================================================================
--- head/sys/netinet/tcp_lro.c	Tue Aug 16 02:34:25 2016	(r304201)
+++ head/sys/netinet/tcp_lro.c	Tue Aug 16 06:40:27 2016	(r304202)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/socket.h>
+#include <sys/sysctl.h>
 
 #include <net/if.h>
 #include <net/if_var.h>
@@ -55,6 +56,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>
 
@@ -71,6 +73,14 @@ static void	tcp_lro_rx_done(struct lro_c
 static int	tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m,
 		    uint32_t csum, int use_hash);
 
+SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro,  CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+    "TCP LRO");
+
+static unsigned	tcp_lro_entries = TCP_LRO_ENTRIES;
+SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries,
+    CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0,
+    "default number of LRO entries");
+
 static __inline void
 tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket,
     struct lro_entry *le)
@@ -91,7 +101,7 @@ tcp_lro_active_remove(struct lro_entry *
 int
 tcp_lro_init(struct lro_ctrl *lc)
 {
-	return (tcp_lro_init_args(lc, NULL, TCP_LRO_ENTRIES, 0));
+	return (tcp_lro_init_args(lc, NULL, tcp_lro_entries, 0));
 }
 
 int


More information about the svn-src-head mailing list