From owner-svn-src-head@FreeBSD.ORG Wed Nov 20 22:02:28 2013 Return-Path: Delivered-To: svn-src-head@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 ED356308; Wed, 20 Nov 2013 22:02:27 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5915D2CCC; Wed, 20 Nov 2013 22:02:27 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id i13so2574116qae.3 for ; Wed, 20 Nov 2013 14:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HQFZhn/dLqkdw1iISOkod7K0WU/e+sX2vtPWRWn3csw=; b=FrEz4seDFuHpbprYomYXLQuE9UOhnywGQgvic2EH8H74GdrxF5vWx30NcMsVRD13w2 33W+VzQO+Sm6fe2B8kad/8LKNO4g+96dmxd++l2MH5hyrHwd4XSo2LMNSRK86Vg6hgoc lSx+lrOupDE0nt0AgxX57W2VrkIyU8EWkP4v5NcD8NdAwWzetnr02Kz0T8opNI11bkmJ V3xs1GsFEmQKjjjMmmBBfCIXSj2n3l4bXIvzxMaxkZraYMN/VQ3200bEifhZ0cz8ZoS2 bqPz2OA1jghdmbFOy17kV5NHxSEMPcn2FsG7v5LX7TZ5WEkIbeUJd0IABcULvI6w9gwp 8tXw== MIME-Version: 1.0 X-Received: by 10.224.64.200 with SMTP id f8mr5675355qai.55.1384984946603; Wed, 20 Nov 2013 14:02:26 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Wed, 20 Nov 2013 14:02:26 -0800 (PST) In-Reply-To: <201311182258.rAIMwEFd048783@svn.freebsd.org> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> Date: Wed, 20 Nov 2013 14:02:26 -0800 X-Google-Sender-Auth: ki1OX3h-CVp1suO6clamTiMqGqo Message-ID: Subject: Re: svn commit: r258328 - head/sys/net From: Adrian Chadd To: "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , FreeBSD Net Content-Type: text/plain; charset=ISO-8859-1 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 22:02:28 -0000 Can we revert this and just quickly put together something else that won't potentially come back to bite us with weird side effects? My suggestions (and I'm happy to do this work if needed): * create a lightweight mbuf queue representation so an mbuf list isn't just the mbuf header pointer; * create a new ether input (say, ether_input_multi) that takes an mbuf list, so existing driver code does the right thing. 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..) -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; > + } > } > > /*