From owner-svn-src-user@FreeBSD.ORG Mon Jun 8 14:35:12 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9801065680; Mon, 8 Jun 2009 14:35:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 085C08FC24; Mon, 8 Jun 2009 14:35:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 79EB146B2A; Mon, 8 Jun 2009 10:35:08 -0400 (EDT) Date: Mon, 8 Jun 2009 15:35:08 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kip Macy In-Reply-To: <200906080919.n589JPGJ022028@svn.freebsd.org> Message-ID: References: <200906080919.n589JPGJ022028@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r193698 - user/kmacy/releng_7_2_fcs/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 14:35:13 -0000 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; >