[Openib-windows] [PATCH] 2 new vendor calls

Fab Tillier ftillier at silverstorm.com
Thu Sep 22 23:22:15 PDT 2005


> From: Leonid Keller [mailto:leonid at mellanox.co.il]
> Sent: Thursday, September 22, 2005 1:09 AM
> 
> Hi Fab,
> 
> Thank you for your comments.
> 
> First of all, the problem with unmapping is in need in releasing of the MDL,
> not in unmapping itself.

Right, the problem is getting a pointer to the MDL, for which we shouldn't trust
the user-mode program.

> You are right about security and resource tracking: i saw these problems, but
> didn't find a simple solution.
> The right solution IMO would have been to add the context of FW_MAP_CRSPACE
> operation to the process resource tracking information and to perform
> FW_UNMAP_CRSPACE automatically upon process termination.
> 
> Then we could remove the context from FW_MAP_CRSPACE and not provide
> FW_UNMAP_CRSPACE at all.

You still want to allow FW_UNMAP_CRSPACE, rather than relying on process
termination to drive that.  The cleanup in case of abnormal process usage is
necessary but shouldn't be the norm.

> Your idea of putting the context into CA object seams to me troublesome:
>         - it prevents several applications to use simultaneously this
> mechanism (on the same HCA);

Do we want to allow multiple applications simultaneous access to the FW?  I
don't think so - it creates the possibility for two different sessions trying to
update the FW simultaneously, which could result in a corrupt FW image.  The FW
access should be serialized to a single client at a time.

>         - if an application was killed and restarted, there will be a memory
> leak.

No, when an application is killed, it's CA object is cleaned up due to the
resource tracking.  If that CA object tracks the FW CR space mapping, then that
can get cleaned up automatically.

> I don't know enough how the resource tracking mechaism works today and whether
> there is a simple way to implement the above solution.
> 
> Could you enlight me on this ?

Currently, the user's CA object (the mlnx_um_ca_t) isn't passed into the calls.
We probably need to change things so that any user's call to ib_open_ca results
in some call to the HCA driver to establish a user context.  Currently, this
only happens for user-mode clients, and that user-mode context isn't used for
any of the other verbs.  If we can fix things to use a per-user CA context in
all the verbs calls, then resource cleanup will be handled in the proxy.

- Fab




More information about the ofw mailing list