From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F73EC4320E for ; Fri, 23 Jul 2021 15:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0C7260E75 for ; Fri, 23 Jul 2021 15:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235457AbhGWO1f (ORCPT ); Fri, 23 Jul 2021 10:27:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:34272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235351AbhGWO1f (ORCPT ); Fri, 23 Jul 2021 10:27:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E875260EBC; Fri, 23 Jul 2021 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627052888; bh=QgDjEfpuy0APKmZWIXq1ynq1Oo4VifnevoiZPA+uy8k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RwE3xnBUH4mgZomNTeTmUIFAb9P0s4pApOLRObsCuXTi+kB88S6MNGykFqwhpjaqm NEGfDAB2i9Cz9RPXI4Wd5uGVSkS3HCSxkKGj4itwAYz9Ayd57kGv+h1pbRy0RWBrR0 CeI8nWoE8OPm8pFKt/PhdveXblQifatUqUSszKSDEoPJCkMETXItZyCU4LgpGvrq92 YBUihj5oR9hg+tAVJOZy5AnKGjGAkSj4ROnL7ObIkc4++nkh3NN9VUc5+RcVQ29p5O AoMZPKYjQqx169nTUvpidCqL5Yhn7XS6DV8pmbcQe98bYptRBbxdmX10GTWIpAiDwa vmYoucGbHqbbg== Date: Fri, 23 Jul 2021 08:08:06 -0700 From: Keith Busch To: Wedson Almeida Filho Cc: Matthew Wilcox , Finn Behrens , Greg Kroah-Hartman , Miguel Ojeda , Christoph Hellwig , Miguel Ojeda , Linus Torvalds , rust-for-linux , Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel Subject: Re: [PATCH 00/17] Rust support Message-ID: <20210723150806.GA2021417@dhcp-10-100-145-180.wdc.com> References: <20210704202756.29107-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On Thu, Jul 22, 2021 at 11:55:58PM +0100, Wedson Almeida Filho wrote: > On Thu, Jul 08, 2021 at 01:58:32AM +0100, Matthew Wilcox wrote: > > A simple NVMe driver is less than a thousand lines of C. > > I know the one in the kernel now is ridiculously complicated and has > > been thoroughly messed up with abstractions to support NVMeoF instead > > of having a separate driver, but it's really a simple interface at heart. > > The latest NVMe spec is 452 pages long, which seems to contradict your claim > that it's simple. In any case, translating less than 1K lines of C shouldn't be > too hard (after I've built the abstractions, of course). Would you mind sharing > the simple driver you mention above? You can use the 1.0 spec, which is much shorter. A 1.0 capable driver should be forward compatible with newer devices, too. The current nvme driver became less simple since blk-mq integration and has only gotten more complicated since then with other transports and more advanced features. For a simpler example, you can reference an in kernel version <= 3.16, and ignore the "nvme-scsi" parts.