From: 'Christoph Hellwig' Subject: Re: [PATCH V3 1/5] RDMA/core: Transport-independent access flags Date: Wed, 15 Jul 2015 05:19:26 -0700 Message-ID: <20150715121926.GB14993@infradead.org> References: <559FC710.1050307@talpey.com> <20150710161108.GA19042@obsidianresearch.com> <55A24571.60902@dev.mellanox.co.il> <00e201d0be6a$e49bc910$add35b30$@opengridcomputing.com> <20150714192941.GA26292@obsidianresearch.com> <00e401d0be6b$d3952750$7abf75f0$@opengridcomputing.com> <20150714195511.GB7716@infradead.org> <20150714202943.GB26927@obsidianresearch.com> <55A61E38.20201@dev.mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <55A61E38.20201-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sagi Grimberg Cc: Jason Gunthorpe , 'Christoph Hellwig' , Steve Wise , 'Steve Wise' , 'Tom Talpey' , 'Doug Ledford' , sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, trond.myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org, bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org, 'Oren Duer' List-Id: linux-rdma@vger.kernel.org On Wed, Jul 15, 2015 at 11:47:52AM +0300, Sagi Grimberg wrote: > > struct ib_pd *ib_alloc_pd(struct ib_device *device) > > { > > struct ib_pd *pd; > >+ struct ib_device_attr devattr; > >+ int rc; > >+ > >+ rc = ib_query_device(device, &devattr); > >+ if (rc) > >+ return ERR_PTR(rc); > > Unrelated question, > Can we just cache the dev_attr in ib_device already? It's pretty > obvious that each consumer that opens a device will automatically > query its attributes... Instead of caching it I'd suggest to kill ib_device_attr and move the field into struct ib_device, similar to how all major kernel subsystems work. Otherwise fully agreed. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html