Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4593417pxf; Tue, 30 Mar 2021 11:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznk9njBMfVtboSu9DFMpX7axjgUNzSAZxa/A73ryVeTwpOM2AHo6Bu2zGUuZe1p7F/vwE7 X-Received: by 2002:a17:907:33c6:: with SMTP id zk6mr33840093ejb.228.1617129296854; Tue, 30 Mar 2021 11:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617129296; cv=none; d=google.com; s=arc-20160816; b=yKGkE6jMXrC7YmtqH+rdZi7ABswGT5jOMepE78aIl5GooK91yZYcFw9dNewC2PdrtV Phaa2Dly7+bg1oXMRMFShyfvTcPqvq/yP/3VVfrNGYN1o1nFZw3nk2/gdocqq4G36dr9 uNKMcOpJfYzuLGyUj12xnmiPZf42Ru2o45FcRskjuT6XYp/B8Vg4WGMfgXFm01g+UAye vfHzv7jl6STGpZ8iFcnv/4+xi0xNfY7TwF/88KpbtCinvKxgva92UmeIsmBfTwuQxX7H 2eF//aXfg/5b3ZqvSeN7fba0AaGk5wEW7V+e3Cc8BWIIY3LMjSucf36XTpZONCUoYecG kXOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7D0t7kKBUtNyEw7wPH5xr4MnNv8franh5ra+G0ifn8Y=; b=d3OHXK6+9MWXluAxJ1FDzrWgVOAWNQCvwOBfX9Oprt2ik5Ahdps21+4GjgTmRMDwbQ rNzVOoKxWN/Uy6E+NAMPED/y51fRtPBGdIoRMcj4B4pPJhOlcSL3iiZkbytNI1TsxUlQ LcGTCEERxXuUN53cj09pBaxod7FpVtrwDyjbheDfO2unrLaMhr3lK+WHR58rKOpyf87B 1/sGwzXLUkV9gUQCvLrURHysB1VUzOFukmFWi75ubG6V6vpylvM2KX/eSkFA8FXCEmHK bbxIlk77IAj39Y/w/b9f+w1k6tcBpLrQMkgHFmxRKmpENBenm331uRbgYSl2c0vBJ5/K FULA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=uymBmqVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si15646568ejg.74.2021.03.30.11.34.31; Tue, 30 Mar 2021 11:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=uymBmqVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232705AbhC3Sax (ORCPT + 99 others); Tue, 30 Mar 2021 14:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbhC3Sa3 (ORCPT ); Tue, 30 Mar 2021 14:30:29 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0EAAC061574 for ; Tue, 30 Mar 2021 11:30:26 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id o16so17232178wrn.0 for ; Tue, 30 Mar 2021 11:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javigon-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7D0t7kKBUtNyEw7wPH5xr4MnNv8franh5ra+G0ifn8Y=; b=uymBmqVAuvj4Qc1pqUaBasAJTL6wtWdKO7YDd5Vdtxejwo3R2vYJm6UfnOa8nFH4i4 5DXWRcIlnVOrJzetYhD+JDtaUddFcqG4W6JZjtvlE7HI2PtF5jd2VBsJ3rgeTTV0IuQ2 xC0rSyUvcvyWrF9JgGMS7X5RtTxa14rLqdtsWMBBOzBjQ12uj5ouHGfBqXmrL80pHGee Ap16LpJUCg+7ZpjMspkLz4yV2MgGyPV+Mg3pTierWpphCd6u/Jb5vpuQc5OqzhETpLQO xe5Il9aWV/HIPV4rCVmPZhMUB+JXnjnFqhd0GOPhYMTy+h0UF2Jw/XsH4Xmwy4imncUw vPHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7D0t7kKBUtNyEw7wPH5xr4MnNv8franh5ra+G0ifn8Y=; b=Sy56p8+q75pjjGngvHj1g+IGKHZMHNK2zvu9kaUXgLEz5hNIJ/ZkYPfiAYGpZG6LRh xXmP/LvC8Y4njABG8F2jCtdFJfkR2WTxtcGUQgRTelYNO9brwlRDbFWrORzz7/9NRjaf QeKDUpjcdRwtuVibisrmNDeLEhz4symdMCZ95+oBcMUV5cTaH0GNvsvu0pz5M9hPS1gF d/1ECtc54W7HPK9DystI+lkM080NyI6Ma9QEZSihkJq684NRns077rWGgK3H8UdZ4HAv zm4KPAqGKdikTHXlzQ3jdpRYZVZN5ohm5VPCSqh6NXusXJ3WDBWydCiTg/35kEW/Hl4t iXXA== X-Gm-Message-State: AOAM530DRlDVhPrS8WUtMYH7gL4AXEUHpXqRFQGFcjZM5l5NaPMjE31L xiZRVXqU1DImz3wZgrMdlK7/+c0C/74eSxEV X-Received: by 2002:a5d:5904:: with SMTP id v4mr35634271wrd.261.1617129025361; Tue, 30 Mar 2021 11:30:25 -0700 (PDT) Received: from localhost (5.186.124.214.cgn.fibianet.dk. [5.186.124.214]) by smtp.gmail.com with ESMTPSA id a15sm26149964wrr.53.2021.03.30.11.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 11:30:24 -0700 (PDT) Date: Tue, 30 Mar 2021 20:30:22 +0200 From: "javier@javigon.com" To: Niklas Cassel Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , "minwoo.im.dev@gmail.com" , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH] nvme: allow NVME_IOCTL_IO_CMD on controller char dev even when multiple ns Message-ID: <20210330183022.arjiqiufiuqkrvwc@mpHalley.local> References: <20210326205943.431185-1-Niklas.Cassel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20210326205943.431185-1-Niklas.Cassel@wdc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.03.2021 20:59, Niklas Cassel wrote: >From: Niklas Cassel > >Currently when doing NVME_IOCTL_IO_CMD on the controller character device, >the command is rejected if there is more than one namespace in the >ctrl->namespaces list. > >There is not really any reason for this restriction. >Instead, check the nsid value specified in the passthru command, and try >to find the matching namespace in ctrl->namespaces list. >If found, call nvme_user_cmd() on the namespace. >If not found, reject the command. > >While at it, remove the warning that says that NVME_IOCTL_IO_CMD is >deprecated on the controller character device. >There is no comment saying why it is deprecated. >It might be very unsafe to send a passthru command, but if that is >the issue with this IOCTL, then we should add a warning about that >instead. > >Signed-off-by: Niklas Cassel I think the idea is OK, but I have 3 questions: 1. Wouldn't this break user-space when nsid is not specified? 2. What is the use case for this? As I understand it, this char device is primarily for admin commands sent to the controller. Do you see a use case for sending commands to the namespace using the controller char device? 3. Following up on the above, if the use-case is I/O, don't you think it is cleaner to use the ongoing per-namespace char device effort? We would very much like to get your input there and eventually send a series together. When this is merged, we could wire that logic to the controller char device if there is an use-case for it. Javier