[openib-general] Re: creative file descriptor abuse in uverbs
Roland Dreier
rdreier at cisco.com
Tue Apr 18 09:30:19 PDT 2006
Christoph> I'd like to get rid of get_empty_filp midterm. Because
Christoph> of that's I've looked at all the users, and the only
Christoph> modular and most creative one is the uverbs code.
Christoph> Everything else only every returns new fds from
Christoph> syscalls, which is a good thing. Trying to show-horn
Christoph> fds into ->write otohg creates various problems. Any
Christoph> chance you could change this to creating new files in
Christoph> an uversfs or something when doing the next ABI
Christoph> revision for uverbs? (I suspect there'll be a major
Christoph> change for iWarp integration?)
Yes, I'm very open to cleaning up the uverbs interface, and I have
thought that iWARP integration would be a good time to break the world
(although I would want to leave the current interface for a kernel
release or two afterwards).
However I'm not sure that uverbsfs is the right answer. Currently the
reason uverbs creates file descriptors as part of the write() call is
to do the following:
- userspace creates a "context" by opening a device special file
- userspace creates 1 or more "event channels," which are new file
descriptors, attached to that context by issuing a command via write()
(other commands like "create queue pair" or "register memory" are
also issued via write())
The closest analogy I can come up with is doing socket()/bind() and
then accept() on the socket, which returns a new file desc.
This socket analogy leads to adding a new syscall (or ~20 syscalls if
we want to make the whole uverbs interface into syscalls), and I'm not
sure that we understand the needs of iWARP integration well enough to
freeze things into syscalls...
- R.
More information about the general
mailing list