summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2009-08-12 15:58:21 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2009-08-12 15:58:21 +0000
commitb6c1a50d5d1b9d2bb2a9081166fcae595ab222e6 (patch)
tree7de3e8f48ba303d95a806cf2e21bc760f17e5d1d /sys/net
parenta7e5a1a9e591b89d53a226dd10d844bb13065a57 (diff)
dlg deferred calling interfaces' if_start routine so we call them less,
which does pay out, performance wise. one of the conditions to call the interfaces' if_start routine immediately was "send queue is full". on a very busy (hammered) machine this will itroduce too much latency since we spend almost all cpu time in interrupt handlers and softnet, so the softint actually doing the if_start gets called to seldom and the queue full check is what triggers the actual transmit. change the logic to call if's if_start routing immediately when there are at least 8 packets (or in case if maxlen being smaller than 8, maxlen) 8 chose because it shows best performance in my test setup here. ok dlg
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index df140d42cb2..5adb852e14c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.198 2009/08/10 11:22:10 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.199 2009/08/12 15:58:20 henning Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -471,7 +471,8 @@ if_attach_common(struct ifnet *ifp)
void
if_start(struct ifnet *ifp)
{
- if (IF_QFULL(&ifp->if_snd) && !ISSET(ifp->if_flags, IFF_OACTIVE)) {
+ if (ifp->if_snd.ifq_len >= min(8, ifp->if_snd.ifq_maxlen) &&
+ !ISSET(ifp->if_flags, IFF_OACTIVE)) {
if (ISSET(ifp->if_xflags, IFXF_TXREADY)) {
TAILQ_REMOVE(&iftxlist, ifp, if_txlist);
CLR(ifp->if_xflags, IFXF_TXREADY);