svn commit: r193698 - user/kmacy/releng_7_2_fcs/sys/netinet
Robert Watson
rwatson at FreeBSD.org
Mon Jun 8 14:35:13 UTC 2009
On Mon, 8 Jun 2009, Kip Macy wrote:
> skip idiv if queue is empty
A more general optimization might be to check whether ip->ip_len is > mtu
before doing the idiv case...
Robert N M Watson
Computer Laboratory
University of Cambridge
>
> Modified:
> user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c
>
> Modified: user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c
> ==============================================================================
> --- user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c Mon Jun 8 09:13:16 2009 (r193697)
> +++ user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c Mon Jun 8 09:19:25 2009 (r193698)
> @@ -447,12 +447,14 @@ again:
> * interface in which case packetdrop should be done by queueing.
> */
> #ifdef ALTQ
> - if ((!ALTQ_IS_ENABLED(&ifp->if_snd)) &&
> + if (ifp->if_snd.ifq_len &&
> + (!ALTQ_IS_ENABLED(&ifp->if_snd)) &&
> ((ifp->if_snd.ifq_len + ip->ip_len / mtu + 1) >=
> ifp->if_snd.ifq_maxlen))
> #else
> - if ((ifp->if_snd.ifq_len + ip->ip_len / mtu + 1) >=
> - ifp->if_snd.ifq_maxlen)
> + if (ifp->if_snd.ifq_len &&
> + ((ifp->if_snd.ifq_len + ip->ip_len / mtu + 1) >=
> + ifp->if_snd.ifq_maxlen))
> #endif /* ALTQ */
> {
> error = ENOBUFS;
>
More information about the svn-src-user
mailing list