[lkml]   [2004]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH][RFC/v1][9/12] Add InfiniBand userspace MAD support
On Mon, Nov 22, 2004 at 07:14:11AM -0800, Roland Dreier wrote:
> Add a driver that provides a character special device for each
> InfiniBand port. This device allows userspace to send and receive
> MADs via write() and read() (with some control operations implemented
> as ioctls).

Do you really need these ioctls?

For example:

> +static int ib_umad_ioctl(struct inode *inode, struct file *filp,
> + unsigned int cmd, unsigned long arg)
> +{
> + switch (cmd) {
> + return put_user(IB_USER_MAD_ABI_VERSION,
> + (u32 __user *) arg) ? -EFAULT : 0;

This could be in a sysfs file, right?

> + return ib_umad_reg_agent(filp->private_data, arg);
> + return ib_umad_unreg_agent(filp->private_data, arg);

You are letting any user, with any privilege register or unregister an

And shouldn't you lock your list of agent ids when adding or removing
one, or are you relying on the BKL of the ioctl call? If so, please
document this.

Also, these "agents" seem to be a type of filter, right? Is there no
other way to implement this than an ioctl?


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:08    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean