aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-15 03:15:08 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-15 03:15:08 -0400
commitb9e40857682ecfc5bcd0356a23ff409883ffb982 (patch)
treed241fd289bed6d16f36f6d26815c1e78e212c89a /drivers
parente308a5d806c852f56590ffdd3834d0df0cbed8d7 (diff)
netdev: Do not use TX lock to protect address lists.
Now that we have a specific lock to protect the network device unicast and multicast lists, remove extraneous grabs of the TX lock in cases where the code only needs address list protection. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c6
-rw-r--r--drivers/net/bonding/bond_main.c24
-rw-r--r--drivers/net/sfc/efx.c6
-rw-r--r--drivers/net/wireless/libertas/main.c6
5 files changed, 14 insertions, 30 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 261ab7150431..cd2fb955040f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -774,7 +774,6 @@ void ipoib_mcast_restart_task(struct work_struct *work)
774 ipoib_mcast_stop_thread(dev, 0); 774 ipoib_mcast_stop_thread(dev, 0);
775 775
776 local_irq_save(flags); 776 local_irq_save(flags);
777 netif_tx_lock(dev);
778 netif_addr_lock(dev); 777 netif_addr_lock(dev);
779 spin_lock(&priv->lock); 778 spin_lock(&priv->lock);
780 779
@@ -853,7 +852,6 @@ void ipoib_mcast_restart_task(struct work_struct *work)
853 852
854 spin_unlock(&priv->lock); 853 spin_unlock(&priv->lock);
855 netif_addr_unlock(dev); 854 netif_addr_unlock(dev);
856 netif_tx_unlock(dev);
857 local_irq_restore(flags); 855 local_irq_restore(flags);
858 856
859 /* We have to cancel outside of the spinlock */ 857 /* We have to cancel outside of the spinlock */
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index 809d18c663bc..c2c033722a93 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -1133,8 +1133,7 @@ static void wq_set_multicast_list (struct work_struct *work)
1133 1133
1134 dvb_net_feed_stop(dev); 1134 dvb_net_feed_stop(dev);
1135 priv->rx_mode = RX_MODE_UNI; 1135 priv->rx_mode = RX_MODE_UNI;
1136 netif_tx_lock_bh(dev); 1136 netif_addr_lock_bh(dev);
1137 netif_addr_lock(dev);
1138 1137
1139 if (dev->flags & IFF_PROMISC) { 1138 if (dev->flags & IFF_PROMISC) {
1140 dprintk("%s: promiscuous mode\n", dev->name); 1139 dprintk("%s: promiscuous mode\n", dev->name);
@@ -1159,8 +1158,7 @@ static void wq_set_multicast_list (struct work_struct *work)
1159 } 1158 }
1160 } 1159 }
1161 1160
1162 netif_addr_unlock(dev); 1161 netif_addr_unlock_bh(dev);
1163 netif_tx_unlock_bh(dev);
1164 dvb_net_feed_start(dev); 1162 dvb_net_feed_start(dev);
1165} 1163}
1166 1164
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ea71abd6f728..fd87dbe7999a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1567,14 +1567,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1567 goto err_close; 1567 goto err_close;
1568 } 1568 }
1569 1569
1570 netif_tx_lock_bh(bond_dev); 1570 netif_addr_lock_bh(bond_dev);
1571 netif_addr_lock(bond_dev);
1572 /* upload master's mc_list to new slave */ 1571 /* upload master's mc_list to new slave */
1573 for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { 1572 for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
1574 dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); 1573 dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
1575 } 1574 }
1576 netif_addr_unlock(bond_dev); 1575 netif_addr_unlock_bh(bond_dev);
1577 netif_tx_unlock_bh(bond_dev);
1578 } 1576 }
1579 1577
1580 if (bond->params.mode == BOND_MODE_8023AD) { 1578 if (bond->params.mode == BOND_MODE_8023AD) {
@@ -1938,11 +1936,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1938 } 1936 }
1939 1937
1940 /* flush master's mc_list from slave */ 1938 /* flush master's mc_list from slave */
1941 netif_tx_lock_bh(bond_dev); 1939 netif_addr_lock_bh(bond_dev);
1942 netif_addr_lock(bond_dev);
1943 bond_mc_list_flush(bond_dev, slave_dev); 1940 bond_mc_list_flush(bond_dev, slave_dev);
1944 netif_addr_unlock(bond_dev); 1941 netif_addr_unlock_bh(bond_dev);
1945 netif_tx_unlock_bh(bond_dev);
1946 } 1942 }
1947 1943
1948 netdev_set_master(slave_dev, NULL); 1944 netdev_set_master(slave_dev, NULL);
@@ -2063,11 +2059,9 @@ static int bond_release_all(struct net_device *bond_dev)
2063 } 2059 }
2064 2060
2065 /* flush master's mc_list from slave */ 2061 /* flush master's mc_list from slave */
2066 netif_tx_lock_bh(bond_dev); 2062 netif_addr_lock_bh(bond_dev);
2067 netif_addr_lock(bond_dev);
2068 bond_mc_list_flush(bond_dev, slave_dev); 2063 bond_mc_list_flush(bond_dev, slave_dev);
2069 netif_addr_unlock(bond_dev); 2064 netif_addr_unlock_bh(bond_dev);
2070 netif_tx_unlock_bh(bond_dev);
2071 } 2065 }
2072 2066
2073 netdev_set_master(slave_dev, NULL); 2067 netdev_set_master(slave_dev, NULL);
@@ -4679,11 +4673,9 @@ static void bond_free_all(void)
4679 struct net_device *bond_dev = bond->dev; 4673 struct net_device *bond_dev = bond->dev;
4680 4674
4681 bond_work_cancel_all(bond); 4675 bond_work_cancel_all(bond);
4682 netif_tx_lock_bh(bond_dev); 4676 netif_addr_lock_bh(bond_dev);
4683 netif_addr_lock(bond_dev);
4684 bond_mc_list_destroy(bond); 4677 bond_mc_list_destroy(bond);
4685 netif_addr_unlock(bond_dev); 4678 netif_addr_unlock_bh(bond_dev);
4686 netif_tx_unlock_bh(bond_dev);
4687 /* Release the bonded slaves */ 4679 /* Release the bonded slaves */
4688 bond_release_all(bond_dev); 4680 bond_release_all(bond_dev);
4689 bond_destroy(bond); 4681 bond_destroy(bond);
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index e1257e556e48..7b2015f9e469 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -696,10 +696,8 @@ static void efx_stop_port(struct efx_nic *efx)
696 696
697 /* Serialise against efx_set_multicast_list() */ 697 /* Serialise against efx_set_multicast_list() */
698 if (efx_dev_registered(efx)) { 698 if (efx_dev_registered(efx)) {
699 netif_tx_lock_bh(efx->net_dev); 699 netif_addr_lock_bh(efx->net_dev);
700 netif_addr_lock(efx->net_dev); 700 netif_addr_unlock_bh(efx->net_dev);
701 netif_addr_unlock(efx->net_dev);
702 netif_tx_unlock_bh(efx->net_dev);
703 } 701 }
704} 702}
705 703
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 42e9b2771eab..14d5d61cec4c 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -593,8 +593,7 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
593 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) 593 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
594 return nr_addrs; 594 return nr_addrs;
595 595
596 netif_tx_lock_bh(dev); 596 netif_addr_lock_bh(dev);
597 netif_addr_lock(dev);
598 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) { 597 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) {
599 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) { 598 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) {
600 lbs_deb_net("mcast address %s:%s skipped\n", dev->name, 599 lbs_deb_net("mcast address %s:%s skipped\n", dev->name,
@@ -609,8 +608,7 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
609 print_mac(mac, mc_list->dmi_addr)); 608 print_mac(mac, mc_list->dmi_addr));
610 i++; 609 i++;
611 } 610 }
612 netif_addr_unlock(dev); 611 netif_addr_unlock_bh(dev);
613 netif_tx_unlock_bh(dev);
614 if (mc_list) 612 if (mc_list)
615 return -EOVERFLOW; 613 return -EOVERFLOW;
616 614