From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5432CC4321E for ; Thu, 10 Mar 2022 14:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243325AbiCJOVo (ORCPT ); Thu, 10 Mar 2022 09:21:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245193AbiCJOUu (ORCPT ); Thu, 10 Mar 2022 09:20:50 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421F210D6; Thu, 10 Mar 2022 06:19:49 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 7E3C068AFE; Thu, 10 Mar 2022 15:19:45 +0100 (CET) Date: Thu, 10 Mar 2022 15:19:45 +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: <20220310141945.GA890@lst.de> References: <20220308152105.309618-1-joshi.k@samsung.com> <20220308152105.309618-18-joshi.k@samsung.com> <20220310083652.GF26614@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 Thu, Mar 10, 2022 at 05:20:13PM +0530, Kanchan Joshi wrote: > In sync ioctl, we always update this result field by doing put_user on > completion. > For async ioctl, since command is inside the the sqe, its lifetime is > only upto submission. SQE may get reused post submission, leaving no > way to update the "result" field on completion. Had this field been a > pointer, we could have saved this on submission and updated on > completion. But that would require redesigning this structure and > adding newer ioctl in nvme. Why would it required adding an ioctl to nvme? The whole io_uring async_cmd infrastructure is completely independent from ioctls. > Coming back, even though sync-ioctl alway updates this result to > user-space, only a few nvme io commands (e.g. zone-append, copy, > zone-mgmt-send) can return this additional result (spec-wise). > Therefore in nvme, when we are dealing with inline-sqe commands from > io_uring, we never attempt to update the result. And since we don't > update the result, we limit support to only read/write passthru > commands. And fail any other command during submission itself (Patch > 2). Yikes. That is outright horrible. passthrough needs to be command agnostic and future proof to any newly added nvme command. > > Overly long line. > > Under 100, but sure, can fold it under 80. You can only use 100 sparingly if it makes the code more readable. Which I know is fuzzy, and in practice never does. Certainly not in nvme and block code.