aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-03-10 21:17:10 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-03-10 21:17:10 +0000
commit5a61df011ea10bf1b5e17c8c53e7504995f0fa24 (patch)
tree2985bbb6999c928f3c862fd5a543a494f6bc30e9
parentb0ee912984fe1cebdb765a9626bcb49659cd44c9 (diff)
downloadsrc-5a61df011ea10bf1b5e17c8c53e7504995f0fa24.tar.gz
src-5a61df011ea10bf1b5e17c8c53e7504995f0fa24.zip
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
Notes
Notes: svn path=/head/; revision=279865
-rw-r--r--sys/ofed/drivers/net/mlx4/en_netdev.c13
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 a0a310d62546..68ce12574b67 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: