Skip to contentSkip to conversation

s390: qeth bug fixes for 2.6.26

PATCH In review [email protected] 2 participants 9 messages Apr 1, 2008 – Apr 12, 2008

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

cover s390: qeth bug fixes for 2.6.26

Hi Jeff,

a couple of bug fixes for the new qeth. The patches apply to ..git/davem/net-2.6.26.git. The shortlog:

Ursula Braun (5)
qeth: improve ip_list administration after deregister failures
qeth: allow qdio queue element addresses > 2GB
qeth: set lan_online flag after a received STARTLAN
qeth: CCL-sequence numbers required for protocol ETH_P_802_2 only
qeth: keep ip-address after LAN_OFFLINE failure

Frank Blaschka (2)
qeth: layer 3 do not allow to change mac address
qeth: core code should alloc headroom for LLC protocol

Peter Tiedemann (1)
qeth: improving debug message handling

Frank

#1 lore raw

PATCH 1/8 qeth: improve ip_list administration after deregister failures

From: Ursula Braun <[email protected]>

1. ip_list handling after deregister failure of multicast address:
If error code "MC Address not found" is returned do not re-add multicast address to ip_list.
For other error codes readd multicast address at the end of function qeth_delete_all_mc.
2. ip_list handling after deregister failure or normal ip address:
If error code "IP Address not found" is returned do not re-add multicast address to ip list.
This is especially important in IP address takeover scenarios, to enable re-takeover of a taken over IP address.

---
 drivers/s390/net/qeth_core_mpc.c |    2 +-
 drivers/s390/net/qeth_core_mpc.h |    2 +-
 drivers/s390/net/qeth_l3_main.c  |   14 +++++++++-----
 3 files changed, 11 insertions(+), 7 deletions(-)
drivers/s390/net/qeth_l3_main.c +9 -5
Index: git_davem-2.6.26/drivers/s390/net/qeth_l3_main.c
===================================================================
@@ -401,8 +401,11 @@
 static void __qeth_l3_delete_all_mc(struct qeth_card *card,
 					unsigned long *flags)
 {
+	struct list_head fail_list;
 	struct qeth_ipaddr *addr, *tmp;
 	int rc;
+
+	INIT_LIST_HEAD(&fail_list);
 again:
 	list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
 		if (addr->is_multicast) {
@@ -410,13 +413,14 @@
 			spin_unlock_irqrestore(&card->ip_lock, *flags);
 			rc = qeth_l3_deregister_addr_entry(card, addr);
 			spin_lock_irqsave(&card->ip_lock, *flags);
-			if (!rc) {
+			if (!rc || (rc == IPA_RC_MC_ADDR_NOT_FOUND))
 				kfree(addr);
-				goto again;
-			} else
-				list_add(&addr->entry, &card->ip_list);
+			else
+				list_add_tail(&addr->entry, &fail_list);
+			goto again;
 		}
 	}
+	list_splice(&fail_list, &card->ip_list);
 }
 
 static void qeth_l3_set_ip_addr_list(struct qeth_card *card)
@@ -467,7 +471,7 @@
 			spin_unlock_irqrestore(&card->ip_lock, flags);
 			rc = qeth_l3_deregister_addr_entry(card, addr);
 			spin_lock_irqsave(&card->ip_lock, flags);
-			if (!rc)
+			if (!rc || (rc == IPA_RC_PRIMARY_ALREADY_DEFINED))
 				kfree(addr);
 			else
 				list_add_tail(&addr->entry, &card->ip_list);
drivers/s390/net/qeth_core_mpc.h +1 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_mpc.h
===================================================================
@@ -182,7 +182,7 @@
 	IPA_RC_SETIP_NO_STARTLAN	= 0xe008,
 	IPA_RC_SETIP_ALREADY_RECEIVED	= 0xe009,
 	IPA_RC_IP_ADDR_ALREADY_USED	= 0xe00a,
-	IPA_RC_MULTICAST_FULL		= 0xe00b,
+	IPA_RC_MC_ADDR_NOT_FOUND	= 0xe00b,
 	IPA_RC_SETIP_INVALID_VERSION	= 0xe00d,
 	IPA_RC_UNSUPPORTED_SUBCMD	= 0xe00e,
 	IPA_RC_ARP_ASSIST_NO_ENABLE	= 0xe00f,
drivers/s390/net/qeth_core_mpc.c +1 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_mpc.c
===================================================================
@@ -195,7 +195,7 @@
 	{IPA_RC_SETIP_NO_STARTLAN,	"Setip no startlan received"},
 	{IPA_RC_SETIP_ALREADY_RECEIVED,	"Setip already received"},
 	{IPA_RC_IP_ADDR_ALREADY_USED,	"IP address already in use on LAN"},
-	{IPA_RC_MULTICAST_FULL,		"No task available, multicast full"},
+	{IPA_RC_MC_ADDR_NOT_FOUND,	"Multicast address not found"},
 	{IPA_RC_SETIP_INVALID_VERSION,	"SETIP invalid IP version"},
 	{IPA_RC_UNSUPPORTED_SUBCMD,	"Unsupported assist subcommand"},
 	{IPA_RC_ARP_ASSIST_NO_ENABLE,	"Only partial success, no enable"},
#2 lore raw

Re: [patch 1/8] qeth: improve ip_list administration after deregister failures

applied 1-8

#3 lore raw

PATCH 2/8 qeth: allow qdio queue element addresses > 2GB

In reply to [email protected]

From: Ursula Braun <[email protected]>

OSA-adapters do not have an address limitation for the qdio queue structures except the MAX storage level of the current processor. And due to a recent z/VM APAR there is no longer a restriction to allocate qdio structures below 2 GB.

---
 drivers/s390/net/qeth_core_main.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/net/qeth_core_main.c +4 -4
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -241,7 +241,7 @@
 			return -ENOMEM;
 		}
 		for (j = 0; j < QETH_MAX_BUFFER_ELEMENTS(card); ++j) {
-			ptr = (void *) __get_free_page(GFP_KERNEL|GFP_DMA);
+			ptr = (void *) __get_free_page(GFP_KERNEL);
 			if (!ptr) {
 				while (j > 0)
 					free_page((unsigned long)
@@ -2000,7 +2000,7 @@
 		return 0;
 
 	card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q),
-				  GFP_KERNEL|GFP_DMA);
+				  GFP_KERNEL);
 	if (!card->qdio.in_q)
 		goto out_nomem;
 	QETH_DBF_TEXT(setup, 2, "inq");
@@ -2021,7 +2021,7 @@
 		goto out_freepool;
 	for (i = 0; i < card->qdio.no_out_queues; ++i) {
 		card->qdio.out_qs[i] = kmalloc(sizeof(struct qeth_qdio_out_q),
-					       GFP_KERNEL|GFP_DMA);
+					       GFP_KERNEL);
 		if (!card->qdio.out_qs[i])
 			goto out_freeoutq;
 		QETH_DBF_TEXT_(setup, 2, "outq %i", i);
@@ -2308,7 +2308,7 @@
 			struct qeth_buffer_pool_entry, list);
 	for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i) {
 		if (page_count(virt_to_page(entry->elements[i])) > 1) {
-			page = alloc_page(GFP_ATOMIC|GFP_DMA);
+			page = alloc_page(GFP_ATOMIC);
 			if (!page) {
 				return NULL;
 			} else {
#4 lore raw

PATCH 3/8 qeth: set lan_online flag after a received STARTLAN

In reply to [email protected]

From: Ursula Braun <[email protected]>

Problem: A STARTLAN command from the adapter may arrive while a
qeth recovery is currently running with a failed qeth STARTLAN. Usually qeth schedules a recovery when receiving a STARTLAN command from the adapter. But another recovery scheduled while a recovery is already running never starts. Thus the qeth-administered lan_online flag remains zero in this scenario, even though the adapter-STARTLAN has happened.
Solution: Set lan_online flag for a received STARTLAN from the
adapter in case scheduled recovery does not start.

---
 drivers/s390/net/qeth_core_main.c |    1 +
 1 file changed, 1 insertion(+)
drivers/s390/net/qeth_core_main.c +1 -0
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -417,6 +417,7 @@
 					   QETH_CARD_IFNAME(card),
 					   card->info.chpid);
 				netif_carrier_on(card->dev);
+				card->lan_online = 1;
 				qeth_schedule_recovery(card);
 				return NULL;
 			case IPA_CMD_MODCCID:
#5 lore raw

PATCH 4/8 qeth: CCL-sequence numbers required for protocol ETH_P_802_2 only

In reply to [email protected]

From: Ursula Braun <[email protected]>

Symptom:     slow CCL response time
Problem:     non-ETH_P_802_2 packets are not delivered to NDH for

CCL. But CCL detects missing sequence numbers, which cause a serious performance problem with CCL.
Solution: assign sequence numbers only to 802.2 packets.

---
 drivers/s390/net/qeth_l2_main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_l2_main.c +2 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_l2_main.c
===================================================================
@@ -451,7 +451,8 @@
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
 			else
 				skb->ip_summed = CHECKSUM_NONE;
-			*((__u32 *)skb->cb) = ++card->seqno.pkt_seqno;
+			if (skb->protocol == htons(ETH_P_802_2))
+				*((__u32 *)skb->cb) = ++card->seqno.pkt_seqno;
 			len = skb->len;
 			netif_rx(skb);
 			break;
#6 lore raw

PATCH 6/8 qeth: improving debug message handling

In reply to [email protected]

From: Peter Tiedemann <[email protected]>

Improving debug message handling, moving ipa into messages from kernel to dbf, some cleanups and typo fixes.

---
 drivers/s390/net/qeth_core.h      |   93 ++----
 drivers/s390/net/qeth_core_main.c |  577 +++++++++++++++++---------------------
 drivers/s390/net/qeth_core_mpc.c  |    2 
 drivers/s390/net/qeth_core_offl.c |   60 +--
 drivers/s390/net/qeth_l2_main.c   |  143 ++++-----
 drivers/s390/net/qeth_l3.h        |   11 
 drivers/s390/net/qeth_l3_main.c   |  282 +++++++++---------
 7 files changed, 543 insertions(+), 625 deletions(-)
drivers/s390/net/qeth_core.h +41 -52
Index: git_davem-2.6.26/drivers/s390/net/qeth_core.h
===================================================================
@@ -34,59 +34,53 @@
 
 #include "qeth_core_mpc.h"
 
+#define KMSG_COMPONENT "qeth"
+
 /**
  * Debug Facility stuff
  */
-#define QETH_DBF_SETUP_NAME "qeth_setup"
-#define QETH_DBF_SETUP_LEN 8
-#define QETH_DBF_SETUP_PAGES 8
-#define QETH_DBF_SETUP_NR_AREAS 1
-#define QETH_DBF_SETUP_LEVEL 5
-
-#define QETH_DBF_MISC_NAME "qeth_misc"
-#define QETH_DBF_MISC_LEN 128
-#define QETH_DBF_MISC_PAGES 2
-#define QETH_DBF_MISC_NR_AREAS 1
-#define QETH_DBF_MISC_LEVEL 2
-
-#define QETH_DBF_DATA_NAME "qeth_data"
-#define QETH_DBF_DATA_LEN 96
-#define QETH_DBF_DATA_PAGES 8
-#define QETH_DBF_DATA_NR_AREAS 1
-#define QETH_DBF_DATA_LEVEL 2
-
-#define QETH_DBF_CONTROL_NAME "qeth_control"
-#define QETH_DBF_CONTROL_LEN 256
-#define QETH_DBF_CONTROL_PAGES 8
-#define QETH_DBF_CONTROL_NR_AREAS 1
-#define QETH_DBF_CONTROL_LEVEL 5
-
-#define QETH_DBF_TRACE_NAME "qeth_trace"
-#define QETH_DBF_TRACE_LEN 8
-#define QETH_DBF_TRACE_PAGES 4
-#define QETH_DBF_TRACE_NR_AREAS 1
-#define QETH_DBF_TRACE_LEVEL 3
-
-#define QETH_DBF_SENSE_NAME "qeth_sense"
-#define QETH_DBF_SENSE_LEN 64
-#define QETH_DBF_SENSE_PAGES 2
-#define QETH_DBF_SENSE_NR_AREAS 1
-#define QETH_DBF_SENSE_LEVEL 2
-
-#define QETH_DBF_QERR_NAME "qeth_qerr"
-#define QETH_DBF_QERR_LEN 8
-#define QETH_DBF_QERR_PAGES 2
-#define QETH_DBF_QERR_NR_AREAS 1
-#define QETH_DBF_QERR_LEVEL 2
+enum qeth_dbf_names {
+	QETH_DBF_SETUP,
+	QETH_DBF_QERR,
+	QETH_DBF_TRACE,
+	QETH_DBF_MSG,
+	QETH_DBF_SENSE,
+	QETH_DBF_MISC,
+	QETH_DBF_CTRL,
+	QETH_DBF_INFOS	/* must be last element */
+};
+
+struct qeth_dbf_info {
+	char name[DEBUG_MAX_NAME_LEN];
+	int pages;
+	int areas;
+	int len;
+	int level;
+	struct debug_view *view;
+	debug_info_t *id;
+};
+
+#define QETH_DBF_CTRL_LEN 256
 
 #define QETH_DBF_TEXT(name, level, text) \
-	do { \
-		debug_text_event(qeth_dbf_##name, level, text); \
-	} while (0)
+	debug_text_event(qeth_dbf[QETH_DBF_##name].id, level, text)
 
 #define QETH_DBF_HEX(name, level, addr, len) \
+	debug_event(qeth_dbf[QETH_DBF_##name].id, level, (void *)(addr), len)
+
+#define QETH_DBF_MESSAGE(level, text...) \
+	debug_sprintf_event(qeth_dbf[QETH_DBF_MSG].id, level, text)
+
+#define QETH_DBF_TEXT_(name, level, text...) \
 	do { \
-		debug_event(qeth_dbf_##name, level, (void *)(addr), len); \
+		if (qeth_dbf_passes(qeth_dbf[QETH_DBF_##name].id, level)) { \
+			char *dbf_txt_buf = \
+				get_cpu_var(QETH_DBF_TXT_BUF); \
+			sprintf(dbf_txt_buf, text); \
+			debug_text_event(qeth_dbf[QETH_DBF_##name].id, \
+					level, dbf_txt_buf); \
+			put_cpu_var(QETH_DBF_TXT_BUF); \
+		} \
 	} while (0)
 
 /* Allow to sort out low debug levels early to avoid wasted sprints */
@@ -826,13 +820,8 @@
 
 /* exports for qeth discipline device drivers */
 extern struct qeth_card_list_struct qeth_core_card_list;
-extern debug_info_t *qeth_dbf_setup;
-extern debug_info_t *qeth_dbf_data;
-extern debug_info_t *qeth_dbf_misc;
-extern debug_info_t *qeth_dbf_control;
-extern debug_info_t *qeth_dbf_trace;
-extern debug_info_t *qeth_dbf_sense;
-extern debug_info_t *qeth_dbf_qerr;
+
+extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
 
 void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
 int qeth_threads_running(struct qeth_card *, unsigned long);
drivers/s390/net/qeth_core_main.c +262 -315

1,534 lines not on this page · raw message

drivers/s390/net/qeth_core_mpc.c +1 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_mpc.c
===================================================================
@@ -230,7 +230,7 @@
 	{IPA_CMD_STARTLAN,	"startlan"},
 	{IPA_CMD_STOPLAN,	"stoplan"},
 	{IPA_CMD_SETVMAC,	"setvmac"},
-	{IPA_CMD_DELVMAC,	"delvmca"},
+	{IPA_CMD_DELVMAC,	"delvmac"},
 	{IPA_CMD_SETGMAC,	"setgmac"},
 	{IPA_CMD_DELGMAC,	"delgmac"},
 	{IPA_CMD_SETVLAN,	"setvlan"},
drivers/s390/net/qeth_core_offl.c +30 -30

226 lines not on this page · raw message

drivers/s390/net/qeth_l2_main.c +67 -76

438 lines not on this page · raw message

drivers/s390/net/qeth_l3.h +1 -10
Index: git_davem-2.6.26/drivers/s390/net/qeth_l3.h
===================================================================
@@ -13,16 +13,7 @@
 
 #include "qeth_core.h"
 
-#define QETH_DBF_TEXT_(name, level, text...) \
-	do { \
-		if (qeth_dbf_passes(qeth_dbf_##name, level)) { \
-			char *dbf_txt_buf = get_cpu_var(qeth_l3_dbf_txt_buf); \
-			sprintf(dbf_txt_buf, text); \
-			debug_text_event(qeth_dbf_##name, level, dbf_txt_buf); \
-			put_cpu_var(qeth_l3_dbf_txt_buf); \
-		} \
-	} while (0)
-
+#define QETH_DBF_TXT_BUF qeth_l3_dbf_txt_buf
 DECLARE_PER_CPU(char[256], qeth_l3_dbf_txt_buf);
 
 struct qeth_ipaddr {
drivers/s390/net/qeth_l3_main.c +141 -141

664 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#7 lore raw

PATCH 7/8 qeth: core code should alloc headroom for LLC protocol

In reply to [email protected]

From: Frank Blaschka <[email protected]>

Allocate headroom for TR_HLEN but using only ETH_HLEN causes rx performance degradation. Allocate ETH_HLEN for ethernet and TR_HLEN for token ring (layer 3 mode).

---
 drivers/s390/net/qeth_core_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +5 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -4002,7 +4002,11 @@
 		}
 	} else {
 		skb_len = (*hdr)->hdr.l3.length;
-		headroom = max((int)ETH_HLEN, (int)TR_HLEN);
+		if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) ||
+		    (card->info.link_type == QETH_LINK_TYPE_HSTR))
+			headroom = TR_HLEN;
+		else
+			headroom = ETH_HLEN;
 	}
 
 	if (!skb_len)
#8 lore raw

PATCH 8/8 qeth: keep ip-address after LAN_OFFLINE failure

In reply to [email protected]

From: Ursula Braun <[email protected]>

Problem: If setting of an ip-address fails with LAN_OFFLINE,
qeth does not save the ip-address in its internal list of set ip-addresses. qeth recovers after a following STARTLAN event, but cannot set the unsaved ip-address.
Solution: save the ip-address in the qeth-maintained list of
ip-addresses after a LAN_OFFLINE failure for SETIP.

---
 drivers/s390/net/qeth_l3_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_l3_main.c +1 -1
Index: git_davem-2.6.26/drivers/s390/net/qeth_l3_main.c
===================================================================
@@ -461,7 +461,7 @@
 			spin_unlock_irqrestore(&card->ip_lock, flags);
 			rc = qeth_l3_register_addr_entry(card, todo);
 			spin_lock_irqsave(&card->ip_lock, flags);
-			if (!rc)
+			if (!rc || (rc == IPA_RC_LAN_OFFLINE))
 				list_add_tail(&todo->entry, &card->ip_list);
 			else
 				kfree(todo);