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 2A568C433FE for ; Tue, 5 Apr 2022 04:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229869AbiDEEri (ORCPT ); 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) Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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.