On Mon, Mar 27, 2017 at 10:55:00PM +0300, Leon Romanovsky wrote: > On Mon, Mar 27, 2017 at 03:18:59AM -0400, Shamir Rabinovitch wrote: > > When udev renames the netdev devices, ipoib debugfs entries does not > > get renamed. As a result, if subsequent probe of ipoib device reuse the > > name then creating a debugfs entry for the new device would fail. > > > > Also, moved ipoib_create_debug_files and ipoib_delete_debug_files as part > > of ipoib event handling in order to avoid any race condition between these. > > > > Signed-off-by: Vijay Kumar <vijay.ac.kumar@xxxxxxxxxx> > > Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx> > > > > --- > > v2->v3: > > - Move rev change out of commit message > > - Fix typo > > v1->v2: > > - Review comment from Mark Bloch <markb@xxxxxxxxxxxx> > > Verified again and NETDEV_UNREGISTER is called correctly. Debug > > files are removed as expected. Thanks. > > - Fix compile warning when CONFIG_INFINIBAND_IPOIB_DEBUG is not set > > --- > > [...] > > > > +#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG > > +static int ipoib_netdev_event(struct notifier_block *this, > > + unsigned long event, void *ptr) > > +{ > > + struct netdev_notifier_info *ni = ptr; > > + struct net_device *dev = ni->dev; > > + > > + if (dev->netdev_ops->ndo_open != ipoib_open) > > + return NOTIFY_DONE; > > + > > + switch (event) { > > + case NETDEV_REGISTER: > > + ipoib_create_debug_files(dev); > > + break; > > + case NETDEV_CHANGENAME: > > + ipoib_debugfs_rename(dev); > > Why do we need explicit ipoib_debugfs_rename function? > Will it work by simply calling ipoib_delete_debug_files > and immediately after that ipoib_create_debug_files? > > > > + break; > > + case NETDEV_UNREGISTER: > > + ipoib_delete_debug_files(dev); > > + break; > > + } > > + > > + return NOTIFY_DONE; > > +} > > +#endif > > + Hi Leon, Good point. I will have look on this idea and get back to you. BR, Shamir -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html