Date: Mon, 8 Jun 2009 15:35:08 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Kip Macy <kmacy@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r193698 - user/kmacy/releng_7_2_fcs/sys/netinet Message-ID: <alpine.BSF.2.00.0906081534200.25282@fledge.watson.org> In-Reply-To: <200906080919.n589JPGJ022028@svn.freebsd.org> References: <200906080919.n589JPGJ022028@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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;
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0906081534200.25282>
