From owner-freebsd-arch@FreeBSD.ORG Mon Jun 2 22:38:03 2014 Return-Path: Delivered-To: freebsd-arch@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 275CFFC0; Mon, 2 Jun 2014 22:38:03 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F3F2E2C55; Mon, 2 Jun 2014 22:38:02 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s52Mc1dg026987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jun 2014 15:38:02 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s52Mc1rV026986; Mon, 2 Jun 2014 15:38:01 -0700 (PDT) (envelope-from jmg) Date: Mon, 2 Jun 2014 15:38:01 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: Roadmap for ifnet(9) for FreeBSD 11 Message-ID: <20140602223801.GC43976@funkthat.com> Mail-Followup-To: Gleb Smirnoff , Rui Paulo , Anuranjan Shukla , "freebsd-arch@FreeBSD.org Arch" , Marcel Moolenaar References: <20140529040425.GT50679@glebius.int.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140529040425.GT50679@glebius.int.ru> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 02 Jun 2014 15:38:02 -0700 (PDT) Cc: Marcel Moolenaar , Anuranjan Shukla , Rui Paulo , "freebsd-arch@FreeBSD.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 22:38:03 -0000 Gleb Smirnoff wrote this message on Thu, May 29, 2014 at 08:04 +0400: > On Wed, May 28, 2014 at 08:48:11PM -0700, Rui Paulo wrote: > R> On May 28, 2014, at 9:34, Marcel Moolenaar wrote: > R> > R> > All, > R> > > R> > The ifnet structure represents a network interface. Right now it > R> > is known to all NIC drivers as well as to all protocols. This > R> > means that whenever we change the structure, we need at minimum > R> > recompile all drivers, but usually also change them. This severely > R> > slow downs the development in this area and also makes it hard, if > R> > not, impossible to merge things back to stable branches. > R> > > R> > There were at least 3 efforts on fixing this: > R> > > R> > 1) Juniper???s JUNOS is a FreeBSD based operating system that has > R> > its own (alternative) network stack, but that leverages the > R> > network drivers from FreeBSD. Juniper mechanically changed all > R> > ifnet dereferences to to accessor methods. This could have > R> > been incorporated as early as 2011, but lacked good follow > R> > through. Marcel Moolenaar was prime contact for this. > R> > > R> > 2) Andre Oppermann was sponsored in 2013 by the FreeBSD > R> > Foundation to make ifnet(9) opaque. This is not complete as of > R> > the time of this writing. > R> > > R> > 3) Gleb Smirnoff also planned to work on opaque ifnet(9), but > R> > that always has been delayed due to 1) and 2). > R> > R> This is indeed needed, but it would be nice to understand what would happen if the community has comments about your patch. Will Juniper be able to integrate back those comments? For example, I think the type "if_t" should be "ifnet_t". Another comment I have is: why do you have to cast if_t to (struct ifnet *) in all the accessor methods? It would be better to create a private header typedef'ing if_t to struct ifnet, avoiding the copy & paste casting. > > Because for now patch supports compiling unconverted drivers. This requires > to pass 'void *' as argument. When all drivers are converted, this will be > removed. In if_var.h we would have: > > struct ifnet; > typedef struct ifnet * if_t; > > All casts to (struct ifnet *) will go away. When? The schedule did not have a time frame on when this will happen.. Will it be this year? Next year? Next decade? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."