svn commit: r304101 - stable/11/sys/netinet6

Andrey V. Elsukov ae at FreeBSD.org
Sun Aug 14 20:22:05 UTC 2016


Author: ae
Date: Sun Aug 14 20:22:03 2016
New Revision: 304101
URL: https://svnweb.freebsd.org/changeset/base/304101

Log:
  MFC r302906:
    Add net.inet6.ip6.intr_queue_maxlen sysctl. It can be used to
    change netisr queue limit for IPv6 at runtime.

Modified:
  stable/11/sys/netinet6/in6.h
  stable/11/sys/netinet6/ip6_input.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/in6.h
==============================================================================
--- stable/11/sys/netinet6/in6.h	Sun Aug 14 20:19:47 2016	(r304100)
+++ stable/11/sys/netinet6/in6.h	Sun Aug 14 20:22:03 2016	(r304101)
@@ -637,7 +637,10 @@ struct ip6_mtuinfo {
 					 * receiving IF. */
 #define	IPV6CTL_RFC6204W3	50	/* Accept defroute even when forwarding
 					   enabled */
-#define	IPV6CTL_MAXID		51
+#define	IPV6CTL_INTRQMAXLEN	51	/* max length of IPv6 netisr queue */
+#define	IPV6CTL_INTRDQMAXLEN	52	/* max length of direct IPv6 netisr
+					 * queue */
+#define	IPV6CTL_MAXID		53
 #endif /* __BSD_VISIBLE */
 
 /*

Modified: stable/11/sys/netinet6/ip6_input.c
==============================================================================
--- stable/11/sys/netinet6/ip6_input.c	Sun Aug 14 20:19:47 2016	(r304100)
+++ stable/11/sys/netinet6/ip6_input.c	Sun Aug 14 20:22:03 2016	(r304101)
@@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/rmlock.h>
 #include <sys/syslog.h>
+#include <sys/sysctl.h>
 
 #include <net/if.h>
 #include <net/if_var.h>
@@ -145,6 +146,24 @@ static struct netisr_handler ip6_nh = {
 #endif
 };
 
+static int
+sysctl_netinet6_intr_queue_maxlen(SYSCTL_HANDLER_ARGS)
+{
+	int error, qlimit;
+
+	netisr_getqlimit(&ip6_nh, &qlimit);
+	error = sysctl_handle_int(oidp, &qlimit, 0, req);
+	if (error || !req->newptr)
+		return (error);
+	if (qlimit < 1)
+		return (EINVAL);
+	return (netisr_setqlimit(&ip6_nh, qlimit));
+}
+SYSCTL_DECL(_net_inet6_ip6);
+SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRQMAXLEN, intr_queue_maxlen,
+    CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_queue_maxlen, "I",
+    "Maximum size of the IPv6 input queue");
+
 #ifdef RSS
 static struct netisr_handler ip6_direct_nh = {
 	.nh_name = "ip6_direct",
@@ -154,6 +173,24 @@ static struct netisr_handler ip6_direct_
 	.nh_policy = NETISR_POLICY_CPU,
 	.nh_dispatch = NETISR_DISPATCH_HYBRID,
 };
+
+static int
+sysctl_netinet6_intr_direct_queue_maxlen(SYSCTL_HANDLER_ARGS)
+{
+	int error, qlimit;
+
+	netisr_getqlimit(&ip6_direct_nh, &qlimit);
+	error = sysctl_handle_int(oidp, &qlimit, 0, req);
+	if (error || !req->newptr)
+		return (error);
+	if (qlimit < 1)
+		return (EINVAL);
+	return (netisr_setqlimit(&ip6_direct_nh, qlimit));
+}
+SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRDQMAXLEN, intr_direct_queue_maxlen,
+    CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_direct_queue_maxlen,
+    "I", "Maximum size of the IPv6 direct input queue");
+
 #endif
 
 VNET_DEFINE(struct pfil_head, inet6_pfil_hook);


More information about the svn-src-all mailing list