svn commit: r280019 - stable/9/sys/ofed/drivers/net/mlx4

Hans Petter Selasky hselasky at FreeBSD.org
Sun Mar 15 09:07:00 UTC 2015


Author: hselasky
Date: Sun Mar 15 09:06:59 2015
New Revision: 280019
URL: https://svnweb.freebsd.org/changeset/base/280019

Log:
  MFC r279865:
  Ensure setting promiscious mode when a network interface is up, is
  always non-blocking by not locking a SX type of mutex.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c
==============================================================================
--- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c	Sun Mar 15 09:05:26 2015	(r280018)
+++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c	Sun Mar 15 09:06:59 2015	(r280019)
@@ -1916,19 +1916,22 @@ static int mlx4_en_ioctl(struct ifnet *d
 		error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu);
 		break;
 	case SIOCSIFFLAGS:
-		mutex_lock(&mdev->state_lock);
 		if (dev->if_flags & IFF_UP) {
-			if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0)
+			if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+				mutex_lock(&mdev->state_lock);
 				mlx4_en_start_port(dev);
-			else
+				mutex_unlock(&mdev->state_lock);
+			} else {
 				mlx4_en_set_rx_mode(dev);
+			}
 		} else {
+			mutex_lock(&mdev->state_lock);
 			if (dev->if_drv_flags & IFF_DRV_RUNNING) {
 				mlx4_en_stop_port(dev);
-                                if_link_state_change(dev, LINK_STATE_DOWN);
+				if_link_state_change(dev, LINK_STATE_DOWN);
 			}
+			mutex_unlock(&mdev->state_lock);
 		}
-		mutex_unlock(&mdev->state_lock);
 		break;
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:


More information about the svn-src-stable-9 mailing list