Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19985754rwd; Wed, 28 Jun 2023 18:00:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50Vy6VN0rcUCF9lux/4chyVftEXBVEp2/5ApRc1cWD9GbKhs9rkyr/fSwYydVpYqQMjq0E X-Received: by 2002:a05:6358:9f82:b0:134:e3d2:1e50 with SMTP id fy2-20020a0563589f8200b00134e3d21e50mr2097104rwb.18.1688000444167; Wed, 28 Jun 2023 18:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688000444; cv=none; d=google.com; s=arc-20160816; b=Rz5aCbhUknKWx3auq/Fl1GPYsDpPl4rpcxh8MFamvU7MetgBqeR5CpZHWctBOf4ZrC Y2ujuC3Y/eg3h+Wqk1S1ral0WglNirkpQzfYveYRtWpiVi51snPpLePlR2z2uHI6LuxX z97DPPw+xynRyBuOwUQ5mpsC+vWBZANynedUjBUlsuhVuNnkQVXxARG9NbfassHok5KT zSJfA+8OxttTx7a/P/rbks8VwqeFvrBz/sFkjdEVLYb7ms8HyEfGCZzfPF+c+FgB6fng TY4tybflVvqSUQjPuXw1SDj1t4PTNCT0H1RAl/WdCaCCsOSTspZ+1mbDLgB4/aILBjnB 46BA== 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=OrLmNB2GGh31uhER3PTvDlbj/IyEOeXGRijja43l2Mw=; fh=7uDzMV3/DhjOL2ELSwKEfKq4KtWep1Fbm6dq4jdOcOM=; b=CsghVBBqC9mmL+/f056CPvyXEXN3tUVbelyyI+6A+P4ffJj2Cj259oSTEGW/niDG7g lGebhz8fqKoEsCQHUvPBD8dUcnaV0+9ql+WPUybE+LUmiWyS354isun38N3eENjCzg1z c5Pn6uBh5xsrRlqZe8SSlOye5Ww3TM3PX4pK6IWSJROKFvsv6ZB+vRbmnfhtXz/hRstF tX7zbPCb5M2/+24+MkH2eE9Ex/YmlvIkGt3M+qN5zyO9zGqR/O7Dz64LGtZvONRFHs6x IdENTgYFgbV3Bu284iJMWZ3ElkDpcLRD8fe/srRWtbUMbVVG3ELvQlH1VejBvOuj+CIW CUBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSkh7Uv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170902d71300b001a6ef92d441si9504427ply.599.2023.06.28.18.00.30; Wed, 28 Jun 2023 18:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSkh7Uv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbjF2Ajw (ORCPT + 99 others); Wed, 28 Jun 2023 20:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbjF2Ajr (ORCPT ); Wed, 28 Jun 2023 20:39:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457CB10FD for ; Wed, 28 Jun 2023 17:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687999135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OrLmNB2GGh31uhER3PTvDlbj/IyEOeXGRijja43l2Mw=; b=NSkh7Uv3GRNZOg/Z7BJ6T4U7BkY5iH7iziX3zI8EWsYRtyPIfNPwawXBwMh/VMB4YIZvsx IBekc1SRWVuZt5sh1F8o1zFMMeP9p6UECqwSN1PLGaT0DKvRDswMaRpMGpzprHyH6U1cWt qHpr3xlwkugowt4fU1onz3crw21+Sxg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-7BICcNw7Pw6gz7OW3-gGsA-1; Wed, 28 Jun 2023 20:38:49 -0400 X-MC-Unique: 7BICcNw7Pw6gz7OW3-gGsA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7918E3C01C20; Thu, 29 Jun 2023 00:38:48 +0000 (UTC) Received: from ovpn-8-18.pek2.redhat.com (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A527E2166B26; Thu, 29 Jun 2023 00:38:41 +0000 (UTC) Date: Thu, 29 Jun 2023 08:38:36 +0800 From: Ming Lei To: Damien Le Moal Cc: Andreas Hindborg , Hans Holmberg , Aravind Ramesh , Jens Axboe , "open list:BLOCK LAYER" , Christoph Hellwig , Matias Bjorling , Andreas Hindborg , open list , gost.dev@samsung.com, Minwoo Im Subject: Re: [PATCH v4 1/4] ublk: change ublk IO command defines to enum Message-ID: References: <20230628190649.11233-1-nmi@metaspace.dk> <20230628190649.11233-2-nmi@metaspace.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 29, 2023 at 07:47:47AM +0900, Damien Le Moal wrote: > On 6/29/23 04:06, Andreas Hindborg wrote: > > From: Andreas Hindborg > > > > This change is in preparation for zoned storage support. > > > > Signed-off-by: Andreas Hindborg > > --- > > include/uapi/linux/ublk_cmd.h | 23 +++++++++++++++++------ > > 1 file changed, 17 insertions(+), 6 deletions(-) > > > > diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h > > index 4b8558db90e1..471b3b983045 100644 > > --- a/include/uapi/linux/ublk_cmd.h > > +++ b/include/uapi/linux/ublk_cmd.h > > @@ -229,12 +229,23 @@ struct ublksrv_ctrl_dev_info { > > __u64 reserved2; > > }; > > > > -#define UBLK_IO_OP_READ 0 > > -#define UBLK_IO_OP_WRITE 1 > > -#define UBLK_IO_OP_FLUSH 2 > > -#define UBLK_IO_OP_DISCARD 3 > > -#define UBLK_IO_OP_WRITE_SAME 4 > > -#define UBLK_IO_OP_WRITE_ZEROES 5 > > +enum ublk_op { > > + UBLK_IO_OP_READ = 0, > > + UBLK_IO_OP_WRITE = 1, > > + UBLK_IO_OP_FLUSH = 2, > > + UBLK_IO_OP_DISCARD = 3, > > + UBLK_IO_OP_WRITE_SAME = 4, > > + UBLK_IO_OP_WRITE_ZEROES = 5, > > + UBLK_IO_OP_ZONE_OPEN = 10, > > + UBLK_IO_OP_ZONE_CLOSE = 11, > > + UBLK_IO_OP_ZONE_FINISH = 12, > > + UBLK_IO_OP_ZONE_APPEND = 13, > > + UBLK_IO_OP_ZONE_RESET = 15, > > + __UBLK_IO_OP_DRV_IN_START = 32, > > + __UBLK_IO_OP_DRV_IN_END = 96, > > + __UBLK_IO_OP_DRV_OUT_START = __UBLK_IO_OP_DRV_IN_END, > > + __UBLK_IO_OP_DRV_OUT_END = 160, > > +}; > > This patch does not do what the title says. You are also introducing the zone > operations, and the very obscure __UBLK_IO_OP_DRV_XXX operations without an > explanation. Also, why the "__" prefix for these ? I do not see the point... It should be to reserve space for ublk passthrough OP. > Given that this is a uapi, a comment to explain the less obvious commands would > be nice. > > So I think the change to an enum for the existing ops can be done either in > patch 2 or as a separate patch and the introduction of the zone operations done > in patch 3 or as a separate patch. Also it might break userspace by changing to enum from macro for existed definition, cause userspace may check something by '#ifdef UBLK_IO_OP_*', so probably it is better to keep these OPs as enum, or at least keep existed definition as macro. Thanks, Ming