Skip to content

Commit 1537f14

Browse files
julianwiedmanngregkh
authored andcommitted
s390/qeth: fix IP removal on offline cards
[ Upstream commit 98d823a ] If the HW is not reachable, then none of the IPs in qeth's internal table has been registered with the HW yet. So when deleting such an IP, there's no need to stage it for deregistration - just drop it from the table. This fixes the "add-delete-add" scenario on an offline card, where the the second "add" merely increments the IP's use count. But as the IP is still set to DISP_ADDR_DELETE from the previous "delete" step, l3_recover_ip() won't register it with the HW when the card goes online. Fixes: 5f78e29 ("qeth: optimize IP handling in rx_mode callback") Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 797658d commit 1537f14

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

drivers/s390/net/qeth_l3_main.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,8 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
259259
if (addr->in_progress)
260260
return -EINPROGRESS;
261261

262-
if (!qeth_card_hw_is_reachable(card)) {
263-
addr->disp_flag = QETH_DISP_ADDR_DELETE;
264-
return 0;
265-
}
266-
267-
rc = qeth_l3_deregister_addr_entry(card, addr);
262+
if (qeth_card_hw_is_reachable(card))
263+
rc = qeth_l3_deregister_addr_entry(card, addr);
268264

269265
hash_del(&addr->hnode);
270266
kfree(addr);
@@ -406,11 +402,7 @@ static void qeth_l3_recover_ip(struct qeth_card *card)
406402
spin_lock_bh(&card->ip_lock);
407403

408404
hash_for_each_safe(card->ip_htable, i, tmp, addr, hnode) {
409-
if (addr->disp_flag == QETH_DISP_ADDR_DELETE) {
410-
qeth_l3_deregister_addr_entry(card, addr);
411-
hash_del(&addr->hnode);
412-
kfree(addr);
413-
} else if (addr->disp_flag == QETH_DISP_ADDR_ADD) {
405+
if (addr->disp_flag == QETH_DISP_ADDR_ADD) {
414406
if (addr->proto == QETH_PROT_IPV4) {
415407
addr->in_progress = 1;
416408
spin_unlock_bh(&card->ip_lock);

0 commit comments

Comments
 (0)