Skip to content

Commit 1c60162

Browse files
SandyWintersmb49
authored andcommitted
s390/qeth: Don't call dev_close/dev_open (DOWN/UP)
BugLink: https://bugs.launchpad.net/bugs/2038236 [ Upstream commit 1cfef80 ] dev_close() and dev_open() are issued to change the interface state to DOWN or UP (dev->flags IFF_UP). When the netdev is set DOWN it loses e.g its Ipv6 addresses and routes. We don't want this in cases of device recovery (triggered by hardware or software) or when the qeth device is set offline. Setting a qeth device offline or online and device recovery actions call netif_device_detach() and/or netif_device_attach(). That will reset or set the LOWER_UP indication i.e. change the dev->state Bit __LINK_STATE_PRESENT. That is enough to e.g. cause bond failovers, and still preserves the interface settings that are handled by the network stack. Don't call dev_open() nor dev_close() from the qeth device driver. Let the network stack handle this. Fixes: d456015 ("s390/qeth: call dev_close() during recovery") Signed-off-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 64325d6 commit 1c60162

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ struct qeth_card_info {
716716
u16 chid;
717717
u8 ids_valid:1; /* cssid,iid,chid */
718718
u8 dev_addr_is_registered:1;
719-
u8 open_when_online:1;
720719
u8 promisc_mode:1;
721720
u8 use_v1_blkt:1;
722721
u8 is_vm_nic:1;

drivers/s390/net/qeth_core_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5371,8 +5371,6 @@ int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
53715371
qeth_clear_ipacmd_list(card);
53725372

53735373
rtnl_lock();
5374-
card->info.open_when_online = card->dev->flags & IFF_UP;
5375-
dev_close(card->dev);
53765374
netif_device_detach(card->dev);
53775375
netif_carrier_off(card->dev);
53785376
rtnl_unlock();

drivers/s390/net/qeth_l2_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,9 +2387,12 @@ static int qeth_l2_set_online(struct qeth_card *card, bool carrier_ok)
23872387
qeth_enable_hw_features(dev);
23882388
qeth_l2_enable_brport_features(card);
23892389

2390-
if (card->info.open_when_online) {
2391-
card->info.open_when_online = 0;
2392-
dev_open(dev, NULL);
2390+
if (netif_running(dev)) {
2391+
local_bh_disable();
2392+
napi_schedule(&card->napi);
2393+
/* kick-start the NAPI softirq: */
2394+
local_bh_enable();
2395+
qeth_l2_set_rx_mode(dev);
23932396
}
23942397
rtnl_unlock();
23952398
}

drivers/s390/net/qeth_l3_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,9 +2017,11 @@ static int qeth_l3_set_online(struct qeth_card *card, bool carrier_ok)
20172017
netif_device_attach(dev);
20182018
qeth_enable_hw_features(dev);
20192019

2020-
if (card->info.open_when_online) {
2021-
card->info.open_when_online = 0;
2022-
dev_open(dev, NULL);
2020+
if (netif_running(dev)) {
2021+
local_bh_disable();
2022+
napi_schedule(&card->napi);
2023+
/* kick-start the NAPI softirq: */
2024+
local_bh_enable();
20232025
}
20242026
rtnl_unlock();
20252027
}

0 commit comments

Comments
 (0)