diff options
author | jhb <jhb@FreeBSD.org> | 2012-06-29 15:21:34 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-06-29 15:21:34 +0000 |
commit | 722e0571698d84ca79f966be76d161a8617893f2 (patch) | |
tree | 8fbe06d03fb7d3a8609552c31432b253571524eb /sys/net/if_gif.c | |
parent | 213f4b7f2551bf5affdf0ffd7bd47680c677b0ee (diff) | |
download | FreeBSD-src-722e0571698d84ca79f966be76d161a8617893f2.zip FreeBSD-src-722e0571698d84ca79f966be76d161a8617893f2.tar.gz |
Hold GIF_LOCK() for almost all of gif_start(). It is required to be held
across in_gif_output() and in6_gif_output() anyway, and once it is held
across those it might as well be held for the entire loop. This simplifies
the code and removes the need for the custom IFF_GIF_WANTED flag (which
belonged in the softc and not as an IFF_* flag anyway).
Tested by: Vincent Hoffman vince unsane co uk
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r-- | sys/net/if_gif.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 232c44a..783607b 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -359,15 +359,7 @@ gif_start(struct ifnet *ifp) sc = ifp->if_softc; GIF_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - /* Already active */ - ifp->if_drv_flags |= IFF_GIF_WANTED; - GIF_UNLOCK(sc); - return; - } ifp->if_drv_flags |= IFF_DRV_OACTIVE; - GIF_UNLOCK(sc); -keep_going: while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -424,16 +416,6 @@ keep_going: ifp->if_oerrors++; } - GIF_LOCK(sc); - if (ifp->if_drv_flags & IFF_GIF_WANTED) { - /* Someone did a start while - * we were unlocked and processing - * lets clear the flag and try again. - */ - ifp->if_drv_flags &= ~IFF_GIF_WANTED; - GIF_UNLOCK(sc); - goto keep_going; - } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GIF_UNLOCK(sc); return; |