From owner-svn-src-all@FreeBSD.ORG Wed Nov 27 05:00:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 526FEC4B; Wed, 27 Nov 2013 05:00:16 +0000 (UTC) Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com [IPv6:2607:f8b0:4003:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A76D326E9; Wed, 27 Nov 2013 05:00:15 +0000 (UTC) Received: by mail-ob0-f178.google.com with SMTP id uz6so6850904obc.37 for ; Tue, 26 Nov 2013 21:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7wp8Ot4d3RPOEuzGIKE8Jz7/RDGhPDbWHY7y/6mBhm0=; b=rYdUJseyUwPHWqcQklRUoisRlU/voDrjkEVu56SE2PRXK78VJrYZJnNkvZiZBe5msk t/dLUItELVpt+dIhsjvwWuAiv1RrnF7x57H2g0TVkwJHjhGAIkHovwcqVxRzn6Zlmzzx nTVppQdatBEq0cIU1cpNvgv9YXGe9uIQiXz/LxwdV6MtBYe7lERQseDdfldx+2aRPzmz saZfxjWp5fyunamrXBxnfd/jkk6Bwv+Z9HiHdtMt5KxYvP9iKl3PWnBfPjXIV+aU9VWn KPRPzD2pjNEARv8GBunsYArF+m3CI8U59rvzEPK7m4AIu3jKYPobj07ne3ac3kXxVxiq 4eqQ== MIME-Version: 1.0 X-Received: by 10.60.145.241 with SMTP id sx17mr8276633oeb.57.1385528414314; Tue, 26 Nov 2013 21:00:14 -0800 (PST) Received: by 10.182.153.65 with HTTP; Tue, 26 Nov 2013 21:00:14 -0800 (PST) In-Reply-To: References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <528D6173.4080406@freebsd.org> Date: Tue, 26 Nov 2013 21:00:14 -0800 Message-ID: Subject: Re: svn commit: r258328 - head/sys/net From: Vijay Singh To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: Adrian Chadd , "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Nov 2013 05:00:16 -0000 Sorry to join this late, I've been busy preparing other patches to roll out. I am OK either way. FWIW we're running with this @netapp for more than 2 years, but we do use only very few drivers. I would like to avoid the proliferation of APIs but Robert's point also does make sense. On Sat, Nov 23, 2013 at 2:57 AM, Robert Watson wrote: > On Wed, 20 Nov 2013, Julian Elischer wrote: > > After that it'd be nice to write a set of mbuf list macros for abstract >>> the whole queue, dequeue, concat, iterate, etc (like sys/queue.h, but for >>> mbufs.) >>> >>> What do people think? >>> >>> (I've been doing it for m->next chained things, but not m->m_nextpkt >>> things..) >>> >> >> I was thinking: new interfaces.. (your -multi names sound good). macros >> for handling said lists so that people don't screw them up Old drivers run >> with no change. >> > > To me, the name "multi" is ambiguous: could be multicast. If we call the > new datastructure "mbqueue" or "mqueue", then we should name the method > ether_input_mbqueue or ether_input_mqueue. > > Robert > > > > > > >> >>> >>> >>> -adrian >>> >>> >>> On 18 November 2013 14:58, George V. Neville-Neil >>> wrote: >>> >>>> Author: gnn >>>> Date: Mon Nov 18 22:58:14 2013 >>>> New Revision: 258328 >>>> URL: http://svnweb.freebsd.org/changeset/base/258328 >>>> >>>> Log: >>>> 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 >>>> >>>> Modified: >>>> head/sys/net/if_ethersubr.c >>>> >>>> Modified: head/sys/net/if_ethersubr.c >>>> ============================================================ >>>> ================== >>>> --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 >>>> (r258327) >>>> +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 >>>> (r258328) >>>> @@ -708,13 +708,25 @@ static void >>>> ether_input(struct ifnet *ifp, struct mbuf *m) >>>> { >>>> >>>> + struct mbuf *mn; >>>> + >>>> /* >>>> - * We will rely on rcvif being set properly in the deferred >>>> context, >>>> - * so assert it is correct here. >>>> + * The drivers are allowed to pass in a chain of packets linked >>>> with >>>> + * m_nextpkt. We split them up into separate packets here and >>>> pass >>>> + * them up. This allows the drivers to amortize the receive >>>> lock. >>>> */ >>>> - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", >>>> __func__)); >>>> + while (m) { >>>> + mn = m->m_nextpkt; >>>> + m->m_nextpkt = NULL; >>>> >>>> - netisr_dispatch(NETISR_ETHER, m); >>>> + /* >>>> + * We will rely on rcvif being set properly in the >>>> deferred context, >>>> + * so assert it is correct here. >>>> + */ >>>> + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet >>>> mismatch", __func__)); >>>> + netisr_dispatch(NETISR_ETHER, m); >>>> + m = mn; >>>> + } >>>> } >>>> >>>> /* >>>> >>> >> >> _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >