[ofiwg] Verbs dma-buf detection question

Jason Gunthorpe jgg at ziepe.ca
Mon Mar 29 11:52:42 PDT 2021


On Mon, Mar 29, 2021 at 05:04:10PM +0000, Xiong, Jianxin wrote:
> > From: ofiwg <ofiwg-bounces at lists.openfabrics.org> On Behalf Of Jason Gunthorpe
> > Sent: Monday, March 29, 2021 9:02 AM
> > To: Gal Pressman <galpress at amazon.com>
> > Cc: ofiwg at lists.openfabrics.org
> > Subject: Re: [ofiwg] Verbs dma-buf detection question
> > 
> > On Mon, Mar 29, 2021 at 04:52:43PM +0300, Gal Pressman via ofiwg wrote:
> > > Hey,
> > >
> > > I'm looking at the code that tests the kernel for umem dma-buf support
> > > in
> > > vrb_set_dmabuf_support() and wondering if I'm missing anything.
> > >
> > > The code checks /proc/kallsyms for the ib_umem_dmabuf_get() symbol
> > > existence, which kinda treats it as ABI, although the kernel symbol
> > > name could change at any time.
> > >
> > > Wondering what other people thoughts are? Maybe a better detection
> > > method is called for?
> > 
> > Expunge such an ridiculous thing from libfabric with fire.
> > 
> > Call ib_umem_dmabuf_get() and check for EOPNOTSUPP
> > 
> > Jason
> 
> This is a kernel symbol, can't be called from user space like that.
> 
> By the way, the function vrb_set_dmabuf_support() works exactly like
> another function vrb_set_peer_mem_support(), the difference is the
> kernel symbol being checked.

Don't write code like that, all of that needs to be expunged.

> Any suggestion on better way to do this is welcome. 

I gave above.

Jason


More information about the ofiwg mailing list