diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-03-15 09:05:26 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-03-15 09:05:26 +0000 |
commit | 56bfc41fb124e03f514503fa5aa62b566730b945 (patch) | |
tree | 00c8adfdf6d2766ff3da647c91693255797d5e9e /sys/ofed | |
parent | 1e6b99e844773a705057b5f08dec66bf896dbf84 (diff) | |
download | FreeBSD-src-56bfc41fb124e03f514503fa5aa62b566730b945.zip FreeBSD-src-56bfc41fb124e03f514503fa5aa62b566730b945.tar.gz |
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
Diffstat (limited to 'sys/ofed')
-rw-r--r-- | sys/ofed/drivers/net/mlx4/en_netdev.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/ofed/drivers/net/mlx4/en_netdev.c b/sys/ofed/drivers/net/mlx4/en_netdev.c index a0a310d..68ce125 100644 --- a/sys/ofed/drivers/net/mlx4/en_netdev.c +++ b/sys/ofed/drivers/net/mlx4/en_netdev.c @@ -1916,19 +1916,22 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data) 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: |