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:31:55 +0000 (12:31 +0800)
commite136c2407c03ca4a4436c62e5ef915bec7c0c0b8
tree33e59c834abb9819280305ccbc2276b784304088
parentd3751a41a6b471e235a0ec9e7942d11b331d6d6d
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