Date: Thu, 7 Apr 2016 07:31:17 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r297649 - stable/9/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <201604070731.u377VHj1076158@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Apr 7 07:31:17 2016 New Revision: 297649 URL: https://svnweb.freebsd.org/changeset/base/297649 Log: MFC r296909: Fix witness panic in the ipoib_ioctl() function when unloading the ipoib module. The bpfdetach() function is trying to turn off promiscious mode on the network interface it is attached to while holding a mutex. The fix consists of ignoring any further calls to the ipoib_ioctl() function when the network interface is going to be detached. The ipoib_ioctl() function might sleep. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Thu Apr 7 07:29:57 2016 (r297648) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Thu Apr 7 07:31:17 2016 (r297649) @@ -319,6 +319,8 @@ struct ipoib_dev_priv { unsigned long flags; + int gone; + struct mutex vlan_mutex; struct rb_root path_tree; Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Apr 7 07:29:57 2016 (r297648) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Apr 7 07:31:17 2016 (r297649) @@ -258,6 +258,10 @@ ipoib_ioctl(struct ifnet *ifp, u_long co struct ifreq *ifr = (struct ifreq *) data; int error = 0; + /* check if detaching */ + if (priv == NULL || priv->gone != 0) + return (ENXIO); + switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { @@ -794,6 +798,7 @@ ipoib_detach(struct ipoib_dev_priv *priv dev = priv->dev; if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { + priv->gone = 1; bpfdetach(dev); if_detach(dev); if_free(dev);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604070731.u377VHj1076158>