CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2015/12/08 20:22:39
Modified files: sys/dev/pci : if_myx.c sys/net : if.c if_var.h ifq.c ifq.h Log message: 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@