s390: network bug fixes for net
Subsystems (4)
cover s390: network bug fixes for net
Hi Dave,
here are 2 bug fixes for net.
shortlog:
Ursula Braun (1)
qeth: set new mac even if old mac is gone
Stefan Raspl (1)
qeth: Fix IPA_CMD_QIPASSIST return code handling
Thanks,
Frank
PATCH 1/2 qeth: Fix IPA_CMD_QIPASSIST return code handling
From: Stefan Raspl <[email protected]>
Return codes of IPA_CMD_QIPASSIST are not checked, especially the ones which indicate that the command is not supported. As a result, the device driver would not enable all available features on older card generations. This patch adds proper checking and sets the bare minimum in the supported functions flags to avoid follow-on errors.
--- drivers/s390/net/qeth_core_main.c | 24 ++++++++++++++++++++++-- drivers/s390/net/qeth_l2_main.c | 11 +++++++---- 2 files changed, 29 insertions(+), 6 deletions(-)
drivers/s390/net/qeth_core_main.c +22 -2
@@ -2942,13 +2942,33 @@ static int qeth_query_ipassists_cb(struct qeth_card *card,QETH_DBF_TEXT (SETUP ,2 ,"qipasscb" ); cmd = (struct qeth_ipa_cmd *) data; + +switch (cmd->hdr.return_code) { +case IPA_RC_NOTSUPP : +case IPA_RC_L2_UNSUPPORTED_CMD : +QETH_DBF_TEXT (SETUP ,2 ,"ipaunsup" ); + card->options.ipa4.supported_funcs |=IPA_SETADAPTERPARMS ; + card->options.ipa6.supported_funcs |=IPA_SETADAPTERPARMS ; +return -0 ; +default : +if (cmd->hdr.return_code) { +QETH_DBF_MESSAGE (1 ,"%s IPA_CMD_QIPASSIST: Unhandled " +"rc=%d\n" , +dev_name (&card->gdev->dev), + cmd->hdr.return_code); +return 0 ; + } + } +if (cmd->hdr.prot_version ==QETH_PROT_IPV4 ) { card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported; card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled; - }else { + }else if (cmd->hdr.prot_version ==QETH_PROT_IPV6 ) { card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported; card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled; - } + }else +QETH_DBF_MESSAGE (1 ,"%s IPA_CMD_QIPASSIST: Flawed LIC detected" +"\n" ,dev_name (&card->gdev->dev));QETH_DBF_TEXT (SETUP ,2 ,"suppenbl" );QETH_DBF_TEXT_ (SETUP ,2 ,"%08x" , (__u32 )cmd->hdr.ipa_supported);QETH_DBF_TEXT_ (SETUP ,2 ,"%08x" , (__u32 )cmd->hdr.ipa_enabled);
drivers/s390/net/qeth_l2_main.c +7 -4
@@ -626,10 +626,13 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)QETH_DBF_TEXT (SETUP ,2 ,"doL2init" );QETH_DBF_TEXT_ (SETUP ,2 ,"doL2%s" ,CARD_BUS_ID (card)); - rc =qeth_query_setadapterparms (card); -if (rc) { -QETH_DBF_MESSAGE (2 ,"could not query adapter parameters on " -"device %s: x%x\n" ,CARD_BUS_ID (card), rc); +if (qeth_is_supported (card,IPA_SETADAPTERPARMS )) { + rc =qeth_query_setadapterparms (card); +if (rc) { +QETH_DBF_MESSAGE (2 ,"could not query adapter " +"parameters on device %s: x%x\n" , +CARD_BUS_ID (card), rc); + } } if (card->info.type == QETH_CARD_TYPE_IQD ||
PATCH 2/2 qeth: set new mac even if old mac is gone
In reply to [email protected]From: Ursula Braun <[email protected]>
If the set_mac_address() function of qeth is invoked, qeth deletes the old mac address first on OSA. Only if deletion returns successfully the new mac address is set on OSA. Deletion may return with a return value "MAC not found on OSA". In this case qeth should continue setting the new mac address.
When the OSA cable is pulled, OSA forgets any set mac address. If the OSA network interface acts as a slave to a bonding master interface, bonding can invoke the set_mac_address function for failover purposes and depends on successful setting of the new mac address even though the old mac address could no longer be deleted.
--- drivers/s390/net/qeth_l2_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -679,7 +679,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)return -ERESTARTSYS ; } rc =qeth_l2_send_delmac (card, &card->dev->dev_addr[0 ]); -if (!rc) +if (!rc || (rc ==IPA_RC_L2_MAC_NOT_FOUND )) rc =qeth_l2_send_setmac (card, addr->sa_data);return rc ? -EINVAL :0 ; }
David Miller
maintainerFrom: [email protected]
Date: Tue, 13 Nov 2012 10:05:15 +0100
Quoted 11 lines
Hi Dave,
here are 2 bug fixes for net.
shortlog:
Ursula Braun (1)
qeth: set new mac even if old mac is goneStefan Raspl (1)
qeth: FixIPA_CMD_QIPASSISTreturn code handling
All applied, thanks.