Skip to content

Commit 1cfef80

Browse files
SandyWinterdavem330
authored andcommitted
s390/qeth: Don't call dev_close/dev_open (DOWN/UP)
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 <[email protected]> Reviewed-by: Wenjia Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 666c135 commit 1cfef80

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
@@ -5373,8 +5373,6 @@ int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
53735373
qeth_clear_ipacmd_list(card);
53745374

53755375
rtnl_lock();
5376-
card->info.open_when_online = card->dev->flags & IFF_UP;
5377-
dev_close(card->dev);
53785376
netif_device_detach(card->dev);
53795377
netif_carrier_off(card->dev);
53805378
rtnl_unlock();

drivers/s390/net/qeth_l2_main.c

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

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

drivers/s390/net/qeth_l3_main.c

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

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

0 commit comments

Comments
 (0)