From owner-cvs-all Sun Jun 23 14: 4:12 2002 Delivered-To: cvs-all@freebsd.org Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id A89B137B405; Sun, 23 Jun 2002 14:04:08 -0700 (PDT) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g5NL48I07423; Sun, 23 Jun 2002 14:04:08 -0700 (PDT) (envelope-from rizzo) Date: Sun, 23 Jun 2002 14:04:08 -0700 From: Luigi Rizzo <luigi@FreeBSD.ORG> To: Robert Watson <rwatson@FreeBSD.ORG> Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/netinet ip_input.c Message-ID: <20020623140408.B7342@iguana.icir.org> References: <200206232048.g5NKmQN17703@freefall.freebsd.org> <Pine.NEB.3.96L.1020623165120.4933F-100000@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <Pine.NEB.3.96L.1020623165120.4933F-100000@fledge.watson.org>; from rwatson@FreeBSD.ORG on Sun, Jun 23, 2002 at 04:52:55PM -0400 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: <cvs-all.FreeBSD.ORG> List-Archive: <http://docs.freebsd.org/mail/> (Web Archive) List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions) List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20cvs-all> List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20cvs-all> X-Loop: FreeBSD.ORG On Sun, Jun 23, 2002 at 04:52:55PM -0400, Robert Watson wrote: > Yeah, I was actually thinking about committing almost the same comment on > the mbuf allocation in ip_forward(). Essentially, the mbuf is only needed > in failure cases, and therefore we pessimize the success case. We should > just cache a 'struct ip' in the stack frame of ip_forward() and tweak the > code we call to use that, presumably. the struct ip only has room for the std header, this code actually saves the entire header+options+8bbytes of data. I think a chunk of 72 bytes in the stack suffices. To make things efficient one should put a few tests to verify i) if the copy is really neceessary (as we might have decided not to send icmp altogether, or be beyond the icmp limit), and ii) if the required data are contiguous in the first mbuf (which is almost always) do the copy in place instead of going through the m_copy*() routines. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message