Skip site navigation (1)Skip section navigation (2)
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>
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
References:  <200206232048.g5NKmQN17703@freefall.freebsd.org> <Pine.NEB.3.96L.1020623165120.4933F-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020623140408.B7342>