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
This commit is contained in:
Max Laier 2004-08-22 16:42:28 +00:00
parent 1c11fbbb6e
commit ca7a789aa6

View File

@ -370,23 +370,24 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro,
}
}
#endif /* notdef */
/*
* 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
/*
* 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
*/
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