Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp120778lfu; Mon, 4 Apr 2022 21:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6JcU6C0BM1iYFvZBxh5nRwphoo0BdVOtIMRf6tSIZ1sjIYioyqx5Syvr9Ir6HAFIRyHrq X-Received: by 2002:a17:907:6ea4:b0:6e1:260e:a232 with SMTP id sh36-20020a1709076ea400b006e1260ea232mr1665485ejc.15.1649134074471; Mon, 04 Apr 2022 21:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649134074; cv=none; d=google.com; s=arc-20160816; b=w7aaxCh/VGWb7YLwKSN3EZu7Ax7oJXQ9nitGOW60Lf4bpIAzvfIEss5M3DE1lkik5t QLSQgbWMUVAyug+TRymX2x7BSscTZXy3EYw3wsWubqRtmK2NhVniSlBWiQvZOmez5OAw qY8BSJar9IhXa7aN3b9if1KwViMX+mR6ohdpMJsRcy6SFQYSuBsQECZgj94NvPnX9O65 R9rm5N03v+ayrHoEkTEQqwgffeyGSOKlnWT/REhH+MuZtPn8kkfy477pQ+4nv1RoDzLo zRBkLMDfTr4G+4/hY+TJa+YHtv4T8qDl7jO6/ncMNaovp9AeT/HR76HRQ3a9GznmG4O3 O2Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PCgocASYb5ArghU+oTyvqsztKe9LiYcQI30nZn4L4rs=; b=ajYmmOWjfrG7/i06PpC7upw6LtZimbm9Z5KO82kF7zmijnQ67LgDVEhgisLedJ/rnN du7K/zurcp2jI/eFwFEBck5iyXpQwXb63ByIWO0y+EiyT3ZtFixGFltWI5adn6dB0dhc TzoyU15DlZaOhbhJiSMaT0qmoSaOynQ9++qUYUKV/Uf0VqkerY2bektbooL9C0xlKUip ReAJzIBflIvHM0Mis8lt0d1WwwFqFiymPEAHvAvNRlqHYLsCLdgWdr6DTidma/kmoepc NTKtl8uow3arIYvPaFRU8oI8bGHcniRYvoRD+h8POUPawtRKFlQ6wtlmJVlVfiu3Urrg GYNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a509d0b000000b004190c9f1e68si7718872ede.110.2022.04.04.21.46.55; Mon, 04 Apr 2022 21:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229839AbiDEEri (ORCPT + 99 others); Tue, 5 Apr 2022 00:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbiDEErM (ORCPT ); Tue, 5 Apr 2022 00:47:12 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E31F9FD9; Mon, 4 Apr 2022 21:43:37 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 71A6168AFE; Tue, 5 Apr 2022 06:43:31 +0200 (CEST) Date: Tue, 5 Apr 2022 06:43:31 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Ariel Elior , Anna Schumaker , Jens Axboe , Christian Benvenuti , Potnuri Bharat Teja , Bernard Metzler , Bart Van Assche , Chuck Lever , "David S. Miller" , Dennis Dalessandro , Christoph Hellwig , Keith Busch , Chaitanya Kulkarni , Jakub Kicinski , Leon Romanovsky , linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, Max Gurtovoy , Mike Marciniszyn , Michal Kalderon , Mustafa Ismail , Nelson Escobar , netdev@vger.kernel.org, Paolo Abeni , rds-devel@oss.oracle.com, Sagi Grimberg , samba-technical@lists.samba.org, Santosh Shilimkar , Selvin Xavier , Steve French , Shiraz Saleem , target-devel@vger.kernel.org, Trond Myklebust , Yishai Hadas , Zhu Yanjun , Xiao Yang Subject: Re: [PATCH] RDMA: Split kernel-only global device caps from uvers device caps Message-ID: <20220405044331.GA22322@lst.de> References: <0-v1-47e161ac2db9+80f-kern_caps_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0-v1-47e161ac2db9+80f-kern_caps_jgg@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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-nfs@vger.kernel.org On Mon, Apr 04, 2022 at 01:18:00PM -0300, Jason Gunthorpe wrote: > Split ib_device::device_cap_flags into kernel_cap_flags that holds the > flags only used by the kernel. > > This cleanly splits out the uverbs flags from the kernel flags to avoid > confusion in the flags bitmap. > Followup from Xiao Yang's series Can you point me to this series? > - if (!(device->attrs.device_cap_flags & IB_DEVICE_ALLOW_USER_UNREG)) { > + if (!(device->attrs.kernel_cap_flags & IB_KDEVICE_ALLOW_USER_UNREG)) { Maybe shorten the prefix to IBD_ ? > +enum ib_kernel_cap_flags { > + /* > + * This device supports a per-device lkey or stag that can be > + * used without performing a memory registration for the local > + * memory. Note that ULPs should never check this flag, but > + * instead of use the local_dma_lkey flag in the ib_pd structure, > + * which will always contain a usable lkey. > + */ > + IB_KDEVICE_LOCAL_DMA_LKEY = 1 << 0, > + IB_KDEVICE_UD_TSO = 1 << 1, > + IB_KDEVICE_BLOCK_MULTICAST_LOOPBACK = 1 << 2, > + IB_KDEVICE_INTEGRITY_HANDOVER = 1 << 3, > + IB_KDEVICE_ON_DEMAND_PAGING = 1ULL << 4, > + IB_KDEVICE_SG_GAPS_REG = 1ULL << 5, > + IB_KDEVICE_VIRTUAL_FUNCTION = 1ULL << 6, > + IB_KDEVICE_RDMA_NETDEV_OPA = 1ULL << 7, > + IB_KDEVICE_ALLOW_USER_UNREG = 1ULL << 8, > +}; And maybe not in this patch, but if you touch this anyway please add comments to document allthe flags.