From owner-svn-src-head@FreeBSD.ORG Wed Nov 20 20:12:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E09AE1C3; Wed, 20 Nov 2013 20:12:59 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B232D2646; Wed, 20 Nov 2013 20:12:59 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAKKCwZJ005840 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 12:12:58 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D17C5.6090006@freebsd.org> Date: Wed, 20 Nov 2013 12:12:53 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Robert Watson , "George V. Neville-Neil" Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Nov 2013 20:13:00 -0000 On 11/19/13, 3:04 AM, Robert Watson wrote: > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > >> Allow ethernet drivers to pass in packets connected via the >> nextpkt pointer. >> Handling packets in this way allows drivers to amortize work >> during packet reception. >> >> Submitted by: Vijay Singh >> Sponsored by: NetApp > > Currently, it is quite easy to make mistakes regarding individual > mbuf chains vs. lists of mbuf chains. This leads me to wonder > whether a new type, perhaps simply constructed on the stack before > passing in, should be used for KPIs that accept lists of packets. E.g., > > /* > * This structure is almost always allocated on a caller stack, so > * cannot itself be queued without memory allocation in most cases. > */ > struct mbuf_queue { > struct mbuf *mq_head; > }; > > int > ether_input(struct ifnet *ifp, struct mbuf_queue *m) > { > > ... > } or separate entrypoints, old and and new > > ... > struct mbuf_queue mq = { m }; > > return (ether_input(ifp, &mq)); > ... > > That way the compiler can help us figure out where we expect an > individual packet but have accidentally leaked a queue. Functions > that accept only a single packet could also more agressively assert > that m->m_nextpkt is NULL: > > M_ASSERT_ONEPACKET(m); > > Robert > >> >> >