> From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma- > owner@xxxxxxxxxxxxxxx] On Behalf Of Doug Ledford > > not part of this RFC. User space applications should monitor > > respectful changes > > > > in the system according to its specific logic to detect plugout or > > plugin of > > > > hardware devices. This can be does by means of: netlink, udev or other > > inputs. > > On this point I disagree. I see no reason that we should implement hotplug > detection in every application when the library can get it right just once and > make it available to everyone. > This is definitely something we should consider doing, but orthogonal to obtaining an up-to-date device list. > > Here I suggest to modify the implementation of ibv_get_device_list() > > so that > > > > consecutive calls will re-scan the sysfs in the same manner as done > > today in > > > > order to create a fresh ibv_device list each time. We will remove > > caching of > > > > devices that support plugout, while keeping the ibv_device cache for > > devices > > > > which do not support plugout. > > I would argue that a better solution is to, on first call into > ibv_get_device_list() (which doubles as the library's init() entry), we scan the > system for whatever devices there are, build a permanent list of these devices, > then register the necessary hooks ourselves to get updates on both plug out and > plug in, and on those events we update the list as appropriate (on plug out, > notify the application via async event, after the application has processed the > event, if the device is unused, remove the device entirely, if the device is still in > use, then move it to a defunct list and wait for the application to be able to > release all of its references to it, and only then remove it; on plug in, add a new > device to the device list and notify the application via async event at which point > the application can decide if it wants to use the device). This might actually > involve a new async notifier added to the libibverbs API that is not tied to a > device and which an application would need to be modified to register with the > library. > But since any applicaiton wanting to support this is going to need to be modified > anyway, a new entry point isn't the end of the world. > I don't think that we should introduce an asych context into libibverbs. Also, not all apps would like to process such asynch events - some merely want to use the RDMA subsystem at some time and get an up-to-date device list. In the future, I would introduce some ibv_create_notifier_channel(), which apps can ibv_get_notifier_event() from it that informs that the device list has changed... This is a simpler API that maintains backward compatibility with ibv_get_device_list(). --Liran ��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f