diff options
| author | Julian Elischer <julian@FreeBSD.org> | 2001-01-25 19:48:57 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 2001-01-25 19:48:57 +0000 |
| commit | 34f9ca09081cf88a817389e0d4f939067f37ab3d (patch) | |
| tree | 09e4d82ae4d7011477646fee4d38b0444bc7c68f /sys/netgraph | |
| parent | b00df9c9ba96a8857476e2f342dde76f595a6f8d (diff) | |
Notes
Diffstat (limited to 'sys/netgraph')
| -rw-r--r-- | sys/netgraph/ng_base.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 78b4aaa59bf9..d7370eb82ad2 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3027,7 +3027,7 @@ ng_getqblk(void) * ngqfree is the final arbiter. We have our little reserve * because we use M_NOWAIT for malloc. This just helps us * avoid dropping packets while not increasing the time - * we take to service the interrupt (on average) (we hope). + * we take to service the interrupt (on average) (I hope). */ for (;;) { if ((ngqfreesize < ngqfreelow) || (ngqfree == NULL)) { @@ -3062,15 +3062,19 @@ ng_getqblk(void) */ if (atomic_cmpset_ptr(&ngqfree, item, item->el_next)) { atomic_subtract_int(&ngqfreesize, 1); + item->el_flags &= ~NGQF_FREE; break; } + /* + * something got there before we did.. try again + * (go around the loop again) + */ item = NULL; } else { /* We really ran out */ break; } } - item->el_flags &= ~NGQF_FREE; return (item); } |
