RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-07-16 Thread Marciniszyn, Mike
But personally, I hate seeing write() used to emulate ioctl() because 'ioctl is bad'. ie if you are 'writing' a struct that contains user pointers and you expect the kernel to read/write to user memory, then use ioctl. (and that is the 'badness' of ioctl, so pretending it is write doesn't

Re: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-07-09 Thread Jason Gunthorpe
On Wed, Jul 08, 2015 at 09:42:39PM +, Marciniszyn, Mike wrote: netlink is a reasonable low speed format to use for this kind of serialization, either via the common mux or via your own char device. A couple of follow-up netlink questions. 1. I assume you are talking about

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-07-08 Thread Marciniszyn, Mike
netlink is a reasonable low speed format to use for this kind of serialization, either via the common mux or via your own char device. A couple of follow-up netlink questions. 1. I assume you are talking about generic netlink vs. say the RDMA netlink. The generic netlink handles dynamic

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-07-08 Thread Marciniszyn, Mike
so what's the role of the char-device? why should a low-level driver which is part of the upstream RDMA stack contain a char-device? Or. Contains additional char devices: - PSM character device - diagnostic character devices The nature of the hardware requires both of these additional

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-17 Thread Marciniszyn, Mike
Do you have a link to this comment? I'm missing a bunch of messages from this thread and can't find anything from Al in the logs. This commit appeared in qib and it did not appear on linux-rdma. I never saw it until it appeared. I emailed on list to Al in

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-17 Thread Hefty, Sean
PSM2 (and PSM) uses this to dialog with the driver for hardware specific setup. I'm suspected at some point in the past, this was ioctl based and changed due to bias against ioctl. Could this be distinguished based on a common command header? -- To unsubscribe from this list: send the line

Re: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-17 Thread Jason Gunthorpe
On Wed, Jun 17, 2015 at 12:05:08PM +, Marciniszyn, Mike wrote: Jason, what is your take on ioctl vs. write. Well, I think the global view keeps changing, so I'm not sure what is trendy now.. But personally, I hate seeing write() used to emulate ioctl() because 'ioctl is bad'. ie if you are

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-15 Thread Hefty, Sean
+int __init dev_init(void) +{ + int ret; + + ret = alloc_chrdev_region(hfi1_dev, 0, HFI1_NMINORS, DRIVER_NAME); + if (ret 0) { + pr_err(Could not allocate chrdev region (err %d)\n, - ret); + goto done; + } + + class

Re: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-15 Thread Jason Gunthorpe
On Mon, Jun 15, 2015 at 06:11:02PM +, Hefty, Sean wrote: Was Al Viro's comment on qib addressed here? That would be a showstopper for me.. Do you have a link to this comment? I'm missing a bunch of messages from this thread and can't find anything from Al in the logs. Author: Al

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-15 Thread Hefty, Sean
Was Al Viro's comment on qib addressed here? That would be a showstopper for me.. Do you have a link to this comment? I'm missing a bunch of messages from this thread and can't find anything from Al in the logs. - Sean -- To unsubscribe from this list: send the line unsubscribe linux-rdma in

RE: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-15 Thread Marciniszyn, Mike
Do you have a link to this comment? I'm missing a bunch of messages from this thread and can't find anything from Al in the logs. This commit appeared in qib and it did not appear on linux-rdma. I never saw it until it appeared. I emailed on list to Al in

Re: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-15 Thread Jason Gunthorpe
On Sun, Jun 14, 2015 at 11:58:00PM +0300, Or Gerlitz wrote: On Fri, Jun 12, 2015 at 2:09 AM, Mike Marciniszyn mike.marcinis...@intel.com wrote: +++ b/drivers/infiniband/hw/hfi1/device.c +int __init dev_init(void) +{ + int ret; + + ret = alloc_chrdev_region(hfi1_dev, 0,

Re: [PATCH 06/41] IB/hfi1: add char device instantiation code

2015-06-14 Thread Or Gerlitz
On Fri, Jun 12, 2015 at 2:09 AM, Mike Marciniszyn mike.marcinis...@intel.com wrote: +++ b/drivers/infiniband/hw/hfi1/device.c +int __init dev_init(void) +{ + int ret; + + ret = alloc_chrdev_region(hfi1_dev, 0, HFI1_NMINORS, DRIVER_NAME); + if (ret 0) { +