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 */ #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 #ifdef ALTQ
/* if ((!ALTQ_IS_ENABLED(&ifp->if_snd)) &&
* disable packet drop hack. ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
* packetdrop should be done by queueing. ifp->if_snd.ifq_maxlen))
*/ #else
#else /* !ALTQ */
/*
* Verify that we have any chance at all of being able to queue
* the packet or packet fragments
*/
if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >= if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
ifp->if_snd.ifq_maxlen) { ifp->if_snd.ifq_maxlen)
error = ENOBUFS; #endif /* ALTQ */
ipstat.ips_odropped++; {
goto bad; error = ENOBUFS;
ipstat.ips_odropped++;
goto bad;
} }
#endif /* !ALTQ */
/* /*
* Look for broadcast address and * Look for broadcast address and