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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A66FDC433F5 for ; Thu, 24 Mar 2022 06:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbiCXGdy (ORCPT ); Thu, 24 Mar 2022 02:33:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiCXGdx (ORCPT ); Thu, 24 Mar 2022 02:33:53 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9009972BD; Wed, 23 Mar 2022 23:32:21 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 9AC0068B05; Thu, 24 Mar 2022 07:32:18 +0100 (CET) Date: Thu, 24 Mar 2022 07:32:18 +0100 From: Christoph Hellwig To: Kanchan Joshi Cc: Christoph Hellwig , Kanchan Joshi , Jens Axboe , Keith Busch , Pavel Begunkov , io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, sbates@raithlin.com, logang@deltatee.com, Pankaj Raghav , Javier =?iso-8859-1?Q?Gonz=E1lez?= , Luis Chamberlain , Adam Manzanares , Anuj Gupta Subject: Re: [PATCH 17/17] nvme: enable non-inline passthru commands Message-ID: <20220324063218.GC12660@lst.de> References: <20220308152105.309618-1-joshi.k@samsung.com> <20220308152105.309618-18-joshi.k@samsung.com> <20220310083652.GF26614@lst.de> <20220310141945.GA890@lst.de> <20220311062710.GA17232@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, Mar 22, 2022 at 10:40:27PM +0530, Kanchan Joshi wrote: > On Fri, Mar 11, 2022 at 11:57 AM Christoph Hellwig wrote: > > > And that's because this ioctl requires additional "__u64 result;" to > > > be updated within "struct nvme_passthru_cmd64". > > > To update that during completion, we need, at the least, the result > > > field to be a pointer "__u64 result_ptr" inside the struct > > > nvme_passthru_cmd64. > > > Do you see that is possible without adding a new passthru ioctl in nvme? > > > > We don't need a new passthrough ioctl in nvme. > Right. Maybe it is easier for applications if they get to use the same > ioctl opcode/structure that they know well already. I disagree. Reusing the same opcode and/or structure for something fundamentally different creates major confusion. Don't do it. > >From all that we discussed, maybe the path forward could be this: > - inline-cmd/big-sqe is useful if paired with big-cqe. Drop big-sqe > for now if we cannot go the big-cqe route. > - use only indirect-cmd as this requires nothing special, just regular > sqe and cqe. We can support all passthru commands with a lot less > code. No new ioctl in nvme, so same semantics. For common commands > (i.e. read/write) we can still avoid updating the result (put_user > cost will go). > > Please suggest if we should approach this any differently in v2. Personally I think larger SQEs and CQEs are the only sensible interface here. Everything else just fails like a horrible hack I would not want to support in NVMe.