From owner-freebsd-arch@FreeBSD.ORG Wed May 28 16:34:10 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 8F0F9B5E; Wed, 28 May 2014 16:34:10 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F5329FE; Wed, 28 May 2014 16:34:09 +0000 (UTC) Received: from jammyc-sslvpn-nc.jnpr.net ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.8/8.14.8) with ESMTP id s4SGY7vd030740 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 28 May 2014 09:34:08 -0700 (PDT) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Content-Type: multipart/signed; boundary="Apple-Mail=_97E6AFBE-6D5F-4B52-B449-4178F1B82A5C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Roadmap for ifnet(9) for FreeBSD 11 Date: Wed, 28 May 2014 09:34:01 -0700 Message-Id: To: "freebsd-arch@FreeBSD.org Arch" Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) X-Mailer: Apple Mail (2.1878.2) Cc: Anuranjan Shukla , Gleb Smirnoff 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: Wed, 28 May 2014 16:34:10 -0000 --Apple-Mail=_97E6AFBE-6D5F-4B52-B449-4178F1B82A5C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 All, The ifnet structure represents a network interface. Right now it is known to all NIC drivers as well as to all protocols. This means that whenever we change the structure, we need at minimum recompile all drivers, but usually also change them. This severely slow downs the development in this area and also makes it hard, if not, impossible to merge things back to stable branches. There were at least 3 efforts on fixing this: 1) Juniper=92s JUNOS is a FreeBSD based operating system that has its own (alternative) network stack, but that leverages the network drivers from FreeBSD. Juniper mechanically changed all ifnet dereferences to to accessor methods. This could have been incorporated as early as 2011, but lacked good follow through. Marcel Moolenaar was prime contact for this. 2) Andre Oppermann was sponsored in 2013 by the FreeBSD Foundation to make ifnet(9) opaque. This is not complete as of the time of this writing. 3) Gleb Smirnoff also planned to work on opaque ifnet(9), but that always has been delayed due to 1) and 2). To outline what we would like to achieve: o FreeBSD wants to have an opaque ifnet(9). The benefits of which are: - quicker development of networking improvements w/o breaking ABI/API - splitting up ifnet into multiple structures or otherwise make ifnet of variable size. o Juniper wants to continue using stock FreeBSD drivers against its own network stack. The suggested roadmap is as follows: Since Juniper already has a working patch that achieves the objective of making ifnet an opaque type by replacing ifnet pointer dereferences with function calls in an almost mechanical fashion, we propose to merge that first. The patch doesn't break old-style access to struct ifnet, which means that unconverted and converted drivers coexist. This gives us time to convert drivers. This also gives Juniper an important rendezvous point between their and our repos. The following drivers have been converted by Juniper: o fxp o em and lem o bxe. Additional drivers will be converted by the community. Once all drivers are converted, no network driver needs or uses =93struct ifnet=94. At that point the definition can be removed from headers included by drivers or changed entirely. Schedule: late May 2014 Juniper adds accessor methods. Access via void *, that inside if.c is re-casted to (struct ifnet *). This =93ugly=94 moment is required to keep unconverted drivers compilable and will go away shortly after. 1st week June 2014 Juniper commits few converted drivers. June - July All drivers are being converted. Gleb volunteers, but this should be done by as many hands as possible. August 2014 '#define if_t void *' is removed. 'typedef if_t struct ifnet *' is added. actual struct ifnet is hidden. 2014/2015 Better APIs developed and improved, actual ifnet representation becomes variable sized. New networking stack improvements are already unblocked at this moment. The complete patch as well as the conversion script can be found here: http://people.freebsd.org/~marcel/Juniper/201405/drvapi.diff http://people.freebsd.org/~marcel/Juniper/201405/convert_drvapi.sh --=20 Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_97E6AFBE-6D5F-4B52-B449-4178F1B82A5C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlOGD/kACgkQpgWlLWHuifYsmACfYnkzaY5ZNlk2YQ6U3ah6gXvB oewAni4UFiGB7oEip8AbVXnnKSDrCNFa =glkP -----END PGP SIGNATURE----- --Apple-Mail=_97E6AFBE-6D5F-4B52-B449-4178F1B82A5C--