summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-08-22 16:42:28 +0000
committermlaier <mlaier@FreeBSD.org>2004-08-22 16:42:28 +0000
commit252cbf1c2aeff200b94f1b2b55460095bce9249e (patch)
treefbaf384f7813aca67674abaab061add279879640 /sys/netinet/ip_output.c
parent9602bb2cd9f8c2796a8f0c5bdc3b263edb6b9473 (diff)
downloadFreeBSD-src-252cbf1c2aeff200b94f1b2b55460095bce9249e.zip
FreeBSD-src-252cbf1c2aeff200b94f1b2b55460095bce9249e.tar.gz
Allow early drop for non-ALTQ enabled queues in an ALTQ-enabled kernel.
Previously the early drop was disabled unconditionally for ALTQ-enabled kernels. This should give some benefit for the normal gateway + LAN-server case with a busy LAN leg and an ALTQ managed uplink. Reviewed and style help from: cperciva, pjd
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 7ed86b6..3576905 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -370,23 +370,24 @@ again:
}
}
#endif /* notdef */
-#ifdef ALTQ
- /*
- * disable packet drop hack.
- * packetdrop should be done by queueing.
- */
-#else /* !ALTQ */
/*
- * Verify that we have any chance at all of being able to queue
- * the packet or packet fragments
+ * Verify that we have any chance at all of being able to queue the
+ * packet or packet fragments, unless ALTQ is enabled on the given
+ * interface in which case packetdrop should be done by queueing.
*/
+#ifdef ALTQ
+ if ((!ALTQ_IS_ENABLED(&ifp->if_snd)) &&
+ ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
+ ifp->if_snd.ifq_maxlen))
+#else
if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
- ifp->if_snd.ifq_maxlen) {
- error = ENOBUFS;
- ipstat.ips_odropped++;
- goto bad;
+ ifp->if_snd.ifq_maxlen)
+#endif /* ALTQ */
+ {
+ error = ENOBUFS;
+ ipstat.ips_odropped++;
+ goto bad;
}
-#endif /* !ALTQ */
/*
* Look for broadcast address and
OpenPOWER on IntegriCloud