aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2016-06-03 13:57:10 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2016-06-03 13:57:10 +0000
commit484149def80975bda4e583a1d77c4c6ee2baf074 (patch)
treeb9bad282d3f1a106a25f2d6b11e1232e2b57223b /sys/netinet6
parent3e0522bc8f9a1b4011d7223100f0b85e7c97bb41 (diff)
downloadsrc-484149def80975bda4e583a1d77c4c6ee2baf074.tar.gz
src-484149def80975bda4e583a1d77c4c6ee2baf074.zip
Introduce a per-VNET flag to enable/disable netisr prcessing on that VNET.
Add accessor functions to toggle the state per VNET. The base system (vnet0) will always enable itself with the normal registration. We will share the registered protocol handlers in all VNETs minimising duplication and management. Upon disabling netisr processing for a VNET drain the netisr queue from packets for that VNET. Update netisr consumers to (de)register on a per-VNET start/teardown using VNET_SYS(UN)INIT functionality. The change should be transparent for non-VIMAGE kernels. Reviewed by: gnn (, hiren) Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6691
Notes
Notes: svn path=/head/; revision=301270
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_input.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index d7fc9eeaf33a..a897d6c3e1d3 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -217,8 +217,15 @@ ip6_init(void)
V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR;
/* Skip global initialization stuff for non-default instances. */
- if (!IS_DEFAULT_VNET(curvnet))
+#ifdef VIMAGE
+ if (!IS_DEFAULT_VNET(curvnet)) {
+ netisr_register_vnet(&ip6_nh);
+#ifdef RSS
+ netisr_register_vnet(&ip6_direct_nh);
+#endif
return;
+ }
+#endif
pr = pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW);
if (pr == NULL)
@@ -310,6 +317,11 @@ ip6_destroy(void *unused __unused)
{
int error;
+#ifdef RSS
+ netisr_unregister_vnet(&ip6_direct_nh);
+#endif
+ netisr_unregister_vnet(&ip6_nh);
+
if ((error = pfil_head_unregister(&V_inet6_pfil_hook)) != 0)
printf("%s: WARNING: unable to unregister pfil hook, "
"error %d\n", __func__, error);