From owner-freebsd-arch@FreeBSD.ORG Tue Jan 4 13:23:02 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC9D106566C for ; Tue, 4 Jan 2011 13:23:02 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 648A88FC18 for ; Tue, 4 Jan 2011 13:23:02 +0000 (UTC) Received: by qwj9 with SMTP id 9so13953832qwj.13 for ; Tue, 04 Jan 2011 05:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=yD97Cs34Bm4fgPu+U55A2bw/O0XAKoLymJY91fL+Z90=; b=F4HWzalyy8Dr0PVbJFROVdEfUtprlMgx0vW01b5u7CGlr1dnZLK328QRSe9ruuQ44G ll7kJmPYJf0sp+p9/y5zLR0/5C8o0zDJnA/LHnUFK6ytKIlXtoVxMDFTTczVa5DYVLG7 h7ngYYfoFUM/q9j8WC81zbVrvkbJBhGmNgtNc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=swrwjfcI8rTtLv93sk2rhu751wBmWNaXHBc8rOQ78WBDK2qrBCx4lQzA0VsjkXP4bU FPfDuPAt+kS2TxDjXswa7YUGrhWJLRerwvascSgwoq2Za8SYwNIgN93CMFKt3BUb0agv qcAOJpCAJr74c0ZHl6TlyAA5Xlgq2j1BTD+44= Received: by 10.229.84.137 with SMTP id j9mr19114028qcl.214.1294147380834; Tue, 04 Jan 2011 05:23:00 -0800 (PST) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id t7sm11614852qcs.40.2011.01.04.05.22.58 (version=SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 05:22:58 -0800 (PST) Date: Tue, 4 Jan 2011 08:22:52 -0500 From: Alexander Kabaev To: Jeff Roberson Message-ID: <20110104082252.45bb5e7f@kan.dnsalias.net> In-Reply-To: References: <20110103220153.69cf59e0@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/InHXaOUp4rOrZf6bSMUJWl1"; protocol="application/pgp-signature" Cc: arch@freebsd.org Subject: Re: Linux kernel compatability X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:23:02 -0000 --Sig_/InHXaOUp4rOrZf6bSMUJWl1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 3 Jan 2011 19:03:01 -1000 (HST) Jeff Roberson wrote: > On Mon, 3 Jan 2011, Alexander Kabaev wrote: >=20 > > On Mon, 3 Jan 2011 10:31:24 -1000 (HST) > > Jeff Roberson wrote: > > > >> Hello Folks, > >> > >> Some of you may have seen my infiniband work proceed in svn. It is > >> coming to a close soon and I will be integrating it into current. > >> I have a few patches to the kernel to send for review but I wanted > >> to bring up the KPI wrapper itself for discussion. > >> > >> The infiniband port has been done by creating a 10,000 line KPI > >> compatability layer. With this layer the vast majority of the > >> driver code runs unmodified. The exceptions are anything that > >> interfaces with skbs and most of the code that deals with network > >> interfaces. > >> > >> Some examples of things supported by the wrapper: > >> > >> atomics, types, bitops, byte order conversion, character devices, > >> pci devices, dma, non-device files, idr tables, interrupts, > >> ioremap, hashes, kobjects, radix trees, lists, modules, notifier > >> blocks, rbtrees, rwlock, rwsem, semaphore, schedule, spinlocks, > >> kalloc, wait queues, workqueues, timers, etc. > >> > >> Obviously a complete wrapper is impossible and I only implemented > >> the features that I needed. The build is accomplished by pointing > >> the linux compatible code at sys/ofed/include/ which has a > >> simulated linux kernel include tree. There are some config(8) > >> changes to help this along as well. > >> > >> I have seen that some attempt at similar wrappers has been made > >> elsewhere. I wonder if instead of making each one tailored to > >> individual components, which mostly seem to be filesystems so far, > >> should we put this in a central place under compat somewhere? Is > >> this project doomed to be tied to a single consumer by the specific > >> nature of it? > >> > >> Other comments or concerns? > >> > >> Thanks, > >> Jeff > > > > > > This probably will go against popular opinion here, but having 10k > > linux emulation layer that _almost_ work in the tree will be an > > unfortunate event and will do more damage to FreeBSD as a platform > > than good in the long run. I would rather see this code never hit > > main repository. >=20 > I would argue that the layer works very well for infiniband. Much > better than almost. It is only almost complete in that there is no > need for me to implement features that we're not using. >=20 > I am interested in hearing your other concerns however. >=20 > Thanks, > Jeff >=20 The considerations are simple enough. First, we do not have many IB users of FreeBSD in the wild and those that we have (Isilon) seem to be perfectly capable of managing the IB stack out of the tree, without dumping the thousands of lines of the code into the base. If they had the stack before, but were not willing/capable to provide adequate care for it in the past, there is no reason to expect things to change with second stack, which now will rot in our tree instead of theirs.=20 Second, semi-complete Linux compat layer in kernel will have the same effect as linuxulator in userland - we do have some vendors still trying to bother with FreeBSD drivers for their hardware now and we will have none after we provide the possibility to hack their Linux code to run somewhat stably on top of Linux compat layer. Due to intentional fluidity of Linux kAPI, our shims will never quite walk and quack like their original implementation in Linux kernel and combined result will always be lees stable than native Linux linux drivers in Linux kernel. --=20 Alexander Kabaev --Sig_/InHXaOUp4rOrZf6bSMUJWl1 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iD8DBQFNIx8xQ6z1jMm+XZYRApuTAJsEbIXbzyEGrU02xMeVe9jGDqikOQCgmdwi QrhoNQGPtVoG53kO541mFac= =J46A -----END PGP SIGNATURE----- --Sig_/InHXaOUp4rOrZf6bSMUJWl1--