Date: Sun, 15 Mar 2015 09:05:27 +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-10@freebsd.org Subject: svn commit: r280018 - stable/10/sys/ofed/drivers/net/mlx4 Message-ID: <201503150905.t2F95RaR024717@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Sun Mar 15 09:05:26 2015 New Revision: 280018 URL: https://svnweb.freebsd.org/changeset/base/280018 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/10/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Mar 15 08:09:56 2015 (r280017) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Mar 15 09:05:26 2015 (r280018) @@ -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503150905.t2F95RaR024717>