Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-20 Thread Or Gerlitz
On 11/20/2014 9:52 AM, Yishai Hadas wrote: can we avoid the fatal_event_raised flag? We need this flag to prevent generating duplicate event. This may happen when a fatal error occurred and just later the remove one was called when there were active applications. If your only concern is

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-20 Thread Or Gerlitz
On 11/20/2014 9:52 AM, Yishai Hadas wrote: can we avoid the fatal_event_raised flag? We need this flag to prevent generating duplicate event. This may happen when a fatal error occurred and just later the remove one was called when there were active applications. If your only concern is

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-19 Thread Or Gerlitz
On 11/18/2014 11:42 PM, Or Gerlitz wrote: On Tue, Nov 18, 2014 at 6:24 PM, Yishai Hadasyish...@dev.mellanox.co.il The IB device pointer is not valid at all spots, for example after the HW Device was removed, that's why we set this information on the uverbs device. In 2nd thought, they must

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-19 Thread Or Gerlitz
On 11/18/2014 2:11 PM, Yishai Hadas wrote: @@ -533,6 +552,12 @@ void ib_uverbs_event_handler(struct ib_event_handler *handler, struct ib_uverbs_file *file = container_of(handler, struct ib_uverbs_file, event_handler); + if (event-event == IB_EVENT_DEVICE_FATAL) { +

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-19 Thread Yishai Hadas
On 11/19/2014 4:49 PM, Or Gerlitz wrote: On 11/18/2014 2:11 PM, Yishai Hadas wrote: @@ -533,6 +552,12 @@ void ib_uverbs_event_handler(struct ib_event_handler *handler, struct ib_uverbs_file *file = container_of(handler, struct ib_uverbs_file, event_handler); +if (event-event

[PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-18 Thread Yishai Hadas
Enables the uverbs_remove_one to succeed despite the fact that there are running IB applications working with the given ib device. This functionality enables a HW device to be unbind/reset despite the fact that there are running user space applications using it. It exposes a new IB kernel API

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-18 Thread Or Gerlitz
On 11/18/2014 2:11 PM, Yishai Hadas wrote: @@ -923,6 +1062,7 @@ static void ib_uverbs_add_one(struct ib_device *device) if (device_create_file(uverbs_dev-dev, dev_attr_abi_version)) goto err_class; + uverbs_dev-disassociated_supported = device-disassociate_ucontext ? 1

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-18 Thread Or Gerlitz
On 11/18/2014 2:11 PM, Yishai Hadas wrote: @@ -599,6 +638,8 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, struct ib_uverbs_file *file = filp-private_data; struct ib_uverbs_cmd_hdr hdr; __u32 flags; + int srcu_key; + ssize_t ret;

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-18 Thread Yishai Hadas
On 11/18/2014 4:38 PM, Or Gerlitz wrote: On 11/18/2014 2:11 PM, Yishai Hadas wrote: @@ -923,6 +1062,7 @@ static void ib_uverbs_add_one(struct ib_device *device) if (device_create_file(uverbs_dev-dev, dev_attr_abi_version)) goto err_class; +uverbs_dev-disassociated_supported

Re: [PATCH V1 for-next 1/2] IB/uverbs: Enable device removal when there are active user space applications

2014-11-18 Thread Or Gerlitz
On Tue, Nov 18, 2014 at 6:24 PM, Yishai Hadas yish...@dev.mellanox.co.il The IB device pointer is not valid at all spots, for example after the HW Device was removed, that's why we set this information on the uverbs device. let this (flag on the uverbs object) be, but still, no-no for