Skip to contentSkip to conversation

qeth patches for 2.6.23-rc3

PATCH New Ursula Braun 1 participant 4 messages Aug 27, 2007

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

cover qeth patches for 2.6.23-rc3

Signature · 10 lines
qeth patches for 2.6.23-rc3:
- do not allow interruption of "ungroup"
- scatter gather mode: enforce rate limit
- don't return void function return values
- add tx checkumming for TSO/EDDP mode
- invoke qeth_clear_output_buffer only for allocated qdio queues.
- add specific message for exclusively used OSA-adapters
- drop ARP packets on HiperSockets

Regards,   Ursula Braun
#1 lore raw

PATCH 1/7 qeth: ungrouping a device must not be interruptible

From: Ursula Braun <[email protected]>

Problem:
A recovery thread must not be active when device is removed. In qeth_remove_device() an interruptible wait operation is used to wait until a qeth recovery thread is finished. If a user really interrupts the ungroup operation of a qeth device while a recovery is running, cio and qeth are out of sync (device already removed from cio, but kept in qeth). A following module unload of qeth results in a kernel OOPS here.

Solution:
Do not allow interruption of ungroup operation to guarantee finishing of a potentially running qeth recovery thread.

---

 drivers/s390/net/qeth_main.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/s390/net/qeth_main.c +2 -3
Index: linux-2.6-uschi/drivers/s390/net/qeth_main.c
===================================================================
@@ -561,7 +561,7 @@ qeth_set_offline(struct ccwgroup_device 
 }
 
 static int
-qeth_wait_for_threads(struct qeth_card *card, unsigned long threads);
+qeth_threads_running(struct qeth_card *card, unsigned long threads);
 
 
 static void
@@ -576,8 +576,7 @@ qeth_remove_device(struct ccwgroup_devic
 	if (!card)
 		return;
 
-	if (qeth_wait_for_threads(card, 0xffffffff))
-		return;
+	wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
 
 	if (cgdev->state == CCWGROUP_ONLINE){
 		card->use_hard_stop = 1;
#2 lore raw

PATCH 2/7 qeth: enforce a rate limit for inbound scatter gather messages

In reply to Ursula Braun

From: Frank Blaschka <[email protected]>

under memory pressure scatter gather mode switching messages must be rate limited.

---

 drivers/s390/net/qeth_main.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/s390/net/qeth_main.c +8 -5
Index: linux-2.6-uschi/drivers/s390/net/qeth_main.c
===================================================================
@@ -2803,13 +2803,16 @@ qeth_queue_input_buffer(struct qeth_card
 		if (newcount < count) {
 			/* we are in memory shortage so we switch back to
 			   traditional skb allocation and drop packages */
-			if (atomic_cmpxchg(&card->force_alloc_skb, 0, 1))
-				printk(KERN_WARNING
-					"qeth: switch to alloc skb\n");
+			if (!atomic_read(&card->force_alloc_skb) &&
+			    net_ratelimit())
+				PRINT_WARN("Switch to alloc skb\n");
+			atomic_set(&card->force_alloc_skb, 3);
 			count = newcount;
 		} else {
-			if (atomic_cmpxchg(&card->force_alloc_skb, 1, 0))
-				printk(KERN_WARNING "qeth: switch to sg\n");
+			if ((atomic_read(&card->force_alloc_skb) == 1) &&
+			    net_ratelimit())
+				PRINT_WARN("Switch to sg\n");
+			atomic_add_unless(&card->force_alloc_skb, -1, 0);
 		}
 
 		/*
#3 lore raw

PATCH 3/7 qeth: dont return the return values of void functions.

In reply to Ursula Braun

From: Heiko Carstens <[email protected]>

---

 drivers/s390/net/qeth.h     |    4 ++--
 drivers/s390/net/qeth_sys.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/s390/net/qeth.h +2 -2
Index: linux-2.6-uschi/drivers/s390/net/qeth.h
===================================================================
@@ -1178,9 +1178,9 @@ qeth_ipaddr_to_string(enum qeth_prot_ver
 		      char *buf)
 {
 	if (proto == QETH_PROT_IPV4)
-		return qeth_ipaddr4_to_string(addr, buf);
+		qeth_ipaddr4_to_string(addr, buf);
 	else if (proto == QETH_PROT_IPV6)
-		return qeth_ipaddr6_to_string(addr, buf);
+		qeth_ipaddr6_to_string(addr, buf);
 }
 
 static inline int
drivers/s390/net/qeth_sys.c +4 -4
Index: linux-2.6-uschi/drivers/s390/net/qeth_sys.c
===================================================================
@@ -1760,10 +1760,10 @@ qeth_remove_device_attributes(struct dev
 {
 	struct qeth_card *card = dev->driver_data;
 
-	if (card->info.type == QETH_CARD_TYPE_OSN)
-		return sysfs_remove_group(&dev->kobj,
-					  &qeth_osn_device_attr_group);
-
+	if (card->info.type == QETH_CARD_TYPE_OSN) {
+		sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group);
+		return;
+	}
 	sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
 	sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
 	sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);