Commit a7531c1c authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

s390/qeth: allow hsuid configuration in DOWN state

The qeth IP address mapping logic has been reworked recently. It
causes now problems to specify qeth sysfs attribute "hsuid" in DOWN
state, which is allowed. Postpone registering or deregistering of
IP-addresses in this case.
Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 016930b8
...@@ -257,6 +257,11 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr) ...@@ -257,6 +257,11 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
if (addr->in_progress) if (addr->in_progress)
return -EINPROGRESS; return -EINPROGRESS;
if (!qeth_card_hw_is_reachable(card)) {
addr->disp_flag = QETH_DISP_ADDR_DELETE;
return 0;
}
rc = qeth_l3_deregister_addr_entry(card, addr); rc = qeth_l3_deregister_addr_entry(card, addr);
hash_del(&addr->hnode); hash_del(&addr->hnode);
...@@ -296,6 +301,11 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr) ...@@ -296,6 +301,11 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
hash_add(card->ip_htable, &addr->hnode, hash_add(card->ip_htable, &addr->hnode,
qeth_l3_ipaddr_hash(addr)); qeth_l3_ipaddr_hash(addr));
if (!qeth_card_hw_is_reachable(card)) {
addr->disp_flag = QETH_DISP_ADDR_ADD;
return 0;
}
/* qeth_l3_register_addr_entry can go to sleep /* qeth_l3_register_addr_entry can go to sleep
* if we add a IPV4 addr. It is caused by the reason * if we add a IPV4 addr. It is caused by the reason
* that SETIP ipa cmd starts ARP staff for IPV4 addr. * that SETIP ipa cmd starts ARP staff for IPV4 addr.
...@@ -390,12 +400,16 @@ static void qeth_l3_recover_ip(struct qeth_card *card) ...@@ -390,12 +400,16 @@ static void qeth_l3_recover_ip(struct qeth_card *card)
int i; int i;
int rc; int rc;
QETH_CARD_TEXT(card, 4, "recoverip"); QETH_CARD_TEXT(card, 4, "recovrip");
spin_lock_bh(&card->ip_lock); spin_lock_bh(&card->ip_lock);
hash_for_each_safe(card->ip_htable, i, tmp, addr, hnode) { hash_for_each_safe(card->ip_htable, i, tmp, addr, hnode) {
if (addr->disp_flag == QETH_DISP_ADDR_ADD) { if (addr->disp_flag == QETH_DISP_ADDR_DELETE) {
qeth_l3_deregister_addr_entry(card, addr);
hash_del(&addr->hnode);
kfree(addr);
} else if (addr->disp_flag == QETH_DISP_ADDR_ADD) {
if (addr->proto == QETH_PROT_IPV4) { if (addr->proto == QETH_PROT_IPV4) {
addr->in_progress = 1; addr->in_progress = 1;
spin_unlock_bh(&card->ip_lock); spin_unlock_bh(&card->ip_lock);
...@@ -407,10 +421,8 @@ static void qeth_l3_recover_ip(struct qeth_card *card) ...@@ -407,10 +421,8 @@ static void qeth_l3_recover_ip(struct qeth_card *card)
if (!rc) { if (!rc) {
addr->disp_flag = QETH_DISP_ADDR_DO_NOTHING; addr->disp_flag = QETH_DISP_ADDR_DO_NOTHING;
if (addr->ref_counter < 1) { if (addr->ref_counter < 1)
qeth_l3_delete_ip(card, addr); qeth_l3_delete_ip(card, addr);
kfree(addr);
}
} else { } else {
hash_del(&addr->hnode); hash_del(&addr->hnode);
kfree(addr); kfree(addr);
......
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