aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2009-06-14 17:15:18 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2009-06-14 17:15:18 +0000
commited655c8c071267ddf2d26429735f608071d36acd (patch)
tree2692a18160e587aed5bdcbd2d8eac925ca8d7076 /sys
parent4ae35b5d2ad8492bff7e5ee9f940d647e6ce3cbf (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/net/netisr.c4
-rw-r--r--sys/net/netisr.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
index da5dac454922..5dc4c9039a50 100644
--- a/sys/net/netisr.c
+++ b/sys/net/netisr.c
@@ -197,6 +197,7 @@ struct netisr_proto {
netisr_handler_t *np_handler; /* Protocol handler. */
netisr_m2flow_t *np_m2flow; /* Query flow for untagged packet. */
netisr_m2cpuid_t *np_m2cpuid; /* Query CPU to process packet on. */
+ 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. */
};
@@ -380,6 +381,7 @@ netisr_register(const struct netisr_handler *nhp)
np[proto].np_handler = nhp->nh_handler;
np[proto].np_m2flow = nhp->nh_m2flow;
np[proto].np_m2cpuid = nhp->nh_m2cpuid;
+ np[proto].np_drainedcpu = nhp->nh_drainedcpu;
if (nhp->nh_qlimit == 0)
np[proto].np_qlimit = netisr_defaultqlimit;
else if (nhp->nh_qlimit > netisr_maxqlimit) {
@@ -705,6 +707,8 @@ netisr_process_workstream_proto(struct netisr_workstream *nwsp, u_int proto)
}
KASSERT(local_npw.nw_len == 0,
("%s(%u): len %u", __func__, proto, local_npw.nw_len));
+ if (np[proto].np_drainedcpu)
+ np[proto].np_drainedcpu(nwsp->nws_cpu);
NWS_LOCK(nwsp);
npwp->nw_handled += handled;
return (handled);
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index 5894d3d65250..ec7df3a35330 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -88,6 +88,7 @@ typedef void netisr_handler_t (struct mbuf *m);
typedef struct mbuf *netisr_m2cpuid_t(struct mbuf *m, uintptr_t source,
u_int *cpuid);
typedef struct mbuf *netisr_m2flow_t(struct mbuf *m, uintptr_t source);
+typedef void netisr_drainedcpu_t(u_int cpuid);
#define NETISR_POLICY_SOURCE 1 /* Maintain source ordering. */
#define NETISR_POLICY_FLOW 2 /* Maintain flow ordering. */
@@ -101,6 +102,7 @@ struct netisr_handler {
netisr_handler_t *nh_handler; /* Protocol handler. */
netisr_m2flow_t *nh_m2flow; /* Query flow for untagged packet. */
netisr_m2cpuid_t *nh_m2cpuid; /* Query CPU to process mbuf on. */
+ netisr_drainedcpu_t *nh_drainedcpu; /* Callback when drained a queue. */
u_int nh_proto; /* Integer protocol ID. */
u_int nh_qlimit; /* Maximum per-CPU queue depth. */
u_int nh_policy; /* Work placement policy. */