svn commit: r257864 - head/sys/ofed/drivers/net/mlx4
Alfred Perlstein
alfred at FreeBSD.org
Fri Nov 8 18:28:49 UTC 2013
Author: alfred
Date: Fri Nov 8 18:28:48 2013
New Revision: 257864
URL: http://svnweb.freebsd.org/changeset/base/257864
Log:
Do not use a sleep lock when protecting the driver flags.
This was causing a locking issue with lagg
Submitted by: odeds
Modified:
head/sys/ofed/drivers/net/mlx4/en_netdev.c
head/sys/ofed/drivers/net/mlx4/mlx4_en.h
Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Nov 8 18:26:28 2013 (r257863)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Nov 8 18:28:48 2013 (r257864)
@@ -919,6 +919,7 @@ void mlx4_en_destroy_netdev(struct net_d
mtx_destroy(&priv->stats_lock.m);
mtx_destroy(&priv->vlan_lock.m);
+ mtx_destroy(&priv->ioctl_lock.m);
kfree(priv);
if_free(dev);
}
@@ -1087,9 +1088,9 @@ static int mlx4_en_ioctl(struct ifnet *d
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
- mutex_lock(&mdev->state_lock);
+ spin_lock(&priv->ioctl_lock);
mlx4_en_set_multicast(dev);
- mutex_unlock(&mdev->state_lock);
+ spin_unlock(&priv->ioctl_lock);
break;
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
@@ -1510,6 +1511,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d
priv->msg_enable = MLX4_EN_MSG_LEVEL;
priv->ip_reasm = priv->mdev->profile.ip_reasm;
mtx_init(&priv->stats_lock.m, "mlx4 stats", NULL, MTX_DEF);
+ mtx_init(&priv->ioctl_lock.m, "mlx4 ioctl", NULL, MTX_DEF);
mtx_init(&priv->vlan_lock.m, "mlx4 vlan", NULL, MTX_DEF);
INIT_WORK(&priv->mcast_task, mlx4_en_do_set_multicast);
INIT_WORK(&priv->watchdog_task, mlx4_en_restart);
Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/mlx4_en.h Fri Nov 8 18:26:28 2013 (r257863)
+++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h Fri Nov 8 18:28:48 2013 (r257864)
@@ -493,6 +493,7 @@ struct mlx4_en_priv {
spinlock_t vlan_lock;
struct mlx4_en_port_state port_state;
spinlock_t stats_lock;
+ spinlock_t ioctl_lock;
unsigned long last_moder_packets[MAX_RX_RINGS];
unsigned long last_moder_tx_packets;
More information about the svn-src-all
mailing list