summaryrefslogtreecommitdiffstats
path: root/sys/net/route.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-12-09 03:22:39 +0000
committerdlg <dlg@openbsd.org>2015-12-09 03:22:39 +0000
commit83d8135ec6739ca7470161708e71820fb2b3455d (patch)
treebb7d3a92ddfdb8be654eefe1fdf2f665bf3cc00c /sys/net/route.c
parentIntegrate two patches originally from Daniel Micay. (diff)
downloadwireguard-openbsd-83d8135ec6739ca7470161708e71820fb2b3455d.tar.xz
wireguard-openbsd-83d8135ec6739ca7470161708e71820fb2b3455d.zip
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/route.c')
0 files changed, 0 insertions, 0 deletions