s390: qeth/ctcm patches for 2.6.31
Subsystems (4)
cover s390: qeth/ctcm patches for 2.6.31
Hi Dave,
here are some qeth and ctcm patches for 2.6.31 (net-next).
shortlog:
Klaus-Dieter Wacker (1)
qeth: Clear SBALF15 in any case for output buffers.
Ursula Braun (4)
qeth: avoid crash after detach of replugged device
ctcm: avoid crash in ctcm_remove_device
qeth: support z/VM VSWITCH Port Isolation
qeth: omit upstream checksumming for HiperSockets
Thanks,
Frank
PATCH 1/5 qeth: avoid crash after detach of replugged device
From: Ursula Braun <[email protected]>
If a qeth device is plugged off, setting the device online stops in state HARDSETUP and a failure is reported to the base cio-layer causing halt/clear to be invoked. Replugging the device again triggers a qeth recovery without notification of the cio-layer. If a device is ungrouped in this state, the qeth set_offline function is not invoked, because the corresponding ccwgroup device is not in state ONLINE. Then incoming traffic is still handled by the qdio layer resulting in a crash in qeth_l<x>_qdio_input_handler, because (part of) the qeth data structures for this device are already removed.
Solution: After replugging the device qeth recovery should lead to a working net device. Thus a "LAN offline" result when setting a qeth device online must not report a failure to the base cio-layer.
---
drivers/s390/net/qeth_l2_main.c | 4 +++- drivers/s390/net/qeth_l3_main.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +3 -1
@@ -839,6 +839,7 @@ static void qeth_l2_remove_device(struct {struct qeth_card *card =dev_get_drvdata (&cgdev->dev); +qeth_set_allowed_threads (card,0 ,1 );wait_event (card->wait_q,qeth_threads_running (card,0xffffffff ) ==0 );if (cgdev->state ==CCWGROUP_ONLINE ) {
@@ -974,8 +975,9 @@ static int __qeth_l2_set_online(struct cdev_warn (&card->gdev->dev,"The LAN is offline\n" ); card->lan_online =0 ; +return 0 ; } -return rc; + goto out_remove; }else card->lan_online =1 ;
drivers/s390/net/qeth_l3_main.c +3 -1
@@ -3070,6 +3070,7 @@ static void qeth_l3_remove_device(struct {struct qeth_card *card =dev_get_drvdata (&cgdev->dev); +qeth_set_allowed_threads (card,0 ,1 );wait_event (card->wait_q,qeth_threads_running (card,0xffffffff ) ==0 );if (cgdev->state ==CCWGROUP_ONLINE ) {
@@ -3141,8 +3142,9 @@ static int __qeth_l3_set_online(struct cdev_warn (&card->gdev->dev,"The LAN is offline\n" ); card->lan_online =0 ; +return 0 ; } -return rc; + goto out_remove; }else card->lan_online =1 ;qeth_set_large_send (card, card->options.large_send);
PATCH 2/5 ctcm: avoid crash in ctcm_remove_device
In reply to [email protected]From: Ursula Braun <[email protected]>
Channels are already removed when setting a ctcm-device offline. Thus ctcm_remove_device must not refer to channel information.
Solution: delete channel information from the trace call in ctcm_remove_device.
---
drivers/s390/net/ctcm_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/s390/net/ctcm_main.c +2 -4
@@ -1677,10 +1677,8 @@ static void ctcm_remove_device(struct ccBUG_ON (priv ==NULL );CTCM_DBF_TEXT_ (SETUP ,CTC_DBF_INFO , -"removing device %s, r/w = %s/%s, proto : %d" , - priv->channel[READ ]->netdev->name, - priv->channel[READ ]->id, priv->channel[WRITE ]->id, - priv->protocol); +"removing device %p, proto : %d" , + cgdev, priv->protocol);if (cgdev->state ==CCWGROUP_ONLINE )ctcm_shutdown_device (cgdev);
PATCH 3/5 qeth: support z/VM VSWITCH Port Isolation
In reply to [email protected]From: Ursula Braun <[email protected]>
z/VM Virtual Switch Port Isolation allows guests on a VLAN UNAWARE virtual switch to be isolated from other guests on the VSWITCH. (See z/VM Apars VM64281 and VM64463).
The Linux qeth driver is affected, because it has to handle new error codes introduced with the z/VM VSWITCH Port Isolation support.
---
drivers/s390/net/qeth_core_mpc.c | 2 ++ drivers/s390/net/qeth_core_mpc.h | 2 ++ drivers/s390/net/qeth_l2_main.c | 26 +++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_core_mpc.c +2 -0
@@ -181,6 +181,8 @@ static struct ipa_rc_msg qeth_ipa_rc_msg {IPA_RC_L2_ADDR_TABLE_FULL, "Layer2 address table full"}, {IPA_RC_L2_DUP_LAYER3_MAC, "Duplicate with layer 3 MAC"}, {IPA_RC_L2_GMAC_NOT_FOUND, "GMAC not found"}, + {IPA_RC_L2_MAC_NOT_AUTH_BY_HYP, "L2 mac not authorized by hypervisor"}, + {IPA_RC_L2_MAC_NOT_AUTH_BY_ADP, "L2 mac not authorized by adapter"}, {IPA_RC_L2_MAC_NOT_FOUND, "L2 mac address not found"}, {IPA_RC_L2_INVALID_VLAN_ID, "L2 invalid vlan id"}, {IPA_RC_L2_DUP_VLAN_ID, "L2 duplicate vlan id"},
drivers/s390/net/qeth_core_mpc.h +2 -0
@@ -168,6 +168,8 @@ enum qeth_ipa_return_codes {IPA_RC_L2_ADDR_TABLE_FULL =0x2006 ,IPA_RC_L2_DUP_LAYER3_MAC =0x200a ,IPA_RC_L2_GMAC_NOT_FOUND =0x200b , +IPA_RC_L2_MAC_NOT_AUTH_BY_HYP =0x200c , +IPA_RC_L2_MAC_NOT_AUTH_BY_ADP =0x200d ,IPA_RC_L2_MAC_NOT_FOUND =0x2010 ,IPA_RC_L2_INVALID_VLAN_ID =0x2015 , IPA_RC_L2_DUP_VLAN_ID = 0x2016,
drivers/s390/net/qeth_l2_main.c +25 -1
@@ -130,7 +130,7 @@ static int qeth_l2_send_setgroupmac_cb(s cmd = (struct qeth_ipa_cmd *) data; mac = &cmd->data.setdelmac.mac[0 ];/* MAC already registered, needed in couple/uncouple case */ -if (cmd->hdr.return_code ==0x2005 ) { +if (cmd->hdr.return_code ==IPA_RC_L2_DUP_MAC ) {QETH_DBF_MESSAGE (2 ,"Group MAC %pM already existing on %s \n" , mac,QETH_CARD_IFNAME (card)); cmd->hdr.return_code =0 ;
@@ -502,6 +502,30 @@ static int qeth_l2_send_setmac_cb(structif (cmd->hdr.return_code) {QETH_DBF_TEXT_ (TRACE ,2 ,"L2er%x" , cmd->hdr.return_code); card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; +switch (cmd->hdr.return_code) { +case IPA_RC_L2_DUP_MAC : +case IPA_RC_L2_DUP_LAYER3_MAC : +dev_warn (&card->gdev->dev, +"MAC address " +"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " +"already exists\n" , + card->dev->dev_addr[0 ], card->dev->dev_addr[1 ], + card->dev->dev_addr[2 ], card->dev->dev_addr[3 ], + card->dev->dev_addr[4 ], card->dev->dev_addr[5 ]); +break ; +case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP : +case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP : +dev_warn (&card->gdev->dev, +"MAC address " +"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " +"is not authorized\n" , + card->dev->dev_addr[0 ], card->dev->dev_addr[1 ], + card->dev->dev_addr[2 ], card->dev->dev_addr[3 ], + card->dev->dev_addr[4 ], card->dev->dev_addr[5 ]); +break ; +default : +break ; + } cmd->hdr.return_code = -EIO ; }else { card->info.mac_bits |=QETH_LAYER2_MAC_REGISTERED ;
PATCH 4/5 qeth: omit upstream checksumming for HiperSockets
In reply to [email protected]From: Ursula Braun <[email protected]>
For HiperSocket devices receive-path checksumming is not required. Thus NO_CHECKSUMMING is used as default for HiperSocket interfaces. For layer3 devices configured with NO_CHECKSUMMING received skbs should have set their ip_summed field to CHECKSUM_UNNECESSARY.
---
drivers/s390/net/qeth_core_main.c | 2 ++ drivers/s390/net/qeth_l3_main.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-)
drivers/s390/net/qeth_core_main.c +2 -0
@@ -1140,6 +1140,8 @@ static int qeth_setup_card(struct qeth_c card->ipato.enabled =0 ; card->ipato.invert4 =0 ; card->ipato.invert6 =0 ; +if (card->info.type ==QETH_CARD_TYPE_IQD ) + card->options.checksum_type =NO_CHECKSUMMING ;/* init QDIO stuff */ qeth_init_qdio_info (card);return 0 ;
drivers/s390/net/qeth_l3_main.c +13 -7
@@ -1920,16 +1920,22 @@ static inline __u16 qeth_l3_rebuild_skb( hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]); } - skb->ip_summed = card->options.checksum_type; -if (card->options.checksum_type ==HW_CHECKSUMMING ) { +switch (card->options.checksum_type) { +case SW_CHECKSUMMING : + skb->ip_summed =CHECKSUM_NONE ; +break ; +case NO_CHECKSUMMING : + skb->ip_summed =CHECKSUM_UNNECESSARY ; +break ; +case HW_CHECKSUMMING :if ((hdr->hdr.l3.ext_flags & - (QETH_HDR_EXT_CSUM_HDR_REQ | -QETH_HDR_EXT_CSUM_TRANSP_REQ )) == - (QETH_HDR_EXT_CSUM_HDR_REQ | -QETH_HDR_EXT_CSUM_TRANSP_REQ )) + (QETH_HDR_EXT_CSUM_HDR_REQ | +QETH_HDR_EXT_CSUM_TRANSP_REQ )) == + (QETH_HDR_EXT_CSUM_HDR_REQ | +QETH_HDR_EXT_CSUM_TRANSP_REQ )) skb->ip_summed =CHECKSUM_UNNECESSARY ;else - skb->ip_summed =SW_CHECKSUMMING ; + skb->ip_summed =CHECKSUM_NONE ; }return vlan_id;
PATCH 5/5 qeth: Clear SBALF15 in any case for output buffers.
In reply to [email protected]From: Klaus-Dieter Wacket <[email protected]>
Function qeth_clear_output_buffer for HiperSockets may not clear all 16 SBALEs, but only the used ones. The error flag in SBALF15 has to be cleared in any case.
---
drivers/s390/net/qeth_core_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/net/qeth_core_main.c +1 -0
@@ -952,6 +952,7 @@ static void qeth_clear_output_buffer(str buf->buffer->element[i].addr =NULL ; buf->buffer->element[i].flags =0 ; } + buf->buffer->element[15 ].flags =0 ; buf->next_element_to_fill =0 ;atomic_set (&buf->state,QETH_QDIO_BUF_EMPTY ); }
From: [email protected]
Date: Wed, 20 May 2009 09:38:36 +0200
Quoted 9 lines
shortlog:
Klaus-Dieter Wacker (1)
qeth: Clear SBALF15 in any case for output buffers.Ursula Braun (4)
qeth: avoid crash after detach of replugged device
ctcm: avoid crash inctcm_remove_device
qeth: support z/VM VSWITCH Port Isolation
qeth: omit upstream checksumming for HiperSockets
Applied into net-next-2.6, thanks!