Skip to content

Commit d33ae65

Browse files
SandyWinterroxanan1996
authored andcommitted
s390/qeth: Don't call dev_close/dev_open (DOWN/UP)
BugLink: https://bugs.launchpad.net/bugs/2037593 [ 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: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent f5e4ab4 commit d33ae65

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
@@ -717,7 +717,6 @@ struct qeth_card_info {
717717
u16 chid;
718718
u8 ids_valid:1; /* cssid,iid,chid */
719719
u8 dev_addr_is_registered:1;
720-
u8 open_when_online:1;
721720
u8 promisc_mode:1;
722721
u8 use_v1_blkt:1;
723722
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
@@ -5384,8 +5384,6 @@ int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
53845384
qeth_clear_ipacmd_list(card);
53855385

53865386
rtnl_lock();
5387-
card->info.open_when_online = card->dev->flags & IFF_UP;
5388-
dev_close(card->dev);
53895387
netif_device_detach(card->dev);
53905388
netif_carrier_off(card->dev);
53915389
rtnl_unlock();

drivers/s390/net/qeth_l2_main.c

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

2376-
if (card->info.open_when_online) {
2377-
card->info.open_when_online = 0;
2378-
dev_open(dev, NULL);
2376+
if (netif_running(dev)) {
2377+
local_bh_disable();
2378+
napi_schedule(&card->napi);
2379+
/* kick-start the NAPI softirq: */
2380+
local_bh_enable();
2381+
qeth_l2_set_rx_mode(dev);
23792382
}
23802383
rtnl_unlock();
23812384
}

drivers/s390/net/qeth_l3_main.c

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

2032-
if (card->info.open_when_online) {
2033-
card->info.open_when_online = 0;
2034-
dev_open(dev, NULL);
2032+
if (netif_running(dev)) {
2033+
local_bh_disable();
2034+
napi_schedule(&card->napi);
2035+
/* kick-start the NAPI softirq: */
2036+
local_bh_enable();
20352037
}
20362038
rtnl_unlock();
20372039
}

0 commit comments

Comments
 (0)