Skip to contentSkip to conversation

s390: qeth fixes for 2.6.30

PATCH Applied [email protected] 3 participants 10 messages Mar 25, 2009

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

cover s390: qeth fixes for 2.6.30

Hi Dave,

here are a couple of qeth fixes for 2.6.30

shortlog:
Kay Sievers (1)
qeth: struct device - replace bus_id with dev_name(), dev_set_name()

Klaus-Dieter Wacker (1)
qeth: unregister MAC addresses during recovery

Ursula Braun (1)
qeth: check for completion of a running recovery

Heiko Carstens(1)
qeth: fix wait_event_timeout handling

Frank Blaschka (2)
qeth: add statistics for tx csum
qeth: remove EDDP

Thanks,
Frank

#1 lore raw

PATCH 1/6 qeth: struct device - replace bus_id with dev_name(), dev_set_name()

From: Kay Sievers <[email protected]>

---

 drivers/s390/net/qeth_l3_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_l3_main.c +1 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
@@ -1038,7 +1038,7 @@ static int qeth_l3_setadapter_parms(stru
 	rc = qeth_query_setadapterparms(card);
 	if (rc) {
 		QETH_DBF_MESSAGE(2, "%s couldn't set adapter parameters: "
-			"0x%x\n", card->gdev->dev.bus_id, rc);
+			"0x%x\n", dev_name(&card->gdev->dev), rc);
 		return rc;
 	}
 	if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) {
#2 lore raw

PATCH 2/6 qeth: add statistics for tx csum

In reply to [email protected]

From: Frank Blaschka <[email protected]>

Add statistics counter for software tx checksumming.

---

 drivers/s390/net/qeth_core.h      |    1 +
 drivers/s390/net/qeth_core_main.c |    2 ++
 drivers/s390/net/qeth_l2_main.c   |    5 ++++-
 drivers/s390/net/qeth_l3_main.c   |    5 ++++-
 4 files changed, 11 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_core.h +1 -0
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
@@ -134,6 +134,7 @@ struct qeth_perf_stats {
 	unsigned int sg_skbs_rx;
 	unsigned int sg_frags_rx;
 	unsigned int sg_alloc_page_rx;
+	unsigned int tx_csum;
 };
 
 /* Routing stuff */
drivers/s390/net/qeth_core_main.c +2 -0
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
@@ -4327,6 +4327,7 @@ static struct {
 /* 30 */{"tx count"},
 	{"tx do_QDIO time"},
 	{"tx do_QDIO count"},
+	{"tx csum"},
 };
 
 int qeth_core_get_stats_count(struct net_device *dev)
@@ -4378,6 +4379,7 @@ void qeth_core_get_ethtool_stats(struct 
 	data[30] = card->perf_stats.outbound_cnt;
 	data[31] = card->perf_stats.outbound_do_qdio_time;
 	data[32] = card->perf_stats.outbound_do_qdio_cnt;
+	data[33] = card->perf_stats.tx_csum;
 }
 EXPORT_SYMBOL_GPL(qeth_core_get_ethtool_stats);
 
drivers/s390/net/qeth_l2_main.c +4 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_l2_main.c linux-2.6-patched/drivers/s390/net/qeth_l2_main.c
@@ -707,8 +707,11 @@ static int qeth_l2_hard_start_xmit(struc
 	}
 
 	if ((large_send == QETH_LARGE_SEND_NO) &&
-	    (skb->ip_summed == CHECKSUM_PARTIAL))
+	    (skb->ip_summed == CHECKSUM_PARTIAL)) {
 		qeth_tx_csum(new_skb);
+		if (card->options.performance_stats)
+			card->perf_stats.tx_csum++;
+	}
 
 	if (card->info.type != QETH_CARD_TYPE_IQD)
 		rc = qeth_do_send_packet(card, queue, new_skb, hdr,
drivers/s390/net/qeth_l3_main.c +4 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
@@ -2711,8 +2711,11 @@ static int qeth_l3_hard_start_xmit(struc
 	}
 
 	if ((large_send == QETH_LARGE_SEND_NO) &&
-	    (new_skb->ip_summed == CHECKSUM_PARTIAL))
+	    (new_skb->ip_summed == CHECKSUM_PARTIAL)) {
 		qeth_tx_csum(new_skb);
+		if (card->options.performance_stats)
+			card->perf_stats.tx_csum++;
+	}
 
 	if (card->info.type != QETH_CARD_TYPE_IQD)
 		rc = qeth_do_send_packet(card, queue, new_skb, hdr,
#3 lore raw

PATCH 3/6 qeth: remove EDDP

In reply to [email protected]

From: Frank Blaschka <[email protected]>

Performance measurements showed EDDP does not lower CPU costs but increase them. So we dump out EDDP code from qeth driver.

---

 drivers/s390/net/Makefile         |    2 
 drivers/s390/net/qeth_core.h      |    7 
 drivers/s390/net/qeth_core_main.c |   99 +----
 drivers/s390/net/qeth_core_offl.c |  699 --------------------------------------
 drivers/s390/net/qeth_core_offl.h |   76 ----
 drivers/s390/net/qeth_core_sys.c  |    4 
 drivers/s390/net/qeth_l2_main.c   |   81 ----
 drivers/s390/net/qeth_l3_main.c   |  123 ++++--
 8 files changed, 111 insertions(+), 980 deletions(-)
drivers/s390/net/Makefile +1 -1
diff -urpN linux-2.6/drivers/s390/net/Makefile linux-2.6-patched/drivers/s390/net/Makefile
@@ -8,7 +8,7 @@ obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
 obj-$(CONFIG_SMSGIUCV) += smsgiucv.o
 obj-$(CONFIG_LCS) += lcs.o cu3088.o
 obj-$(CONFIG_CLAW) += claw.o cu3088.o
-qeth-y += qeth_core_sys.o qeth_core_main.o qeth_core_mpc.o qeth_core_offl.o
+qeth-y += qeth_core_sys.o qeth_core_main.o qeth_core_mpc.o
 obj-$(CONFIG_QETH) += qeth.o
 qeth_l2-y += qeth_l2_main.o
 obj-$(CONFIG_QETH_L2) += qeth_l2.o
drivers/s390/net/qeth_core.h +2 -5
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
@@ -404,7 +404,6 @@ struct qeth_qdio_q {
 /* possible types of qeth large_send support */
 enum qeth_large_send_types {
 	QETH_LARGE_SEND_NO,
-	QETH_LARGE_SEND_EDDP,
 	QETH_LARGE_SEND_TSO,
 };
 
@@ -839,11 +838,9 @@ int qeth_get_cast_type(struct qeth_card 
 int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
 int qeth_get_elements_no(struct qeth_card *, void *, struct sk_buff *, int);
 int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *,
-			struct sk_buff *, struct qeth_hdr *, int,
-			struct qeth_eddp_context *, int, int);
+			struct sk_buff *, struct qeth_hdr *, int, int, int);
 int qeth_do_send_packet(struct qeth_card *, struct qeth_qdio_out_q *,
-		    struct sk_buff *, struct qeth_hdr *,
-		    int, struct qeth_eddp_context *);
+		    struct sk_buff *, struct qeth_hdr *, int);
 int qeth_core_get_stats_count(struct net_device *);
 void qeth_core_get_ethtool_stats(struct net_device *,
 				struct ethtool_stats *, u64 *);
drivers/s390/net/qeth_core_main.c +23 -76

159 lines not on this page · raw message

drivers/s390/net/qeth_core_offl.c +0 -699

699 lines not on this page · raw message

drivers/s390/net/qeth_core_offl.h +0 -76

76 lines not on this page · raw message

drivers/s390/net/qeth_core_sys.c +0 -4
diff -urpN linux-2.6/drivers/s390/net/qeth_core_sys.c linux-2.6-patched/drivers/s390/net/qeth_core_sys.c
@@ -427,8 +427,6 @@ static ssize_t qeth_dev_large_send_show(
 	switch (card->options.large_send) {
 	case QETH_LARGE_SEND_NO:
 		return sprintf(buf, "%s\n", "no");
-	case QETH_LARGE_SEND_EDDP:
-		return sprintf(buf, "%s\n", "EDDP");
 	case QETH_LARGE_SEND_TSO:
 		return sprintf(buf, "%s\n", "TSO");
 	default:
@@ -449,8 +447,6 @@ static ssize_t qeth_dev_large_send_store
 	tmp = strsep((char **) &buf, "\n");
 	if (!strcmp(tmp, "no")) {
 		type = QETH_LARGE_SEND_NO;
-	} else if (!strcmp(tmp, "EDDP")) {
-		type = QETH_LARGE_SEND_EDDP;
 	} else if (!strcmp(tmp, "TSO")) {
 		type = QETH_LARGE_SEND_TSO;
 	} else {
drivers/s390/net/qeth_l2_main.c +8 -73

129 lines not on this page · raw message

drivers/s390/net/qeth_l3_main.c +77 -46

199 lines not on this page · raw message

#4 lore raw

PATCH 4/6 qeth: unregister MAC addresses during recovery.

In reply to [email protected]

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

qeth: Unregister MAC addresses from device (layer 2) during recovery cycle. When the device is set online the MAC addresses are registered again on the device.

---

 drivers/s390/net/qeth_l2_main.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +4 -2
diff -urpN linux-2.6/drivers/s390/net/qeth_l2_main.c linux-2.6-patched/drivers/s390/net/qeth_l2_main.c
@@ -378,7 +378,8 @@ static int qeth_l2_stop_card(struct qeth
 			dev_close(card->dev);
 			rtnl_unlock();
 		}
-		if (!card->use_hard_stop) {
+		if (!card->use_hard_stop ||
+			recovery_mode) {
 			__u8 *mac = &card->dev->dev_addr[0];
 			rc = qeth_l2_send_delmac(card, mac);
 			QETH_DBF_TEXT_(SETUP, 2, "Lerr%d", rc);
@@ -387,7 +388,8 @@ static int qeth_l2_stop_card(struct qeth
 	}
 	if (card->state == CARD_STATE_SOFTSETUP) {
 		qeth_l2_process_vlans(card, 1);
-		if (!card->use_hard_stop)
+		if (!card->use_hard_stop ||
+			recovery_mode)
 			qeth_l2_del_all_mc(card);
 		qeth_clear_ipacmd_list(card);
 		card->state = CARD_STATE_HARDSETUP;
#5 lore raw

PATCH 5/6 qeth: check for completion of a running recovery

In reply to [email protected]

From: Ursula Braun <[email protected]>

When a recovery is started for a qeth device, additional invocations to change a mac address, to configure a VLAN interface on top, or to add multicast addresses should wait till recovery is finished, otherwise recovery might fail.

---

 drivers/s390/net/qeth_l2_main.c |   15 +++++++++++++++
 drivers/s390/net/qeth_l3_main.c |    7 +++++++
 2 files changed, 22 insertions(+)
drivers/s390/net/qeth_l2_main.c +15 -0
diff -urpN linux-2.6/drivers/s390/net/qeth_l2_main.c linux-2.6-patched/drivers/s390/net/qeth_l2_main.c
@@ -327,6 +327,10 @@ static void qeth_l2_vlan_rx_add_vid(stru
 	struct qeth_vlan_vid *id;
 
 	QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid);
+	if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+		QETH_DBF_TEXT(TRACE, 3, "aidREC");
+		return;
+	}
 	id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC);
 	if (id) {
 		id->vid = vid;
@@ -343,6 +347,10 @@ static void qeth_l2_vlan_rx_kill_vid(str
 	struct qeth_card *card = dev->ml_priv;
 
 	QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
+	if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+		QETH_DBF_TEXT(TRACE, 3, "kidREC");
+		return;
+	}
 	spin_lock_bh(&card->vlanlock);
 	list_for_each_entry(id, &card->vid_list, list) {
 		if (id->vid == vid) {
@@ -594,6 +602,10 @@ static int qeth_l2_set_mac_address(struc
 	}
 	QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card));
 	QETH_DBF_HEX(TRACE, 3, addr->sa_data, OSA_ADDR_LEN);
+	if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+		QETH_DBF_TEXT(TRACE, 3, "setmcREC");
+		return -ERESTARTSYS;
+	}
 	rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]);
 	if (!rc)
 		rc = qeth_l2_send_setmac(card, addr->sa_data);
@@ -609,6 +621,9 @@ static void qeth_l2_set_multicast_list(s
 		return ;
 
 	QETH_DBF_TEXT(TRACE, 3, "setmulti");
+	if (qeth_threads_running(card, QETH_RECOVER_THREAD) &&
+	    (card->state != CARD_STATE_UP))
+		return;
 	qeth_l2_del_all_mc(card);
 	spin_lock_bh(&card->mclock);
 	for (dm = dev->mc_list; dm; dm = dm->next)
drivers/s390/net/qeth_l3_main.c +7 -0
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
@@ -1838,6 +1838,10 @@ static void qeth_l3_vlan_rx_kill_vid(str
 	unsigned long flags;
 
 	QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
+	if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+		QETH_DBF_TEXT(TRACE, 3, "kidREC");
+		return;
+	}
 	spin_lock_irqsave(&card->vlanlock, flags);
 	/* unregister IP addresses of vlan device */
 	qeth_l3_free_vlan_addresses(card, vid);
@@ -2101,6 +2105,9 @@ static void qeth_l3_set_multicast_list(s
 	struct qeth_card *card = dev->ml_priv;
 
 	QETH_DBF_TEXT(TRACE, 3, "setmulti");
+	if (qeth_threads_running(card, QETH_RECOVER_THREAD) &&
+	    (card->state != CARD_STATE_UP))
+		return;
 	qeth_l3_delete_mc_addresses(card);
 	qeth_l3_add_multicast_ipv4(card);
 #ifdef CONFIG_QETH_IPV6
#6 lore raw

PATCH 6/6 qeth: fix wait_event_timeout handling

In reply to [email protected]

From: Heiko Carstens <[email protected]>

wait_event_timeout just takes the numnber of jiffies to wait as an argument. That value does not include jiffies itself.

---

 drivers/s390/net/qeth_core_main.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/s390/net/qeth_core_main.c +5 -4
Index: git_linus/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -1676,7 +1676,7 @@ int qeth_send_control_data(struct qeth_c
 	int rc;
 	unsigned long flags;
 	struct qeth_reply *reply = NULL;
-	unsigned long timeout;
+	unsigned long timeout, event_timeout;
 	struct qeth_ipa_cmd *cmd;
 
 	QETH_DBF_TEXT(TRACE, 2, "sendctl");
@@ -1701,9 +1701,10 @@ int qeth_send_control_data(struct qeth_c
 	qeth_prepare_control_data(card, len, iob);
 
 	if (IS_IPA(iob->data))
-		timeout = jiffies + QETH_IPA_TIMEOUT;
+		event_timeout = QETH_IPA_TIMEOUT;
 	else
-		timeout = jiffies + QETH_TIMEOUT;
+		event_timeout = QETH_TIMEOUT;
+	timeout = jiffies + event_timeout;
 
 	QETH_DBF_TEXT(TRACE, 6, "noirqpnd");
 	spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags);
@@ -1731,7 +1732,7 @@ int qeth_send_control_data(struct qeth_c
 	if ((cmd->hdr.command == IPA_CMD_SETIP) &&
 	    (cmd->hdr.prot_version == QETH_PROT_IPV4)) {
 		if (!wait_event_timeout(reply->wait_q,
-		    atomic_read(&reply->received), timeout))
+		    atomic_read(&reply->received), event_timeout))
 			goto time_err;
 	} else {
 		while (!atomic_read(&reply->received)) {
maintainer Applied
#7 lore raw
In reply to [email protected]

From: [email protected]
Date: Wed, 25 Mar 2009 07:57:13 +0100

Quoted 1 line

here are a couple of qeth fixes for 2.6.30

Any particular reason you wait until right when the merge window opens to send me stuff?

I said on netdev that I wanted to empty my patchwork queue then submit the tree to Linus.

So then you send me more stuff on top of that? :-/

Please don't wait until the last moment next time.

Quoted 3 lines

shortlog:
Kay Sievers (1)
qeth: struct device - replace bus_id with dev_name(), dev_set_name()

Applied.

Quoted 2 lines

Klaus-Dieter Wacker (1)
qeth: unregister MAC addresses during recovery

Applied.

Quoted 2 lines

Ursula Braun (1)
qeth: check for completion of a running recovery

Applied.

Quoted 2 lines

Heiko Carstens(1)
qeth: fix wait_event_timeout handling

Applied.

Quoted 3 lines

Frank Blaschka (2)
qeth: add statistics for tx csum
qeth: remove EDDP

Your EDDP was slow because the implementation was incredibly sub-optimal. %90 of the code is doing copies and fiddling with SKB internals.

#8 lore raw
Quoted 10 lines

Any particular reason you wait until right when the merge window opens to send me stuff?

I said on netdev that I wanted to empty my patchwork queue then submit the tree to Linus.

So then you send me more stuff on top of that? :-/

Please don't wait until the last moment next time.

Sorry, this was by accident. Next time I will send the patches sooner.

Quoted 9 lines

Applied.

Quoted 3 lines

Frank Blaschka (2)
qeth: add statistics for tx csum
qeth: remove EDDP

Your EDDP was slow because the implementation was incredibly sub-optimal. %90 of the code is doing copies and fiddling with SKB internals.

I did not wrote the EDDP code but this was my impression too. Thanks for confirming my study. Also the filling of the hardware buffers was not efficient and passing more buffers to the hw was expensive too.

maintainer
#9 lore raw

From: Frank Blaschka <[email protected]>
Date: Wed, 25 Mar 2009 09:25:14 +0100

Quoted 7 lines
Quoted 3 lines

Your EDDP was slow because the implementation was incredibly sub-optimal. %90 of the code is doing copies and fiddling with SKB internals.

I did not wrote the EDDP code but this was my impression too. Thanks for confirming my study. Also the filling of the hardware buffers was not efficient and passing more buffers to the hw was expensive too.

I keep meaning to get back to a project I was working on that would make generic the by-hand TSO that drivers such as drivers/net/sfc/ are doing.

Just like this EDDP code seems to have been doing, they claim to be TSO capable as a device but it is all done in software.

The hope is to write a generic framework, and skb_dma_map() and skb_dma_unmap() were created as initial infrastructure for that.

Anyways, if I ever complete that project, drivers like qeth could try to make use of it and do some perf tests.