diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-03-10 21:17:10 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-03-10 21:17:10 +0000 |
commit | e09330b6b5ebddd1e9e7a09c994b3f982d12ed51 (patch) | |
tree | 2985bbb6999c928f3c862fd5a543a494f6bc30e9 /sys/ofed | |
parent | 564efa5c094daac4e86d36af51649ae394beb6af (diff) | |
download | FreeBSD-src-e09330b6b5ebddd1e9e7a09c994b3f982d12ed51.zip FreeBSD-src-e09330b6b5ebddd1e9e7a09c994b3f982d12ed51.tar.gz |
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
MFC after: 3 days
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: |