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 == IB_EVENT_DEVICE_FATAL) { + if (file->fatal_event_raised) + return; + file->fatal_event_raised = 1; + } +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.
In a similar manner to what defined for rdma-cm consumers, let's add IB_EVENT_DEVICE_REMOVAL event and generate both events from here towards the uberbs consumer (the fatal for legacy apps and the device removal for newer apps that maybe want to distinguish between the two)
Need to consider whether it's important for newer applications to distinguish, can be opened for other input. In case we believe so, can be added as an extra patch to that series.
ib_uverbs_async_handler(file, event->element.port_num, event->event, NULL, NULL); }-- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
-- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
