if_start: Fix a race that could delay the packets transmission
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 17 Dec 2012 04:18:08 +0000 (12:18 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 17 Dec 2012 04:24:18 +0000 (12:24 +0800)
commit404c9fd95265d91463b866582cac4972bcdd13d5
tree5f4a3d63793b911e088fcdb3cd401c4d257f8b83
parente1b80bb25ad5121195123deb25c7ebfa9ce1936a
if_start: Fix a race that could delay the packets transmission

Since if_start_need_schedule is called w/ the cached IFF_OACTIVE out
side of ifnet's TX serializer, there could be a race that IFF_OACTIVE
could be cleared before if_start_need_schedule but after releasing
ifnet's TX serializer.  This could delay already queued packets
transmission until the new packet is coming.  Fix this race by calling
if_start_need_schedule inside ifnet's TX serializer.
sys/net/if.c