[Openib-windows] HCA: register_segment confusion

Leonid Keller leonid at mellanox.co.il
Sun Oct 16 11:28:01 PDT 2005


SB

> -----Original Message-----
> From: Fab Tillier [mailto:ftillier at silverstorm.com]
> Sent: Wednesday, October 12, 2005 8:25 PM
> To: 'Leonid Keller'; openib-windows at openib.org
> Subject: RE: [Openib-windows] HCA: register_segment confusion
> 
> 
> > From: Leonid Keller [mailto:leonid at mellanox.co.il]
> > Sent: Tuesday, October 11, 2005 1:50 AM
> > 
> > > ... what the code is trying to do here?
> >
> > This code is trying to produce different and exact return 
> codes in case of
> > error.
> > "fake_ro" mechanism is intended to check, whether a failure 
> on IoReadAccess is
> > caused by access permission violation (then it returns 
> MT_EPERM) or some other
> > reason (MT_EAGAIN).
> > Retry mechanism helps differentiate between 2 causes of
> > STATUS_ACCESS_VIOLATION: wrong access permissions 
> (MT_EPERM) or invalid
> > virtual address (MT_ENOMEM).
> > Just FYI: the most popular cause of MT_EAGAIN - the 
> exception 0xc00000a1
> > ("process memory quote is exceeded"), which happens upon 
> large allocations.
> 
> Does the user really care what the actual error cause was, 
> beyond the fact that
> there was an access violation?
> 

Historically, this code was developed to satisfy our elaborate tests, which
generated all possible error situations and checked return codes.
I can bring at least one reason for such elaboration in error codes: on
getting MT_EAGAIN user can want to repeat this call after some time.
In pracice, i doubt that someone will do that, that's why i've removed all
this cumbersome stuff.


> > > I started looking at adding support for large registrations ...
> >
> > this code is checked to successfully register 1GB buffers.
> 
> You're right - I just wasn't following the code flow properly.
> 
> > > Memory locking should be a whole lot simpler ...
> >
> > As far as Gen2 driver tends to return only several main 
> error codes and i
> > needed
> > MOSAL_iobuf_register/deregister services, i've taken these 
> routines to the low
> > level driver and simplified them by removing both mechanisms.
> >
> > I'm going to publish the code of the driver as it is, so 
> you'll see the new
> > variant and be able to comment on it.
> 
> Great, thanks!
> 
> - Fab
> 
> > > -----Original Message-----
> > > From: Fab Tillier [mailto:ftillier at silverstorm.com]
> > > Sent: Monday, October 10, 2005 10:50 PM
> > > To: openib-windows at openib.org
> > > Subject: [Openib-windows] HCA: register_segment confusion
> > >
> > >
> > > The register_segment function (mosal_iobuf.c at 74) is a bit
> > > confusing to say the
> > > least.  What's the deal with the "fake_ro" checks, and trying
> > > to lock the pages
> > > multiple times in different ways?  Can someone from Mellanox
> > > help explain what
> > > the code is trying to do here?  What does the retry flag do?
> > > What's going on
> > > with the alternating read/write checks if modify right 
> checks fail?
> > >
> > > I started looking at adding support for large registrations,
> > > and I'm worried
> > > that if I touch something it'll all fall over.  Memory
> > > locking should be a whole
> > > lot simpler than what's going on here, and the comments don't
> > > really help.
> > >
> > > Thanks,
> > >
> > > - Fab
> > >
> > > _______________________________________________
> > > openib-windows mailing list
> > > openib-windows at openib.org
> > > http://openib.org/mailman/listinfo/openib-windows
> > >
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051016/3e360ed6/attachment.html>


More information about the ofw mailing list