Commit ddf28100 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: fine-tune L3 mcast locking

Push the inet6_dev locking down into the helper that actually needs it
for walking the mc_list.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8311c7a2
...@@ -1206,6 +1206,7 @@ static void qeth_l3_add_mc6_to_hash(struct qeth_card *card, ...@@ -1206,6 +1206,7 @@ static void qeth_l3_add_mc6_to_hash(struct qeth_card *card,
if (!tmp) if (!tmp)
return; return;
read_lock_bh(&in6_dev->lock);
for (im6 = in6_dev->mc_list; im6 != NULL; im6 = im6->next) { for (im6 = in6_dev->mc_list; im6 != NULL; im6 = im6->next) {
tmp->u.a6.addr = im6->mca_addr; tmp->u.a6.addr = im6->mca_addr;
tmp->is_multicast = 1; tmp->is_multicast = 1;
...@@ -1228,6 +1229,8 @@ static void qeth_l3_add_mc6_to_hash(struct qeth_card *card, ...@@ -1228,6 +1229,8 @@ static void qeth_l3_add_mc6_to_hash(struct qeth_card *card,
&ipm->hnode, qeth_l3_ipaddr_hash(ipm)); &ipm->hnode, qeth_l3_ipaddr_hash(ipm));
} }
read_unlock_bh(&in6_dev->lock);
kfree(tmp); kfree(tmp);
} }
...@@ -1253,9 +1256,7 @@ static void qeth_l3_add_vlan_mc6(struct qeth_card *card) ...@@ -1253,9 +1256,7 @@ static void qeth_l3_add_vlan_mc6(struct qeth_card *card)
in_dev = in6_dev_get(netdev); in_dev = in6_dev_get(netdev);
if (!in_dev) if (!in_dev)
continue; continue;
read_lock_bh(&in_dev->lock);
qeth_l3_add_mc6_to_hash(card, in_dev); qeth_l3_add_mc6_to_hash(card, in_dev);
read_unlock_bh(&in_dev->lock);
in6_dev_put(in_dev); in6_dev_put(in_dev);
} }
} }
...@@ -1273,10 +1274,8 @@ static void qeth_l3_add_multicast_ipv6(struct qeth_card *card) ...@@ -1273,10 +1274,8 @@ static void qeth_l3_add_multicast_ipv6(struct qeth_card *card)
return; return;
rcu_read_lock(); rcu_read_lock();
read_lock_bh(&in6_dev->lock);
qeth_l3_add_mc6_to_hash(card, in6_dev); qeth_l3_add_mc6_to_hash(card, in6_dev);
qeth_l3_add_vlan_mc6(card); qeth_l3_add_vlan_mc6(card);
read_unlock_bh(&in6_dev->lock);
rcu_read_unlock(); rcu_read_unlock();
in6_dev_put(in6_dev); in6_dev_put(in6_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment