[openib-general] Re: [RFC] userspace CM/verbs QP
Libor Michalek
libor at topspin.com
Fri Mar 4 10:08:38 PST 2005
On Fri, Mar 04, 2005 at 08:58:41AM -0800, Roland Dreier wrote:
> I thought about this a little more. There is a problem with letting
> the CM module look up QPs in the userspace verbs table: it becomes
> very awkward to check that the the QP belongs to a context (==
> userspace verbs file descriptor) owned by the CM user.
>
> I see the following solutions:
>
> 1. Don't worry about checking. There's nothing too evil a CM user
> can do with a QP beyond getting another QP to connect to it, since
> the CM user can't modify a QP unless it legitimately owns it. And
> an evil user can always guess the QPN instead of the QP handle anyway.
>
> 2. Change the CM API so that it just takes the QPN, QP type, SRQ
> status and device directly rather than reading it out of the QP.
> This lets the userspace CM just get the info from userspace
> without needing to look at the QP at all. Of course it does raise
> the issue of how userspace should specify the device.
As you say, the second solution does not resolve the issue about which
you are worried in the first solution. The device issue I think still
creates a dependancy between the kernel components of uverbs and ucm,
it's just moved down the chain, since the only thing that has the user
to kernel mapping of the device handle is uverbs. Unless that code is
duplicated, and then it becomes a software maintenance dependency...
> Personally I would lean slightly towards #2, since it feels to me like
> even the kernel CM API would be cleaner that way. However I don't
> have a good answer for how userspace should specify which device to
> use.
I'm still leaning towards #1, if it comes down to a choice between
device or QP that needs to be exposed, the QP seems more intuitive to
me.
-Libor
More information about the general
mailing list