From owner-cvs-all Sat Sep 21 2:20:14 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 973E437B401; Sat, 21 Sep 2002 02:20:12 -0700 (PDT) Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id E68BC43E81; Sat, 21 Sep 2002 02:20:11 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020921092011.HDBX8126.rwcrmhc53.attbi.com@InterJet.elischer.org>; Sat, 21 Sep 2002 09:20:11 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id CAA23765; Sat, 21 Sep 2002 02:16:28 -0700 (PDT) Date: Sat, 21 Sep 2002 02:16:27 -0700 (PDT) From: Julian Elischer To: Poul-Henning Kamp Cc: Darren Reed , John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_mbuf.c In-Reply-To: <37234.1032598916@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 21 Sep 2002, Poul-Henning Kamp wrote: > In message <200209210851.SAA28535@avalon.reed.wattle.id.au>, Darren Reed writes > : > > >I don't dispute that there should be a m_length(), however, I do not > >agree it should be implemented the way it currently is - also finding > >the last mbuf. There is a clear majority of cases which call m_length() > >with last == NULL, all of which are penalised in having to do a loop > >through all of the mbuf's rather than extracting m_pkthdr.len when able > >to do so. > > Darren, > > You don't seem to understand that this function is (should only be) > used in cases where m_pkthdr.len cannot be used and that the only > possible way to find the length in those cases is to traverse the > chain. Probablyu this misunderstanding comes because under irix (and pfilter supports irix) the m_length() function has the functionality that Darren seems to be talking about. It's an unfortunate fact that this obvious name has been used before.. Personally I think it ould be better named as m_tally or m_iterate or something.. I expect something called m_length to be more the irix definition of "the cannonical way to get the length of the packet at all times". So I think it's an unfortunate choice of name. > > Once this fact registers with you, I pressume I can expect you to stop > proposing and committing patches which are wrong in theory and wrong > in practice. > > And presumably: we can bury this silly thread. > > > If you feel it is important to be able to use m_pkthdr.len in all > cases, feel free to change the code which calls m_length() to be > able to do this instead of calling m_length(). > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message