Skip to contentSkip to conversation

s390: qeth fixes 2.6.29

PATCH In review [email protected] 2 participants 6 messages Dec 11, 2008 – Dec 15, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover s390: qeth fixes 2.6.29

Hi Jeff,

here are some fixes for 2.6.29
The patches apply to linux-next

shortlog:
Klaus Wacker (1)
qeth: HiperSockets mcl string conversion (pre z9 mach)

Ursula Braun (2)
qeth: exploit source MAC address for inbound layer3 packets
qeth: avoid crash in case of layer mismatch for VSWITCH

Frank Blaschka (1)
qeth: do not spin for SETIP ip assist command

Thanks,
Frank

#1 lore raw

PATCH 1/4 qeth: HiperSockets mcl string conversion (pre z9 mach)

From: Klaus-Dieter Wacker <[email protected]>

The pre z9 machines provide an mcl string in EBCDIC format, z9 or later provide string in ASCII format.

---

 drivers/s390/net/qeth_core_main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +2 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
@@ -2250,7 +2250,8 @@ void qeth_print_status_message(struct qe
 		}
 		/* fallthrough */
 	case QETH_CARD_TYPE_IQD:
-		if (card->info.guestlan) {
+		if ((card->info.guestlan) ||
+		    (card->info.mcl_level[0] & 0x80)) {
 			card->info.mcl_level[0] = (char) _ebcasc[(__u8)
 				card->info.mcl_level[0]];
 			card->info.mcl_level[1] = (char) _ebcasc[(__u8)
#2 lore raw

PATCH 2/4 qeth: exploit source MAC address for inbound layer3 packets

In reply to [email protected]

From: Ursula Braun <[email protected]>

OSA-devices operating in layer3 mode offer adding of the source MAC address to the QDIO header of inbound packets. The qeth driver can exploit this functionality to replace FAKELL-entries in the ethernet header of received packets.

---

 drivers/s390/net/qeth_core.h      |    1 -
 drivers/s390/net/qeth_core_main.c |    1 -
 drivers/s390/net/qeth_l3_main.c   |   16 +++++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/s390/net/qeth_core.h +0 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
@@ -643,7 +643,6 @@ struct qeth_card_options {
 	int macaddr_mode;
 	int fake_broadcast;
 	int add_hhlen;
-	int fake_ll;
 	int layer2;
 	enum qeth_large_send_types large_send;
 	int performance_stats;
drivers/s390/net/qeth_core_main.c +0 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
@@ -1072,7 +1072,6 @@ static void qeth_set_intial_options(stru
 	card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL;
 	card->options.fake_broadcast = 0;
 	card->options.add_hhlen = DEFAULT_ADD_HHLEN;
-	card->options.fake_ll = 0;
 	card->options.performance_stats = 0;
 	card->options.rx_sg_cb = QETH_RX_SG_CB;
 }
drivers/s390/net/qeth_l3_main.c +9 -7
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
@@ -1207,12 +1207,9 @@ static int qeth_l3_start_ipa_source_mac(
 
 	QETH_DBF_TEXT(TRACE, 3, "stsrcmac");
 
-	if (!card->options.fake_ll)
-		return -EOPNOTSUPP;
-
 	if (!qeth_is_supported(card, IPA_SOURCE_MAC)) {
 		dev_info(&card->gdev->dev,
-			"Inbound source address not supported on %s\n",
+			"Inbound source MAC-address not supported on %s\n",
 			QETH_CARD_IFNAME(card));
 		return -EOPNOTSUPP;
 	}
@@ -1221,7 +1218,7 @@ static int qeth_l3_start_ipa_source_mac(
 					  IPA_CMD_ASS_START, 0);
 	if (rc)
 		dev_warn(&card->gdev->dev,
-			"Starting proxy ARP support for %s failed\n",
+			"Starting source MAC-address support for %s failed\n",
 			QETH_CARD_IFNAME(card));
 	return rc;
 }
@@ -1921,8 +1918,13 @@ static inline __u16 qeth_l3_rebuild_skb(
 			memcpy(tg_addr, card->dev->dev_addr,
 				card->dev->addr_len);
 		}
-		card->dev->header_ops->create(skb, card->dev, prot, tg_addr,
-					      "FAKELL", card->dev->addr_len);
+		if (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_SRC_MAC_ADDR)
+			card->dev->header_ops->create(skb, card->dev, prot,
+				tg_addr, &hdr->hdr.l3.dest_addr[2],
+				card->dev->addr_len);
+		else
+			card->dev->header_ops->create(skb, card->dev, prot,
+				tg_addr, "FAKELL", card->dev->addr_len);
 	}
 
 #ifdef CONFIG_TR
#3 lore raw

PATCH 3/4 qeth: avoid crash in case of layer mismatch for VSWITCH

In reply to [email protected]

From: Ursula Braun <[email protected]>

For z/VM GuestLAN or VSWITCH devices the transport layer is configured in z/VM. The layer2 attribute of a participating Linux device has to match the z/VM definition. In case of a mismatch Linux currently crashes in qeth recovery due to a reference to the not yet existing net_device.
Solution: add a check for existence of net_device and add a message pointing to the mismatch of layer definitions in Linux and z/VM.

---

 drivers/s390/net/qeth_core_main.c |    4 ++++
 drivers/s390/net/qeth_l2_main.c   |    8 +++++---
 drivers/s390/net/qeth_l3_main.c   |    8 +++++---
 3 files changed, 14 insertions(+), 6 deletions(-)
drivers/s390/net/qeth_core_main.c +4 -0
Index: git_linux-next/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -572,6 +572,10 @@ static void qeth_send_control_data_cb(st
 	card = CARD_FROM_CDEV(channel->ccwdev);
 	if (qeth_check_idx_response(iob->data)) {
 		qeth_clear_ipacmd_list(card);
+		if (((iob->data[2] & 0xc0) == 0xc0) && iob->data[4] == 0xf6)
+			dev_err(&card->gdev->dev,
+				"The qeth device is not configured "
+				"for the OSI layer required by z/VM\n");
 		qeth_schedule_recovery(card);
 		goto out;
 	}
drivers/s390/net/qeth_l2_main.c +5 -3
Index: git_linux-next/drivers/s390/net/qeth_l2_main.c
===================================================================
@@ -1126,9 +1126,11 @@ static int qeth_l2_recover(void *ptr)
 		dev_info(&card->gdev->dev,
 			"Device successfully recovered!\n");
 	else {
-		rtnl_lock();
-		dev_close(card->dev);
-		rtnl_unlock();
+		if (card->dev) {
+			rtnl_lock();
+			dev_close(card->dev);
+			rtnl_unlock();
+		}
 		dev_warn(&card->gdev->dev, "The qeth device driver "
 			"failed to recover an error on the device\n");
 	}
drivers/s390/net/qeth_l3_main.c +5 -3
Index: git_linux-next/drivers/s390/net/qeth_l3_main.c
===================================================================
@@ -2082,9 +2082,11 @@ static int qeth_l3_stop_card(struct qeth
 		if (recovery_mode)
 			qeth_l3_stop(card->dev);
 		else {
-			rtnl_lock();
-			dev_close(card->dev);
-			rtnl_unlock();
+			if (card->dev) {
+				rtnl_lock();
+				dev_close(card->dev);
+				rtnl_unlock();
+			}
 		}
 		if (!card->use_hard_stop) {
 			rc = qeth_send_stoplan(card);
#4 lore raw

PATCH 4/4 qeth: do not spin for SETIP ip assist command

In reply to [email protected]

From: Frank Blaschka <[email protected]>

The ip assist hw command for setting an IP address last unacceptable long so we can not spin while we waiting for the irq. Since we can ensure process context for all occurrences of this command we can use wait.

---

 drivers/s390/net/qeth_core_main.c |   39 +++++++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 11 deletions(-)
drivers/s390/net/qeth_core_main.c +28 -11
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
@@ -1685,6 +1685,7 @@ int qeth_send_control_data(struct qeth_c
 	unsigned long flags;
 	struct qeth_reply *reply = NULL;
 	unsigned long timeout;
+	struct qeth_ipa_cmd *cmd;
 
 	QETH_DBF_TEXT(TRACE, 2, "sendctl");
 
@@ -1731,17 +1732,33 @@ int qeth_send_control_data(struct qeth_c
 		wake_up(&card->wait_q);
 		return rc;
 	}
-	while (!atomic_read(&reply->received)) {
-		if (time_after(jiffies, timeout)) {
-			spin_lock_irqsave(&reply->card->lock, flags);
-			list_del_init(&reply->list);
-			spin_unlock_irqrestore(&reply->card->lock, flags);
-			reply->rc = -ETIME;
-			atomic_inc(&reply->received);
-			wake_up(&reply->wait_q);
-		}
-		cpu_relax();
-	};
+
+	/* we have only one long running ipassist, since we can ensure
+	   process context of this command we can sleep */
+	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+	if (cmd->hdr.command == IPA_CMD_SETIP) {
+		if (!wait_event_timeout(reply->wait_q,
+		    atomic_read(&reply->received), timeout))
+			goto time_err;
+	} else {
+		while (!atomic_read(&reply->received)) {
+			if (time_after(jiffies, timeout))
+				goto time_err;
+			cpu_relax();
+		};
+	}
+
+	rc = reply->rc;
+	qeth_put_reply(reply);
+	return rc;
+
+time_err:
+	spin_lock_irqsave(&reply->card->lock, flags);
+	list_del_init(&reply->list);
+	spin_unlock_irqrestore(&reply->card->lock, flags);
+	reply->rc = -ETIME;
+	atomic_inc(&reply->received);
+	wake_up(&reply->wait_q);
 	rc = reply->rc;
 	qeth_put_reply(reply);
 	return rc;
maintainer
#5 lore raw
In reply to [email protected]

From: [email protected]
Date: Thu, 11 Dec 2008 14:23:09 +0100

Quoted 2 lines

here are some fixes for 2.6.29
The patches apply to linux-next

They do not apply to net-next-2.6, as just one example patch #2 has part of the patch saying:

@@ -1207,12 +1207,9 @@ static int qeth_l3_start_ipa_source_mac(

QETH_DBF_TEXT(TRACE, 3, "stsrcmac");

- if (!card->options.fake_ll)
- return -EOPNOTSUPP;
-
if (!qeth_is_supported(card, IPA_SOURCE_MAC)) {
dev_info(&card->gdev->dev,
- "Inbound source address not supported on %s\n",
+ "Inbound source MAC-address not supported on %s\n",
QETH_CARD_IFNAME(card));
return -EOPNOTSUPP;
}

Yet that "dev_info" is a PRINT_INFO in the net-next-2.6 tree.

Please resend patches which apply cleanly to my tree and I'll apply them.

Thank you.