Skip to contentSkip to conversation

s390: claw/lcs/netiucv network driver patches for 2.6.25

PATCH In review Ursula Braun 2 participants 7 messages Feb 8, 2008 – Feb 11, 2008

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

cover s390: claw/lcs/netiucv network driver patches for 2.6.25

Signature · 13 lines
Jeff,

The following patches are intended for 2.6.25.
They affect the s390 network drivers claw, lcs, and netiucv.

Patch summary:
  claw:    remove unused volatile variables
  netiucv: define module owner in device_driver structure
  netiucv: renaming of NOP action
  lcs:     improvement for debug area setup
  claw/lcs/netiucv: optimize a debugging macro

Regards, Ursula Braun
#1 lore raw

PATCH 1/5 claw: removal of volatile variables

From: Ursula Braun <[email protected]>

Volatile variables queme_switch and pk_delay are not used anyway. They are just a left over from an unused timer based packing logic.

---

 drivers/s390/net/claw.h |    2 --
 1 file changed, 2 deletions(-)
drivers/s390/net/claw.h +0 -2
Index: linux-2.6-uschi/drivers/s390/net/claw.h
===================================================================
@@ -278,8 +278,6 @@ struct claw_env {
         __u16                   write_size;     /* write buffer size */
         __u16                   dev_id;         /* device ident */
 	__u8			packing;	/* are we packing? */
-	volatile __u8		queme_switch;   /* gate for imed packing  */
-	volatile unsigned long	pk_delay;	/* Delay for adaptive packing */
         __u8                    in_use;         /* device active flag */
         struct net_device       *ndev;    	/* backward ptr to the net dev*/
 };
#2 lore raw

Re: [patch 1/5] claw: removal of volatile variables

applied 1-5 to #upstream-fixes (2.6.25)

#3 lore raw

PATCH 2/5 netiucv: Remember to set driver->owner.

In reply to Ursula Braun

From: Cornelia Huck <[email protected]>

---

 drivers/s390/net/netiucv.c |    1 +
 1 file changed, 1 insertion(+)
drivers/s390/net/netiucv.c +1 -0
Index: linux-2.6-uschi/drivers/s390/net/netiucv.c
===================================================================
@@ -137,6 +137,7 @@ PRINT_##importance(header "%02x %02x %02
 #define PRINTK_HEADER " iucv: "       /* for debugging */
 
 static struct device_driver netiucv_driver = {
+	.owner = THIS_MODULE,
 	.name = "netiucv",
 	.bus  = &iucv_bus,
 };
#4 lore raw

PATCH 3/5 netiucv: change name of nop function

In reply to Ursula Braun

From: Ursula Braun <[email protected]>

Dummy NOP actions for fsm-statemachines have to be defined separately for every using module of fsm-statemachines. Thus the generic name fsm_action_nop is replaced by module specific name netiucv_action_nop.

---

 drivers/s390/net/netiucv.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/s390/net/netiucv.c +3 -3
Index: linux-2.6-uschi/drivers/s390/net/netiucv.c
===================================================================
@@ -573,9 +573,9 @@ static void netiucv_callback_connres(str
 }
 
 /**
- * Dummy NOP action for all statemachines
+ * NOP action for statemachines
  */
-static void fsm_action_nop(fsm_instance *fi, int event, void *arg)
+static void netiucv_action_nop(fsm_instance *fi, int event, void *arg)
 {
 }
 
@@ -1111,7 +1111,7 @@ static const fsm_node dev_fsm[] = {
 
 	{ DEV_STATE_RUNNING,    DEV_EVENT_STOP,    dev_action_stop     },
 	{ DEV_STATE_RUNNING,    DEV_EVENT_CONDOWN, dev_action_conndown },
-	{ DEV_STATE_RUNNING,    DEV_EVENT_CONUP,   fsm_action_nop      },
+	{ DEV_STATE_RUNNING,    DEV_EVENT_CONUP,   netiucv_action_nop  },
 };
 
 static const int DEV_FSM_LEN = sizeof(dev_fsm) / sizeof(fsm_node);
#5 lore raw

PATCH 4/5 lcs: avoid/reduce unused s390dbf debug areas.

In reply to Ursula Braun

From: Peter Tiedemann <[email protected]>

Since lcs makes use of 1 debug area only, the number of debug areas is reduced, while the number of pages per area is increased.

---

 drivers/s390/net/lcs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/lcs.c +1 -1
Index: linux-2.6-uschi/drivers/s390/net/lcs.c
===================================================================
@@ -94,7 +94,7 @@ static int
 lcs_register_debug_facility(void)
 {
 	lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8);
-	lcs_dbf_trace = debug_register("lcs_trace", 2, 2, 8);
+	lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8);
 	if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {
 		PRINT_ERR("Not enough memory for debug facility.\n");
 		lcs_unregister_debug_facility();
#6 lore raw

PATCH 5/5 claw/lcs/netiucv: check s390dbf level before sprints

In reply to Ursula Braun

From: Peter Tiedemann <[email protected]>

additional check of s390dbf level results in better performance if the default low debugging level is active.

---

 drivers/s390/net/claw.h    |   17 +++++++++++++----
 drivers/s390/net/lcs.h     |   16 ++++++++++++----
 drivers/s390/net/netiucv.c |   22 ++++++++++++++++------
 3 files changed, 41 insertions(+), 14 deletions(-)
drivers/s390/net/claw.h +13 -4
Index: linux-2.6-uschi/drivers/s390/net/claw.h
===================================================================
@@ -114,11 +114,20 @@ do { \
 	debug_event(claw_dbf_##name,level,(void*)(addr),len); \
 } while (0)
 
+/* Allow to sort out low debug levels early to avoid wasted sprints */
+static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level)
+{
+	return (level <= dbf_grp->level);
+}
+
 #define CLAW_DBF_TEXT_(level,name,text...) \
-do {                                       \
-	sprintf(debug_buffer, text);  \
-		debug_text_event(claw_dbf_##name,level, debug_buffer);\
-} while (0)
+	do { \
+		if (claw_dbf_passes(claw_dbf_##name, level)) { \
+			sprintf(debug_buffer, text); \
+			debug_text_event(claw_dbf_##name, level, \
+						debug_buffer); \
+		} \
+	} while (0)
 
 /*******************************************************
 *  Define Control Blocks                               *
drivers/s390/net/lcs.h +12 -4
Index: linux-2.6-uschi/drivers/s390/net/lcs.h
===================================================================
@@ -16,11 +16,19 @@ do { \
 	debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
 } while (0)
 
+/* Allow to sort out low debug levels early to avoid wasted sprints */
+static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level)
+{
+	return (level <= dbf_grp->level);
+}
+
 #define LCS_DBF_TEXT_(level,name,text...) \
-do {                                       \
-	sprintf(debug_buffer, text);  \
-		debug_text_event(lcs_dbf_##name,level, debug_buffer);\
-} while (0)
+	do { \
+		if (lcs_dbf_passes(lcs_dbf_##name, level)) { \
+			sprintf(debug_buffer, text); \
+			debug_text_event(lcs_dbf_##name, level, debug_buffer); \
+		} \
+	} while (0)
 
 /**
  *	sysfs related stuff
drivers/s390/net/netiucv.c +16 -6
Index: linux-2.6-uschi/drivers/s390/net/netiucv.c
===================================================================
@@ -97,12 +97,22 @@ MODULE_DESCRIPTION ("Linux for S/390 IUC
 
 DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
 
-#define IUCV_DBF_TEXT_(name,level,text...)				\
-	do {								\
-		char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf);	\
-		sprintf(iucv_dbf_txt_buf, text);			\
-		debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \
-		put_cpu_var(iucv_dbf_txt_buf);				\
+/* Allow to sort out low debug levels early to avoid wasted sprints */
+static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level)
+{
+	return (level <= dbf_grp->level);
+}
+
+#define IUCV_DBF_TEXT_(name, level, text...) \
+	do { \
+		if (iucv_dbf_passes(iucv_dbf_##name, level)) { \
+			char* iucv_dbf_txt_buf = \
+					get_cpu_var(iucv_dbf_txt_buf); \
+			sprintf(iucv_dbf_txt_buf, text); \
+			debug_text_event(iucv_dbf_##name, level, \
+						iucv_dbf_txt_buf); \
+			put_cpu_var(iucv_dbf_txt_buf); \
+		} \
 	} while (0)
 
 #define IUCV_DBF_SPRINTF(name,level,text...) \