diff options
author | 2015-03-18 12:23:15 +0000 | |
---|---|---|
committer | 2015-03-18 12:23:15 +0000 | |
commit | ff2a9cfc0b77a8eda60235d5e6a000d63761bebf (patch) | |
tree | 24d99f6a1d9d4b451d589fc6a3ee5a3a966dc4eb /sys/net/if_tun.c | |
parent | use device_lookup to find gcu0 rather than iterating over alldevs. (diff) | |
download | wireguard-openbsd-ff2a9cfc0b77a8eda60235d5e6a000d63761bebf.tar.xz wireguard-openbsd-ff2a9cfc0b77a8eda60235d5e6a000d63761bebf.zip |
remove the congestion handling from struct ifqueue.
its only used for the ip and ip6 network stack input queues, so it
seems unfair that every instance of ifqueue has to carry a pointer
around for this specific use case.
this moves the congestion marker to a kernel global. if we detect
that we're congested, we assume the whole system is busy and punish
all input queues.
marking a system as congested is done by setting the global to the
current value of ticks. as the system moves away from that value,
it moves away from being congested until the comparison fails.
written at s2k15
ok henning@ beck@ bluhm@ claudio@
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 1fba8ca2c1f..db5b8335734 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.133 2015/03/14 03:38:51 jsg Exp $ */ +/* $OpenBSD: if_tun.c,v 1.134 2015/03/18 12:23:15 dlg Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -906,8 +906,7 @@ tunwrite(dev_t dev, struct uio *uio, int ioflag) splx(s); ifp->if_collisions++; m_freem(top); - if (!ifq->ifq_congestion) - if_congestion(ifq); + if_congestion(); return (ENOBUFS); } IF_ENQUEUE(ifq, top); |