Commit 09840f70 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Jakub Kicinski

s390/qeth: reduce rtnl locking for switchdev events

call_switchdev_notifiers() doesn't require holding the RTNL lock since
commit ff5cf100 ("net: switchdev: Change notifier chain to be atomic").

We still need it for the "lost event" slow path, to avoid racing against
a concurrent .ndo_bridge_setlink().
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bd4bdeb4
...@@ -737,8 +737,6 @@ static void qeth_l2_dev2br_an_set_cb(void *priv, ...@@ -737,8 +737,6 @@ static void qeth_l2_dev2br_an_set_cb(void *priv,
* *
* On enable, emits a series of address notifications for all * On enable, emits a series of address notifications for all
* currently registered hosts. * currently registered hosts.
*
* Must be called under rtnl_lock
*/ */
static int qeth_l2_dev2br_an_set(struct qeth_card *card, bool enable) static int qeth_l2_dev2br_an_set(struct qeth_card *card, bool enable)
{ {
...@@ -1289,16 +1287,19 @@ static void qeth_l2_dev2br_worker(struct work_struct *work) ...@@ -1289,16 +1287,19 @@ static void qeth_l2_dev2br_worker(struct work_struct *work)
if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE) if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE)
goto free; goto free;
if (data->ac_event.lost_event_mask) {
/* Potential re-config in progress, try again later: */ /* Potential re-config in progress, try again later: */
if (!rtnl_trylock()) { if (!rtnl_trylock()) {
queue_delayed_work(card->event_wq, dwork, queue_delayed_work(card->event_wq, dwork,
msecs_to_jiffies(100)); msecs_to_jiffies(100));
return; return;
} }
if (!netif_device_present(card->dev))
goto out_unlock;
if (data->ac_event.lost_event_mask) { if (!netif_device_present(card->dev)) {
rtnl_unlock();
goto free;
}
QETH_DBF_MESSAGE(3, QETH_DBF_MESSAGE(3,
"Address change notification overflow on device %x\n", "Address change notification overflow on device %x\n",
CARD_DEVID(card)); CARD_DEVID(card));
...@@ -1328,6 +1329,8 @@ static void qeth_l2_dev2br_worker(struct work_struct *work) ...@@ -1328,6 +1329,8 @@ static void qeth_l2_dev2br_worker(struct work_struct *work)
"Address Notification resynced on device %x\n", "Address Notification resynced on device %x\n",
CARD_DEVID(card)); CARD_DEVID(card));
} }
rtnl_unlock();
} else { } else {
for (i = 0; i < data->ac_event.num_entries; i++) { for (i = 0; i < data->ac_event.num_entries; i++) {
struct qeth_ipacmd_addr_change_entry *entry = struct qeth_ipacmd_addr_change_entry *entry =
...@@ -1339,9 +1342,6 @@ static void qeth_l2_dev2br_worker(struct work_struct *work) ...@@ -1339,9 +1342,6 @@ static void qeth_l2_dev2br_worker(struct work_struct *work)
} }
} }
out_unlock:
rtnl_unlock();
free: free:
kfree(data); kfree(data);
} }
...@@ -2310,11 +2310,8 @@ static void qeth_l2_set_offline(struct qeth_card *card) ...@@ -2310,11 +2310,8 @@ static void qeth_l2_set_offline(struct qeth_card *card)
card->state = CARD_STATE_DOWN; card->state = CARD_STATE_DOWN;
qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE);
if (priv->brport_features & BR_LEARNING_SYNC) { if (priv->brport_features & BR_LEARNING_SYNC)
rtnl_lock();
qeth_l2_dev2br_fdb_flush(card); qeth_l2_dev2br_fdb_flush(card);
rtnl_unlock();
}
} }
/* Returns zero if the command is successfully "consumed" */ /* Returns zero if the command is successfully "consumed" */
......
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