summaryrefslogtreecommitdiffstats
path: root/sys/net/netisr_internal.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2011-05-24 12:34:19 +0000
committerrwatson <rwatson@FreeBSD.org>2011-05-24 12:34:19 +0000
commitd81ad1a304ca99439077aa7c704c6929bc0a5cde (patch)
treefae7de425a3a034d8550ae8258d13d32fd3e5e19 /sys/net/netisr_internal.h
parentc9f24d69ee711c9d875a4cd68e933abd53afe28b (diff)
downloadFreeBSD-src-d81ad1a304ca99439077aa7c704c6929bc0a5cde.zip
FreeBSD-src-d81ad1a304ca99439077aa7c704c6929bc0a5cde.tar.gz
Rework netisr policy mechanism so that per-protocol dispatch policies can
be represented: - A single policy namespace is defined, consisting of four possible policies: "default" to use the global default, "deferred" to force deferred dispatch, "direct" to employ direct dispatch where possible, and "hybrid" which makes a dynamic decision based on CPU affinity, ordering, etc. Routines are implemented to convert between strings and an integer namespace. - A new global variable, netisr_dispatch_policy, subsumes existing global variables for direct dispatch, forced direct dispatch, etc, and is used for explicit policy interpretation and composition. Old variables remain so that they can be exported by legacy sysctls for use by old netstat(1) binaries. A new sysctl and tunable, netisr.dispatch.policy, accepts the above strings for specifying a global policy default. - The protocol registration structure, netisr_handler, grows an nh_dispatch field, which accepts a per-policy policy override. The default value is '0', which corresponds to "default", meaning that protocols will accept the global default policy unless otherwise specified. - Policies are now interpreted and composed explicitly at various points in packet dispatch; protocol policies override global policies. - Protocols grow the ability to express a non-opinion about affinity even when implenting m2cpuid by returning NETISR_CPUID_NONE. In that case, the framework falls back on source ordering, rather than simply using the current CPU. These changes are in support of allowing link layer re-dispatch based on RSS or similar hashes provided by NICs, especially in the case where the number of hardware receive queues matches hardware core count, rather than hardware thread count, requiring further software redistributeon. (i.e., on RMI XLR). MFC after: 3 weeks Reviewed by: bz Sponsored by: Juniper Networks, Inc.
Diffstat (limited to 'sys/net/netisr_internal.h')
-rw-r--r--sys/net/netisr_internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/netisr_internal.h b/sys/net/netisr_internal.h
index 40afaf1..ac3ed0f 100644
--- a/sys/net/netisr_internal.h
+++ b/sys/net/netisr_internal.h
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2007-2009 Robert N. M. Watson
- * Copyright (c) 2010 Juniper Networks, Inc.
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
* This software was developed by Robert N. M. Watson under contract
@@ -64,6 +64,7 @@ struct netisr_proto {
netisr_drainedcpu_t *np_drainedcpu; /* Callback when drained a queue. */
u_int np_qlimit; /* Maximum per-CPU queue depth. */
u_int np_policy; /* Work placement policy. */
+ u_int np_dispatch; /* Work dispatch policy. */
};
#define NETISR_MAXPROT 16 /* Compile-time limit. */
OpenPOWER on IntegriCloud