diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-12-09 03:22:40 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-12-09 03:22:40 +0000 |
commit | 73edb8b2dbafe9653dcd8663aadb5b7afc1e13d2 (patch) | |
tree | 39101baaff466e2820fe429f168ca685c4adc35c /sys/net/if_var.h | |
parent | 9be3316e1891b75e30eb2a619ce99010f78f04f6 (diff) |
rework the if_start mpsafe serialisation so it can serialise arbitrary work
work is represented by struct task.
the start routine is now wrapped by a task which is serialised by the
infrastructure. if_start_barrier has been renamed to ifq_barrier and
is now implemented as a task that gets serialised with the start
routine.
this also adds an ifq_restart() function. it serialises a call to
ifq_clr_oactive and calls the start routine again. it exists to
avoid a race that kettenis@ identified in between when a start
routine discovers theres no space left on a ring, and when it calls
ifq_set_oactive. if the txeof side of the driver empties the ring
and calls ifq_clr_oactive in between the above calls in start, the
queue will be marked oactive and the stack will never call the start
routine again.
by serialising the ifq_set_oactive call in the start routine and
ifq_clr_oactive calls we avoid that race.
tested on various nics
ok mpi@
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r-- | sys/net/if_var.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index c0bd1ef7459..d98abe02300 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.66 2015/12/08 10:14:58 dlg Exp $ */ +/* $OpenBSD: if_var.h,v 1.67 2015/12/09 03:22:39 dlg Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -42,6 +42,7 @@ #include <sys/mbuf.h> #include <sys/srp.h> #include <sys/refcnt.h> +#include <sys/task.h> #include <sys/time.h> #include <net/ifq.h> |