lkml.org 
[lkml]   [2005]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 14/16] IB uverbs: add mthca user CQ support
From
Date
    >> + int is_kernel;

Andrew> I assume we have one body of code which is capable of
Andrew> handling data structures in either kenrel memory of user
Andrew> memory? (guess).

Andrew> If so, that's a fairly sensitive thing to be doing. Tell
Andrew> us more, please.

It's actually not that bad. A completion queue (CQ) is a basically a
chunk of memory where completion information is written when a work
request completes. The hardware can handle many CQs (64K is not an
unreasonable number), and we always do things like allocation of CQ
numbers, programming HW for CQ context, etc. in the kernel.

Both the kernel and userspace can do data path operations like looking
for a new CQ entry. This means that for userspace CQs, the actual
memory where entries are written should be in userspace. However the
struct mthca_cq will always be in the kernel.

If you look at how the is_kernel flag is used, you can see that all it
does is control whether we allocate/free the actual buffer and a few
other things in the kernel, or just use the stuff that userspace has
already allocated.

- R.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-29 18:17    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site