Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/5] sky2: version 1.2
From: Bertrand Jacquin @ 2006-04-29 18:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: jgarzik, netdev
In-Reply-To: <20060425175849.372221000@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

Le Tue, 25 Apr 2006 10:58:49 -0700, Stephen Hemminger <shemminger@osdl.org> m'a avoué:

> Update to sky2 driver. Mostly fixes to try and handle users
> stuck with edge-triggered interrupts. Also, some minor cleanups.
> 
> Patches apply onto 1.1 version in 2.6.17-rc2

Hi,

I've just testing patches and I get still the same bug.

-- 
/* Beber : beber (AT) gna (DOT) org
 * http://guybrush.ath.cx, irc://irc.freenode.net/#{e.fr,gentoofr}
 * Guybrush @ Melee */

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [ROSE] Remove useless prototype for rose_remove_neigh().
From: Ralf Baechle @ 2006-04-29 13:25 UTC (permalink / raw)
  To: David S. Miller, netdev

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 net/rose/rose_route.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-net.git/net/rose/rose_route.c
===================================================================
--- linux-net.git.orig/net/rose/rose_route.c	2006-04-29 14:18:02.000000000 +0100
+++ linux-net.git/net/rose/rose_route.c	2006-04-29 14:18:58.000000000 +0100
@@ -48,8 +48,6 @@ static DEFINE_SPINLOCK(rose_route_list_l
 
 struct rose_neigh *rose_loopback_neigh;
 
-static void rose_remove_neigh(struct rose_neigh *);
-
 /*
  *	Add a new route to a node, and in the process add the node and the
  *	neighbour if it is new.

^ permalink raw reply

* [AX.25] Spelling fix
From: Ralf Baechle DL5RB @ 2006-04-29 14:24 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
 net/ax25/ax25_route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-net.git/net/ax25/ax25_route.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_route.c	2006-04-29 11:52:12.000000000 +0100
+++ linux-net.git/net/ax25/ax25_route.c	2006-04-29 15:23:13.000000000 +0100
@@ -360,7 +360,7 @@ struct file_operations ax25_route_fops =
 /*
  *	Find AX.25 route
  *
- *	Only routes with a refernce rout of zero can be destroyed.
+ *	Only routes with a reference count of zero can be destroyed.
  */
 static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
 {

^ permalink raw reply

* [PATCH 0/3] Eleminate HZ from AX.25, NETROM and ROSE kernel interfaces
From: Ralf Baechle @ 2006-04-29 14:03 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

AX.25, NET/ROM and ROSE unfortunately still use jiffies as the unit of
time for all their timeouts that can be configured through sysctl and
it's procfs equivalents.  This did result in a change of these kernel
interfaces going from Linux 2.4 to 2.6 for anybody who was unlucky enough
to use an affected platform such as i386 and most MIPS but not Alpha.
Making matters worse, it required the sysadmin of the particular system
to know the timing value making it very, very broken inteface design.
The timer interrupt frequency recently becoming configurable made things
even worse, so this really needed to be fixed.  The following series
of patches contains three patches, one for each of the three packet radio
protocols to switch the unit used by the sysadmin to miliseconds thus
resulting in a deterministic interface.

  Ralf

^ permalink raw reply

* [AX25, ROSE] Remove useless SET_MODULE_OWNER calls.
From: Ralf Baechle DL5RB @ 2006-04-29 14:29 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

--

 net/netrom/nr_dev.c |    1 -
 net/rose/rose_dev.c |    1 -
 2 files changed, 2 deletions(-)

Index: linux-net.git/net/netrom/nr_dev.c
===================================================================
--- linux-net.git.orig/net/netrom/nr_dev.c	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/net/netrom/nr_dev.c	2006-04-29 11:38:00.000000000 +0100
@@ -185,7 +185,6 @@ static struct net_device_stats *nr_get_s
 
 void nr_setup(struct net_device *dev)
 {
-	SET_MODULE_OWNER(dev);
 	dev->mtu		= NR_MAX_PACKET_SIZE;
 	dev->hard_start_xmit	= nr_xmit;
 	dev->open		= nr_open;
Index: linux-net.git/net/rose/rose_dev.c
===================================================================
--- linux-net.git.orig/net/rose/rose_dev.c	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/net/rose/rose_dev.c	2006-04-29 11:38:00.000000000 +0100
@@ -135,7 +135,6 @@ static struct net_device_stats *rose_get
 
 void rose_setup(struct net_device *dev)
 {
-	SET_MODULE_OWNER(dev);
 	dev->mtu		= ROSE_MAX_PACKET_SIZE - 2;
 	dev->hard_start_xmit	= rose_xmit;
 	dev->open		= rose_open;

^ permalink raw reply

* [HAMRADIO] Remove remaining SET_MODULE_OWNER calls from hamradio drivers.
From: Ralf Baechle DL5RB @ 2006-04-29 14:34 UTC (permalink / raw)
  To: Jeff Garzik, netdev, linux-hams

Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>

--

 drivers/net/hamradio/dmascc.c |    1 -
 drivers/net/hamradio/scc.c    |    1 -
 drivers/net/hamradio/yam.c    |    1 -
 3 files changed, 3 deletions(-)

Index: linux-net.git/drivers/net/hamradio/dmascc.c
===================================================================
--- linux-net.git.orig/drivers/net/hamradio/dmascc.c	2006-04-29 01:54:04.000000000 +0100
+++ linux-net.git/drivers/net/hamradio/dmascc.c	2006-04-29 11:38:06.000000000 +0100
@@ -582,7 +582,6 @@ static int __init setup_adapter(int card
 		INIT_WORK(&priv->rx_work, rx_bh, priv);
 		dev->priv = priv;
 		sprintf(dev->name, "dmascc%i", 2 * n + i);
-		SET_MODULE_OWNER(dev);
 		dev->base_addr = card_base;
 		dev->irq = irq;
 		dev->open = scc_open;
Index: linux-net.git/drivers/net/hamradio/scc.c
===================================================================
--- linux-net.git.orig/drivers/net/hamradio/scc.c	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/drivers/net/hamradio/scc.c	2006-04-29 11:38:06.000000000 +0100
@@ -1550,7 +1550,6 @@ static unsigned char ax25_nocall[AX25_AD
 
 static void scc_net_setup(struct net_device *dev)
 {
-	SET_MODULE_OWNER(dev);
 	dev->tx_queue_len    = 16;	/* should be enough... */
 
 	dev->open            = scc_net_open;
Index: linux-net.git/drivers/net/hamradio/yam.c
===================================================================
--- linux-net.git.orig/drivers/net/hamradio/yam.c	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/drivers/net/hamradio/yam.c	2006-04-29 11:38:06.000000000 +0100
@@ -1098,7 +1098,6 @@ static void yam_setup(struct net_device 
 
 	dev->base_addr = yp->iobase;
 	dev->irq = yp->irq;
-	SET_MODULE_OWNER(dev);
 
 	dev->open = yam_open;
 	dev->stop = yam_close;

^ permalink raw reply

* [PATCH 2/3] Eleminate HZ from NET/ROM kernel interfaces
From: Ralf Baechle @ 2006-04-29 14:16 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

Convert all NET/ROM sysctl time values from jiffies to ms as units.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

--

 include/net/netrom.h   |    8 ++++----
 net/netrom/af_netrom.c |   15 ++++++++++-----
 2 files changed, 14 insertions(+), 9 deletions(-)

Index: linux-net.git/include/net/netrom.h
===================================================================
--- linux-net.git.orig/include/net/netrom.h	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/include/net/netrom.h	2006-04-29 11:37:27.000000000 +0100
@@ -42,11 +42,11 @@ enum {
 #define	NR_COND_PEER_RX_BUSY		0x04
 #define	NR_COND_OWN_RX_BUSY		0x08
 
-#define NR_DEFAULT_T1			(120 * HZ)	/* Outstanding frames - 120 seconds */
-#define NR_DEFAULT_T2			(5   * HZ)	/* Response delay     - 5 seconds */
+#define NR_DEFAULT_T1			120000		/* Outstanding frames - 120 seconds */
+#define NR_DEFAULT_T2			5000		/* Response delay     - 5 seconds */
 #define NR_DEFAULT_N2			3		/* Number of Retries - 3 */
-#define	NR_DEFAULT_T4			(180 * HZ)	/* Busy Delay - 180 seconds */
-#define	NR_DEFAULT_IDLE			(0 * 60 * HZ)	/* No Activity Timeout - none */
+#define	NR_DEFAULT_T4			180000		/* Busy Delay - 180 seconds */
+#define	NR_DEFAULT_IDLE			0		/* No Activity Timeout - none */
 #define	NR_DEFAULT_WINDOW		4		/* Default Window Size - 4 */
 #define	NR_DEFAULT_OBS			6		/* Default Obsolescence Count - 6 */
 #define	NR_DEFAULT_QUAL			10		/* Default Neighbour Quality - 10 */
Index: linux-net.git/net/netrom/af_netrom.c
===================================================================
--- linux-net.git.orig/net/netrom/af_netrom.c	2006-04-29 01:54:21.000000000 +0100
+++ linux-net.git/net/netrom/af_netrom.c	2006-04-29 11:37:27.000000000 +0100
@@ -425,11 +425,16 @@ static int nr_create(struct socket *sock
 
 	nr_init_timers(sk);
 
-	nr->t1     = sysctl_netrom_transport_timeout;
-	nr->t2     = sysctl_netrom_transport_acknowledge_delay;
-	nr->n2     = sysctl_netrom_transport_maximum_tries;
-	nr->t4     = sysctl_netrom_transport_busy_delay;
-	nr->idle   = sysctl_netrom_transport_no_activity_timeout;
+	nr->t1     =
+		msecs_to_jiffies(sysctl_netrom_transport_timeout);
+	nr->t2     =
+		msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay);
+	nr->n2     =
+		msecs_to_jiffies(sysctl_netrom_transport_maximum_tries);
+	nr->t4     =
+		msecs_to_jiffies(sysctl_netrom_transport_busy_delay);
+	nr->idle   =
+		msecs_to_jiffies(sysctl_netrom_transport_no_activity_timeout);
 	nr->window = sysctl_netrom_transport_requested_window_size;
 
 	nr->bpqext = 1;

^ permalink raw reply

* [PATCH 3/3] Eleminate HZ from ROSE kernel interfaces
From: Ralf Baechle @ 2006-04-29 14:19 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

Convert all ROSE sysctl time values from jiffies to ms as units.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

--

 include/net/rose.h   |   14 +++++++-------
 net/rose/af_rose.c   |   10 +++++-----
 net/rose/rose_link.c |    6 ++++--
 3 files changed, 16 insertions(+), 14 deletions(-)

Index: linux-net.git/include/net/rose.h
===================================================================
--- linux-net.git.orig/include/net/rose.h	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/include/net/rose.h	2006-04-29 11:37:34.000000000 +0100
@@ -49,14 +49,14 @@ enum {
 	ROSE_STATE_5			/* Deferred Call Acceptance */
 };
 
-#define ROSE_DEFAULT_T0			(180 * HZ)	/* Default T10 T20 value */
-#define ROSE_DEFAULT_T1			(200 * HZ)	/* Default T11 T21 value */
-#define ROSE_DEFAULT_T2			(180 * HZ)	/* Default T12 T22 value */
-#define	ROSE_DEFAULT_T3			(180 * HZ)	/* Default T13 T23 value */
-#define	ROSE_DEFAULT_HB			(5 * HZ)	/* Default Holdback value */
-#define	ROSE_DEFAULT_IDLE		(0 * 60 * HZ)	/* No Activity Timeout - none */
+#define ROSE_DEFAULT_T0			180000		/* Default T10 T20 value */
+#define ROSE_DEFAULT_T1			200000		/* Default T11 T21 value */
+#define ROSE_DEFAULT_T2			180000		/* Default T12 T22 value */
+#define	ROSE_DEFAULT_T3			180000		/* Default T13 T23 value */
+#define	ROSE_DEFAULT_HB			5000		/* Default Holdback value */
+#define	ROSE_DEFAULT_IDLE		0		/* No Activity Timeout - none */
 #define	ROSE_DEFAULT_ROUTING		1		/* Default routing flag */
-#define	ROSE_DEFAULT_FAIL_TIMEOUT	(120 * HZ)	/* Time until link considered usable */
+#define	ROSE_DEFAULT_FAIL_TIMEOUT	120000		/* Time until link considered usable */
 #define	ROSE_DEFAULT_MAXVC		50		/* Maximum number of VCs per neighbour */
 #define	ROSE_DEFAULT_WINDOW_SIZE	7		/* Default window size */
 
Index: linux-net.git/net/rose/af_rose.c
===================================================================
--- linux-net.git.orig/net/rose/af_rose.c	2006-04-29 01:54:21.000000000 +0100
+++ linux-net.git/net/rose/af_rose.c	2006-04-29 11:37:34.000000000 +0100
@@ -518,11 +518,11 @@ static int rose_create(struct socket *so
 	init_timer(&rose->timer);
 	init_timer(&rose->idletimer);
 
-	rose->t1   = sysctl_rose_call_request_timeout;
-	rose->t2   = sysctl_rose_reset_request_timeout;
-	rose->t3   = sysctl_rose_clear_request_timeout;
-	rose->hb   = sysctl_rose_ack_hold_back_timeout;
-	rose->idle = sysctl_rose_no_activity_timeout;
+	rose->t1   = msecs_to_jiffies(sysctl_rose_call_request_timeout);
+	rose->t2   = msecs_to_jiffies(sysctl_rose_reset_request_timeout);
+	rose->t3   = msecs_to_jiffies(sysctl_rose_clear_request_timeout);
+	rose->hb   = msecs_to_jiffies(sysctl_rose_ack_hold_back_timeout);
+	rose->idle = msecs_to_jiffies(sysctl_rose_no_activity_timeout);
 
 	rose->state = ROSE_STATE_0;
 
Index: linux-net.git/net/rose/rose_link.c
===================================================================
--- linux-net.git.orig/net/rose/rose_link.c	2006-04-29 01:43:47.000000000 +0100
+++ linux-net.git/net/rose/rose_link.c	2006-04-29 11:37:34.000000000 +0100
@@ -40,7 +40,8 @@ void rose_start_ftimer(struct rose_neigh
 
 	neigh->ftimer.data     = (unsigned long)neigh;
 	neigh->ftimer.function = &rose_ftimer_expiry;
-	neigh->ftimer.expires  = jiffies + sysctl_rose_link_fail_timeout;
+	neigh->ftimer.expires  =
+		jiffies + msecs_to_jiffies(sysctl_rose_link_fail_timeout);
 
 	add_timer(&neigh->ftimer);
 }
@@ -51,7 +52,8 @@ static void rose_start_t0timer(struct ro
 
 	neigh->t0timer.data     = (unsigned long)neigh;
 	neigh->t0timer.function = &rose_t0timer_expiry;
-	neigh->t0timer.expires  = jiffies + sysctl_rose_restart_request_timeout;
+	neigh->t0timer.expires  =
+		jiffies + msecs_to_jiffies(sysctl_rose_restart_request_timeout);
 
 	add_timer(&neigh->t0timer);
 }

^ permalink raw reply

* [PATCH 1/3] Eleminate HZ from AX.25 kernel interfaces
From: Ralf Baechle DL5RB @ 2006-04-29 14:12 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-hams

Convert all AX.25 sysctl time values from jiffies to ms as units.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

--

 include/net/ax25.h         |   10 +++---
 net/ax25/af_ax25.c         |   73 +++++++++++++++++++++++++--------------------
 net/ax25/ax25_ds_timer.c   |    3 +
 net/ax25/sysctl_net_ax25.c |   10 +++---
 4 files changed, 53 insertions(+), 43 deletions(-)

Index: linux-net.git/include/net/ax25.h
===================================================================
--- linux-net.git.orig/include/net/ax25.h	2006-04-29 11:32:14.000000000 +0100
+++ linux-net.git/include/net/ax25.h	2006-04-29 11:33:43.000000000 +0100
@@ -145,14 +145,14 @@ enum {
 #define	AX25_DEF_CONMODE	2			/* Connected mode allowed */
 #define	AX25_DEF_WINDOW		2			/* Window=2 */
 #define	AX25_DEF_EWINDOW	32			/* Module-128 Window=32 */
-#define	AX25_DEF_T1		(10 * HZ)		/* T1=10s */
-#define	AX25_DEF_T2		(3 * HZ)		/* T2=3s  */
-#define	AX25_DEF_T3		(300 * HZ)		/* T3=300s */
+#define	AX25_DEF_T1		10000			/* T1=10s */
+#define	AX25_DEF_T2		3000			/* T2=3s  */
+#define	AX25_DEF_T3		300000			/* T3=300s */
 #define	AX25_DEF_N2		10			/* N2=10 */
-#define AX25_DEF_IDLE		(0 * 60 * HZ)		/* Idle=None */
+#define AX25_DEF_IDLE		0			/* Idle=None */
 #define AX25_DEF_PACLEN		256			/* Paclen=256 */
 #define	AX25_DEF_PROTOCOL	AX25_PROTO_STD_SIMPLEX	/* Standard AX.25 */
-#define AX25_DEF_DS_TIMEOUT	(3 * 60 * HZ)		/* DAMA timeout 3 minutes */
+#define AX25_DEF_DS_TIMEOUT	180000			/* DAMA timeout 3 minutes */
 
 typedef struct ax25_uid_assoc {
 	struct hlist_node	uid_node;
Index: linux-net.git/net/ax25/af_ax25.c
===================================================================
--- linux-net.git.orig/net/ax25/af_ax25.c	2006-04-29 11:32:14.000000000 +0100
+++ linux-net.git/net/ax25/af_ax25.c	2006-04-29 11:33:43.000000000 +0100
@@ -426,6 +426,26 @@ static int ax25_ctl_ioctl(const unsigned
 	return 0;
 }
 
+static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
+{
+	ax25->rtt     = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]) / 2;
+	ax25->t1      = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]);
+	ax25->t2      = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T2]);
+	ax25->t3      = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T3]);
+	ax25->n2      = ax25_dev->values[AX25_VALUES_N2];
+	ax25->paclen  = ax25_dev->values[AX25_VALUES_PACLEN];
+	ax25->idle    = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_IDLE]);
+	ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF];
+
+	if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) {
+		ax25->modulus = AX25_EMODULUS;
+		ax25->window  = ax25_dev->values[AX25_VALUES_EWINDOW];
+	} else {
+		ax25->modulus = AX25_MODULUS;
+		ax25->window  = ax25_dev->values[AX25_VALUES_WINDOW];
+	}
+}
+
 /*
  *	Fill in a created AX.25 created control block with the default
  *	values for a particular device.
@@ -435,39 +455,28 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_
 	ax25->ax25_dev = ax25_dev;
 
 	if (ax25->ax25_dev != NULL) {
-		ax25->rtt     = ax25_dev->values[AX25_VALUES_T1] / 2;
-		ax25->t1      = ax25_dev->values[AX25_VALUES_T1];
-		ax25->t2      = ax25_dev->values[AX25_VALUES_T2];
-		ax25->t3      = ax25_dev->values[AX25_VALUES_T3];
-		ax25->n2      = ax25_dev->values[AX25_VALUES_N2];
-		ax25->paclen  = ax25_dev->values[AX25_VALUES_PACLEN];
-		ax25->idle    = ax25_dev->values[AX25_VALUES_IDLE];
-		ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF];
-
-		if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) {
-			ax25->modulus = AX25_EMODULUS;
-			ax25->window  = ax25_dev->values[AX25_VALUES_EWINDOW];
-		} else {
-			ax25->modulus = AX25_MODULUS;
-			ax25->window  = ax25_dev->values[AX25_VALUES_WINDOW];
-		}
+		ax25_fillin_cb_from_dev(ax25, ax25_dev);
+		return;
+	}
+
+	/*
+	 * No device, use kernel / AX.25 spec default values
+	 */
+	ax25->rtt     = msecs_to_jiffies(AX25_DEF_T1) / 2;
+	ax25->t1      = msecs_to_jiffies(AX25_DEF_T1);
+	ax25->t2      = msecs_to_jiffies(AX25_DEF_T2);
+	ax25->t3      = msecs_to_jiffies(AX25_DEF_T3);
+	ax25->n2      = AX25_DEF_N2;
+	ax25->paclen  = AX25_DEF_PACLEN;
+	ax25->idle    = msecs_to_jiffies(AX25_DEF_IDLE);
+	ax25->backoff = AX25_DEF_BACKOFF;
+
+	if (AX25_DEF_AXDEFMODE) {
+		ax25->modulus = AX25_EMODULUS;
+		ax25->window  = AX25_DEF_EWINDOW;
 	} else {
-		ax25->rtt     = AX25_DEF_T1 / 2;
-		ax25->t1      = AX25_DEF_T1;
-		ax25->t2      = AX25_DEF_T2;
-		ax25->t3      = AX25_DEF_T3;
-		ax25->n2      = AX25_DEF_N2;
-		ax25->paclen  = AX25_DEF_PACLEN;
-		ax25->idle    = AX25_DEF_IDLE;
-		ax25->backoff = AX25_DEF_BACKOFF;
-
-		if (AX25_DEF_AXDEFMODE) {
-			ax25->modulus = AX25_EMODULUS;
-			ax25->window  = AX25_DEF_EWINDOW;
-		} else {
-			ax25->modulus = AX25_MODULUS;
-			ax25->window  = AX25_DEF_WINDOW;
-		}
+		ax25->modulus = AX25_MODULUS;
+		ax25->window  = AX25_DEF_WINDOW;
 	}
 }
 
Index: linux-net.git/net/ax25/ax25_ds_timer.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_ds_timer.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_ds_timer.c	2006-04-29 11:33:43.000000000 +0100
@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_de
 		return;
 
 	del_timer(&ax25_dev->dama.slave_timer);
-	ax25_dev->dama.slave_timeout = ax25_dev->values[AX25_VALUES_DS_TIMEOUT] / 10;
+	ax25_dev->dama.slave_timeout =
+		msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
 	ax25_ds_add_timer(ax25_dev);
 }
 
Index: linux-net.git/net/ax25/sysctl_net_ax25.c
===================================================================
--- linux-net.git.orig/net/ax25/sysctl_net_ax25.c	2006-04-29 01:54:20.000000000 +0100
+++ linux-net.git/net/ax25/sysctl_net_ax25.c	2006-04-29 11:35:27.000000000 +0100
@@ -18,14 +18,14 @@ static int min_backoff[1],		max_backoff[
 static int min_conmode[1],		max_conmode[] = {2};
 static int min_window[] = {1},		max_window[] = {7};
 static int min_ewindow[] = {1},		max_ewindow[] = {63};
-static int min_t1[] = {1},		max_t1[] = {30 * HZ};
-static int min_t2[] = {1},		max_t2[] = {20 * HZ};
-static int min_t3[1],   		max_t3[] = {3600 * HZ};
-static int min_idle[1],  		max_idle[] = {65535 * HZ};
+static int min_t1[] = {1},		max_t1[] = {30000};
+static int min_t2[] = {1},		max_t2[] = {20000};
+static int min_t3[1],			max_t3[] = {3600000};
+static int min_idle[1],			max_idle[] = {65535000};
 static int min_n2[] = {1},		max_n2[] = {31};
 static int min_paclen[] = {1},		max_paclen[] = {512};
 static int min_proto[1],		max_proto[] = { AX25_PROTO_MAX };
-static int min_ds_timeout[1],   	max_ds_timeout[] = {65535 * HZ};
+static int min_ds_timeout[1],		max_ds_timeout[] = {65535000};
 
 static struct ctl_table_header *ax25_table_header;
 

^ permalink raw reply

* [AX.25] Move AX.25 symbol exports
From: Ralf Baechle @ 2006-04-29 13:40 UTC (permalink / raw)
  To: David S. Miller, netdev; +Cc: linux-hams

Move AX.25 symbol exports to next to their definitions where they're
supposed to be these days.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 net/ax25/af_ax25.c    |   20 ++------------------
 net/ax25/ax25_addr.c  |    9 +++++++++
 net/ax25/ax25_iface.c |   13 +++++++++++++
 net/ax25/ax25_ip.c    |    3 +++
 net/ax25/ax25_out.c   |    3 +++
 net/ax25/ax25_timer.c |    3 +++
 net/ax25/ax25_uid.c   |    4 ++++
 7 files changed, 37 insertions(+), 18 deletions(-)

Index: linux-net.git/net/ax25/af_ax25.c
===================================================================
--- linux-net.git.orig/net/ax25/af_ax25.c	2006-04-29 01:54:20.000000000 +0100
+++ linux-net.git/net/ax25/af_ax25.c	2006-04-29 11:30:24.000000000 +0100
@@ -228,6 +228,8 @@ ax25_cb *ax25_find_cb(ax25_address *src_
 	return NULL;
 }
 
+EXPORT_SYMBOL(ax25_find_cb);
+
 void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
 {
 	ax25_cb *s;
@@ -1979,24 +1981,6 @@ static struct notifier_block ax25_dev_no
 	.notifier_call =ax25_device_event,
 };
 
-EXPORT_SYMBOL(ax25_hard_header);
-EXPORT_SYMBOL(ax25_rebuild_header);
-EXPORT_SYMBOL(ax25_findbyuid);
-EXPORT_SYMBOL(ax25_find_cb);
-EXPORT_SYMBOL(ax25_linkfail_register);
-EXPORT_SYMBOL(ax25_linkfail_release);
-EXPORT_SYMBOL(ax25_listen_register);
-EXPORT_SYMBOL(ax25_listen_release);
-EXPORT_SYMBOL(ax25_protocol_register);
-EXPORT_SYMBOL(ax25_protocol_release);
-EXPORT_SYMBOL(ax25_send_frame);
-EXPORT_SYMBOL(ax25_uid_policy);
-EXPORT_SYMBOL(ax25cmp);
-EXPORT_SYMBOL(ax2asc);
-EXPORT_SYMBOL(asc2ax);
-EXPORT_SYMBOL(null_ax25_address);
-EXPORT_SYMBOL(ax25_display_timer);
-
 static int __init ax25_init(void)
 {
 	int rc = proto_register(&ax25_proto, 0);
Index: linux-net.git/net/ax25/ax25_addr.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_addr.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_addr.c	2006-04-29 11:30:24.000000000 +0100
@@ -11,6 +11,7 @@
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -33,6 +34,8 @@
  */
 ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}};
 
+EXPORT_SYMBOL(null_ax25_address);
+
 /*
  *	ax25 -> ascii conversion
  */
@@ -64,6 +67,8 @@ char *ax2asc(char *buf, ax25_address *a)
 
 }
 
+EXPORT_SYMBOL(ax2asc);
+
 /*
  *	ascii -> ax25 conversion
  */
@@ -97,6 +102,8 @@ void asc2ax(ax25_address *addr, char *ca
 	addr->ax25_call[6] &= 0x1E;
 }
 
+EXPORT_SYMBOL(asc2ax);
+
 /*
  *	Compare two ax.25 addresses
  */
@@ -116,6 +123,8 @@ int ax25cmp(ax25_address *a, ax25_addres
  	return 2;			/* Partial match */
 }
 
+EXPORT_SYMBOL(ax25cmp);
+
 /*
  *	Compare two AX.25 digipeater paths.
  */
Index: linux-net.git/net/ax25/ax25_iface.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_iface.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_iface.c	2006-04-29 11:30:24.000000000 +0100
@@ -12,6 +12,7 @@
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/timer.h>
@@ -74,6 +75,8 @@ int ax25_protocol_register(unsigned int 
 	return 1;
 }
 
+EXPORT_SYMBOL(ax25_protocol_register);
+
 void ax25_protocol_release(unsigned int pid)
 {
 	struct protocol_struct *s, *protocol;
@@ -106,6 +109,8 @@ void ax25_protocol_release(unsigned int 
 	write_unlock(&protocol_list_lock);
 }
 
+EXPORT_SYMBOL(ax25_protocol_release);
+
 int ax25_linkfail_register(void (*func)(ax25_cb *, int))
 {
 	struct linkfail_struct *linkfail;
@@ -123,6 +128,8 @@ int ax25_linkfail_register(void (*func)(
 	return 1;
 }
 
+EXPORT_SYMBOL(ax25_linkfail_register);
+
 void ax25_linkfail_release(void (*func)(ax25_cb *, int))
 {
 	struct linkfail_struct *s, *linkfail;
@@ -155,6 +162,8 @@ void ax25_linkfail_release(void (*func)(
 	spin_unlock_bh(&linkfail_lock);
 }
 
+EXPORT_SYMBOL(ax25_linkfail_release);
+
 int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
 {
 	struct listen_struct *listen;
@@ -176,6 +185,8 @@ int ax25_listen_register(ax25_address *c
 	return 1;
 }
 
+EXPORT_SYMBOL(ax25_listen_register);
+
 void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
 {
 	struct listen_struct *s, *listen;
@@ -208,6 +219,8 @@ void ax25_listen_release(ax25_address *c
 	spin_unlock_bh(&listen_lock);
 }
 
+EXPORT_SYMBOL(ax25_listen_release);
+
 int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *)
 {
 	int (*res)(struct sk_buff *, ax25_cb *) = NULL;
Index: linux-net.git/net/ax25/ax25_ip.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_ip.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_ip.c	2006-04-29 11:30:24.000000000 +0100
@@ -12,6 +12,7 @@
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -221,3 +222,5 @@ int ax25_rebuild_header(struct sk_buff *
 
 #endif
 
+EXPORT_SYMBOL(ax25_hard_header);
+EXPORT_SYMBOL(ax25_rebuild_header);
Index: linux-net.git/net/ax25/ax25_out.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_out.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_out.c	2006-04-29 11:30:24.000000000 +0100
@@ -14,6 +14,7 @@
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -104,6 +105,8 @@ ax25_cb *ax25_send_frame(struct sk_buff 
 	return ax25;			/* We had to create it */
 }
 
+EXPORT_SYMBOL(ax25_send_frame);
+
 /*
  *	All outgoing AX.25 I frames pass via this routine. Therefore this is
  *	where the fragmentation of frames takes place. If fragment is set to
Index: linux-net.git/net/ax25/ax25_timer.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_timer.c	2006-04-29 01:43:48.000000000 +0100
+++ linux-net.git/net/ax25/ax25_timer.c	2006-04-29 11:30:24.000000000 +0100
@@ -18,6 +18,7 @@
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -137,6 +138,8 @@ unsigned long ax25_display_timer(struct 
 	return timer->expires - jiffies;
 }
 
+EXPORT_SYMBOL(ax25_display_timer);
+
 static void ax25_heartbeat_expiry(unsigned long param)
 {
 	int proto = AX25_PROTO_STD_SIMPLEX;
Index: linux-net.git/net/ax25/ax25_uid.c
===================================================================
--- linux-net.git.orig/net/ax25/ax25_uid.c	2006-04-29 01:54:20.000000000 +0100
+++ linux-net.git/net/ax25/ax25_uid.c	2006-04-29 11:30:24.000000000 +0100
@@ -49,6 +49,8 @@ static DEFINE_RWLOCK(ax25_uid_lock);
 
 int ax25_uid_policy = 0;
 
+EXPORT_SYMBOL(ax25_uid_policy);
+
 ax25_uid_assoc *ax25_findbyuid(uid_t uid)
 {
 	ax25_uid_assoc *ax25_uid, *res = NULL;
@@ -67,6 +69,8 @@ ax25_uid_assoc *ax25_findbyuid(uid_t uid
 	return res;
 }
 
+EXPORT_SYMBOL(ax25_findbyuid);
+
 int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
 {
 	ax25_uid_assoc *ax25_uid;

^ permalink raw reply

* [ROSE] Fix routing table locking in rose_remove_neigh.
From: Ralf Baechle @ 2006-04-29 13:31 UTC (permalink / raw)
  To: David S. Miller, netdev, Bernard Pidoux, linux-hams

The locking rule for rose_remove_neigh() are that the called needs to
hold rose_neigh_list_lock, so we better don't take it yet again in
rose_neigh_list_lock.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 net/rose/rose_route.c |    5 -----
 1 file changed, 5 deletions(-)

Index: linux-net.git/net/rose/rose_route.c
===================================================================
--- linux-net.git.orig/net/rose/rose_route.c	2006-04-29 14:18:58.000000000 +0100
+++ linux-net.git/net/rose/rose_route.c	2006-04-29 14:19:02.000000000 +0100
@@ -233,11 +233,8 @@ static void rose_remove_neigh(struct ros
 
 	skb_queue_purge(&rose_neigh->queue);
 
-	spin_lock_bh(&rose_neigh_list_lock);
-
 	if ((s = rose_neigh_list) == rose_neigh) {
 		rose_neigh_list = rose_neigh->next;
-		spin_unlock_bh(&rose_neigh_list_lock);
 		kfree(rose_neigh->digipeat);
 		kfree(rose_neigh);
 		return;
@@ -246,7 +243,6 @@ static void rose_remove_neigh(struct ros
 	while (s != NULL && s->next != NULL) {
 		if (s->next == rose_neigh) {
 			s->next = rose_neigh->next;
-			spin_unlock_bh(&rose_neigh_list_lock);
 			kfree(rose_neigh->digipeat);
 			kfree(rose_neigh);
 			return;
@@ -254,7 +250,6 @@ static void rose_remove_neigh(struct ros
 
 		s = s->next;
 	}
-	spin_unlock_bh(&rose_neigh_list_lock);
 }
 
 /*

^ permalink raw reply

* Re: [PATCH 2/3] rt2x00 drivers: rt61pci
From: Ivo van Doorn @ 2006-04-29 19:35 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060429161002.GA3345@electric-eye.fr.zoreil.com>

[-- Attachment #1: Type: text/plain, Size: 1645 bytes --]

On Saturday 29 April 2006 18:10, Francois Romieu wrote:
> Ivo van Doorn <ivdoorn@gmail.com> :
> [...]
> > Not sure about that either. I usually choose the type of the counter
> > depending on the max size of that counter.
> 
> It is not arch-neutral. powerpc favors unsigned int over int but I am
> too lazy to check if the size matters.

Ok, I'll make sure the counters will made of the unsigned int type.

> [...]
> > Perhaps, but I prefer the usage of the name "counter".
> > I am not sure if there is a coding style about this? If so I could
> > rename "counter" to "i".
> 
> Chapter 4 of Documentation/CodingStyle goes in this direction.
> The document is not meant to be a taken too literally though.
> 
> The repetitive use of 'counter' + foo[counter].blah tends to be a
> bit bloaty.
> 
> [...]
> > I'll create a bugreport in the rt2x00 project bugzilla
> > with some of the coding style change requests.
> 
> I will not complain if you open a bugreport to provide a git repo
> as well.
> 
> /me hides...

The git repository has indeed been discussed between the
rt2x00 developers before. And at the moment we see no major
benefit from using git. We need to have something like CVS
for regular users to use rt2x00 and we don't want them to
use git only to use the drivers.
In the CVS tree we have multiple backwards compatibility
fixes for both rt2x00 as the dscape stack to make it work
on kernel 2.6.13 and above. So making a git repository
would mean a lot duplicate work, since we have to keep
2 trees up to date, as well as making sure the wireless-dev
tree contains an up to date version.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: IP1000 gigabit nic driver
From: Pekka Enberg @ 2006-04-29 20:35 UTC (permalink / raw)
  To: David Gómez; +Cc: David Vrabel, Francois Romieu, Linux-kernel, netdev
In-Reply-To: <20060429122119.GA22160@fargo>

Hi David,

On Sat, 2006-04-29 at 14:21 +0200, David Gómez wrote:
> I already had it modified, just needed to create the patch... Anyway,
> have you submitted it to netdev?

No, I haven't. I don't have the hardware, so I can't test the driver.
Furthermore, there's plenty of stuff to fix before it's in any shape for
submission. If someone wants to give this patch a spin, I would love to
hear the results.

					Pekka


^ permalink raw reply

* Re: e1000_down and tx_timeout worker race cleaning the transmit buffers
From: Shaw Vrana @ 2006-04-29 21:57 UTC (permalink / raw)
  To: Auke Kok
  Cc: Andy Gospodarek, Michael Chan, Herbert Xu, netdev, auke-jan.h.kok,
	davem, jgarzik
In-Reply-To: <44504EA7.5050901@foo-projects.org>

Hi Auke,

On 4/26/06, Auke Kok <sofar@foo-projects.org> wrote:

> > I'm concerned about the addition of the netif_running check to
> > e1000_down.  While something like this is needed, I'm not familiar
> > enough w/ the code to know if this is okay.
> > All explanations and comments are greatly appreciated.
> While I appreciate patches ;^) I think we're on a better path by making these
> cleanups, and actually reducing the code in large places. I hope to be able to
> push something out for RFC soon. Added benefit will be that we're dropping a
> whole bunch of irq operations where we didn't need to (soft resets).

Well, it looks like my patch won't work as the e1000_close is called
by dev.c only after it clears the __LINK_STATE_START bit, which means
that e1000_down will exit prematurely when called from e1000_close in
my approach.  Any feedback on the approach would be appreciated, as
your upcoming patch sounds like it might be too aggressive to get put
into a stabilization patch.  ;)

I understand the need to fix the problems associated with the
watchdog_task as well, though I wonder if it wouldn't be better to
remove it altogether given the complexity of cleaning up after these
tasks in general.  I've personally had more problems with the watchdog
task than with the possible sleep in the watchdog timer code.  I can't
help but siding with the RedHat folks who currently ship a version of
the e1000 driver that fixes the mechanism used to sleep instead of the
watchdog_task approach.  Perhaps I missed the discussion of this, I'm
only finding the patch itself with google.

Thanks,
Shaw

^ permalink raw reply

* Re: [ROSE] Fix routing table locking in rose_remove_neigh.
From: Bernard Pidoux @ 2006-04-29 22:59 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: David S. Miller, netdev, linux-hams
In-Reply-To: <20060429133141.GA31820@linux-mips.org>



Ralf Baechle wrote:
> The locking rule for rose_remove_neigh() are that the called needs to
> hold rose_neigh_list_lock, so we better don't take it yet again in
> rose_neigh_list_lock.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

All ROSE and HZ patches applied to kernel 2.6.16
Many thanks Ralf.

73 de Bernard, f6bvp

http://f6bvp.org
http://rose.fpac.free.fr/MINI-HOWTO/
http://rose.fpac.free.fr/MINI-HOWTO-FR/


^ permalink raw reply

* Re: [PATCH 1/6] tg3: Call netif_carrier_off() during phy reset
From: David S. Miller @ 2006-04-30  1:55 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267307.4780.14.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:35:06 -0700

> Add netif_carrier_off() call during tg3_phy_reset(). This is needed
> to properly track the netif_carrier state in cases where we do a
> PHY reset with interrupts disabled. The SerDes code will not run
> properly if the netif_carrier state is wrong.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 2/6] tg3: Add phy workaround
From: David S. Miller @ 2006-04-30  1:57 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267319.4780.15.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:35:19 -0700

> Add some PHY workaround code to reduce jitter on some PHYs.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied, thanks.

It really bugs me that all of this indirect addressing into
the DSP is done with magic addresses and register values.  It
would be great to get some defined in tg3.h that documented
the DSP register set properly.

^ permalink raw reply

* Re: [PATCH 3/6] tg3: Reset chip when changing MAC address
From: David S. Miller @ 2006-04-30  1:58 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267335.4780.16.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:35:35 -0700

> Do the full chip reset when changing MAC address if ASF is enabled.
> 
> ASF sometimes uses a different MAC address than the driver. Without
> the reset, the ASF MAC address may be overwritten when the driver's
> MAC address is changed.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

A little heavy handed, but I can't think of another way to
deal with this.

Applied, thanks a lot.

^ permalink raw reply

* Re: [PATCH 4/6] tg3: Add reset_phy parameter to chip reset functions
From: David S. Miller @ 2006-04-30  1:59 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267368.4780.17.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:36:08 -0700

> Add a reset_phy parameter to tg3_reset_hw() and tg3_init_hw(). With
> the full chip reset during MAC address change, the automatic PHY reset
> during chip reset will cause a link down and bonding will not work
> properly as a result. With this reset_phy parameter, we can do a chip
> reset without link down when changing MAC address or MTU.
> 
> Signed-off-by: Gary Zambrano <zambrano@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied.

Doesn't the signalling interface between the MAC and the
PHY get reset during a chip reset and couldn't that cause
problems if we bypass the PHY reset?

Thanks.

^ permalink raw reply

* Re: [PATCH 5/6] tg3: Fix bug in nvram write
From: David S. Miller @ 2006-04-30  2:00 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267381.4780.18.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:36:21 -0700

> Fix bug in nvram write function. If the starting nvram address offset
> happens to be the last dword of the page, the NVRAM_CMD_LAST bit will
> not get set in the existing code. This patch fixes the bug by changing
> the "else if" to "if" so that the last dword condition always gets
> checked.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Good catch, applied.

Thanks.

^ permalink raw reply

* Re: [PATCH 6/6] tg3: Update version and reldate
From: David S. Miller @ 2006-04-30  2:01 UTC (permalink / raw)
  To: mchan; +Cc: netdev
In-Reply-To: <1146267390.4780.19.camel@rh4>

From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Apr 2006 16:36:30 -0700

> Update version to 3.57.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied.

^ permalink raw reply

* tw32_f() in tg3_write_mem()
From: David S. Miller @ 2006-04-30  2:22 UTC (permalink / raw)
  To: mchan; +Cc: netdev


At least for the TG3PCI_MEM_WIN_DATA register, I don't know how safe
it is to use tw32_f() there.  Reads from a location can have side
effects, so doing a forced readback after a write could be dangerous.

And it isn't needed, as the tw32_f() done as we set the
TG3PCI_MEM_WIN_BASE_ADDR back to zero will flush all posted
writes.

Agreed?

^ permalink raw reply

* [PATCH] Interface Stat Clearing Framework, skge support, ethtool support
From: Phil Dibowitz @ 2006-04-30  3:16 UTC (permalink / raw)
  To: netdev


[-- Attachment #1.1: Type: text/plain, Size: 1305 bytes --]

Hey folks,

A few months back I posted an in-progress patch for adding a clear_stats
framework similar to the get_stats framework and implimenting support
for it in the skge driver (the one NIC I have access to), as well as
adding the ethtool support for it.

While a few people said they didn't see the need for it, other people
did see the need for it, and I know it's a common request on many
sysadmin mailing lists I'm on.

Since no one seemed to have any technical issue with the patch, I've
cleaned up the patch, tested it, and fixed a few minor issues.

Unless someone has an objection, I'd think this would be useful to a lot
of people.

There are two patches attached:

interface_stats_clear.patch - the kernel patch against 2.6.17-rc3-git2
ethtool3-clearstats.patch - the ethtool patch to add the -z flag to
		support it.

If the kernel patch gets accepted I'll send a more complete ethtool
patch with documentation updates, etc.

Thanks.
-- 
Phil Dibowitz                             phil@ipom.com
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Be who you are and say what you feel, because those who mind don't
matter and those who matter don't mind."
 - Dr. Suess



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: interface_stats_clear.patch --]
[-- Type: text/x-patch; name="interface_stats_clear.patch", Size: 6417 bytes --]



This patch adds support for clearing interface statistics using the ethtool interface adding a new 0x23 command. It adds a clear_stats function pointer to the net_device struct, and then impliments local functions in the driver much the say get_stats works. The ethtool funtion pointer points to the same functions. The driver-local functions are currently only implimented in the skge driver.

Signed-off-by: Phil Dibowitz <phil@ipom.com>

---


diff -puN include/linux/netdevice.h~interface_stats_clear include/linux/netdevice.h
--- linux-2.6.17-rc3-git2/include/linux/netdevice.h~interface_stats_clear	2006-04-29 19:44:41.000000000 -0700
+++ linux-2.6.17-rc3-git2-phil/include/linux/netdevice.h	2006-04-29 19:44:41.000000000 -0700
@@ -319,6 +319,7 @@ struct net_device
 
 
 	struct net_device_stats* (*get_stats)(struct net_device *dev);
+	void (*clear_stats)(struct net_device *dev);
 	struct iw_statistics*	(*get_wireless_stats)(struct net_device *dev);
 
 	/* List of functions to handle Wireless Extensions (instead of ioctl).
diff -puN drivers/net/skge.c~interface_stats_clear drivers/net/skge.c
--- linux-2.6.17-rc3-git2/drivers/net/skge.c~interface_stats_clear	2006-04-29 19:44:41.000000000 -0700
+++ linux-2.6.17-rc3-git2-phil/drivers/net/skge.c	2006-04-29 19:44:41.000000000 -0700
@@ -44,7 +44,7 @@
 #include "skge.h"
 
 #define DRV_NAME		"skge"
-#define DRV_VERSION		"1.5"
+#define DRV_VERSION		"1.6"
 #define PFX			DRV_NAME " "
 
 #define DEFAULT_TX_RING_SIZE	128
@@ -97,6 +97,8 @@ static int xm_phy_write(struct skge_hw *
 static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val);
 static void genesis_get_stats(struct skge_port *skge, u64 *data);
 static void yukon_get_stats(struct skge_port *skge, u64 *data);
+static void genesis_clear_stats(struct skge_port *skge);
+static void yukon_clear_stats(struct skge_port *skge);
 static void yukon_init(struct skge_hw *hw, int port);
 static void genesis_mac_init(struct skge_hw *hw, int port);
 static void genesis_link_up(struct skge_port *skge);
@@ -366,6 +368,15 @@ static struct net_device_stats *skge_get
 	return &skge->net_stats;
 }
 
+static void skge_clear_stats(struct net_device *dev)
+{
+	struct skge_port *skge = netdev_priv(dev);
+	if (skge->hw->chip_id == CHIP_ID_GENESIS)
+		genesis_clear_stats(skge);
+	else
+		yukon_clear_stats(skge);
+}
+
 static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	int i;
@@ -722,6 +733,7 @@ static struct ethtool_ops skge_ethtool_o
 	.phys_id	= skge_phys_id,
 	.get_stats_count = skge_get_stats_count,
 	.get_ethtool_stats = skge_get_ethtool_stats,
+	.clear_ethtool_stats = skge_clear_stats,
 	.get_perm_addr	= ethtool_op_get_perm_addr,
 };
 
@@ -1383,6 +1395,20 @@ static void genesis_get_stats(struct skg
 		data[i] = xm_read32(hw, port, skge_stats[i].xmac_offset);
 }
 
+static void genesis_clear_stats(struct skge_port *skge)
+{
+	struct skge_hw *hw = skge->hw;
+	int port = skge->port;
+
+	/*
+	 * This is based on reading other parts of the driver
+	 * and is not yet tested.
+	 */
+
+	xm_write16(hw, port, XM_STAT_CMD, 0 | XM_SC_CLR_RXC
+			| XM_SC_CLR_TXC);
+}
+
 static void genesis_mac_intr(struct skge_hw *hw, int port)
 {
 	struct skge_port *skge = netdev_priv(hw->dev[port]);
@@ -1871,6 +1897,21 @@ static void yukon_get_stats(struct skge_
 					  skge_stats[i].gma_offset);
 }
 
+static void yukon_clear_stats(struct skge_port *skge)
+{
+	struct skge_hw *hw = skge->hw;
+	int port = skge->port;
+	u16 reg;
+	int i;
+
+	reg = gma_read16(hw, port, GM_PHY_ADDR);
+	/* this read is important, or we sometimes get no effect */
+	gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
+	for (i = 0; i < GM_MIB_CNT_SIZE; i++)
+		gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i);
+	gma_write16(hw, port, GM_PHY_ADDR, reg);
+}
+
 static void yukon_mac_intr(struct skge_hw *hw, int port)
 {
 	struct net_device *dev = hw->dev[port];
@@ -3183,6 +3224,7 @@ static struct net_device *skge_devinit(s
 	dev->do_ioctl = skge_ioctl;
 	dev->hard_start_xmit = skge_xmit_frame;
 	dev->get_stats = skge_get_stats;
+	dev->clear_stats = skge_clear_stats;
 	if (hw->chip_id == CHIP_ID_GENESIS)
 		dev->set_multicast_list = genesis_set_multicast;
 	else
diff -puN include/linux/ethtool.h~interface_stats_clear include/linux/ethtool.h
--- linux-2.6.17-rc3-git2/include/linux/ethtool.h~interface_stats_clear	2006-04-29 19:44:41.000000000 -0700
+++ linux-2.6.17-rc3-git2-phil/include/linux/ethtool.h	2006-04-29 19:44:41.000000000 -0700
@@ -365,6 +365,7 @@ struct ethtool_ops {
 	int	(*phys_id)(struct net_device *, u32);
 	int	(*get_stats_count)(struct net_device *);
 	void	(*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
+	void    (*clear_ethtool_stats)(struct net_device *);
 	int	(*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
 	int	(*begin)(struct net_device *);
 	void	(*complete)(struct net_device *);
@@ -408,6 +409,7 @@ struct ethtool_ops {
 #define ETHTOOL_GPERMADDR	0x00000020 /* Get permanent hardware address */
 #define ETHTOOL_GUFO		0x00000021 /* Get UFO enable (ethtool_value) */
 #define ETHTOOL_SUFO		0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_CSTATS		0x00000023 /* Clear NIC-specific statistics */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET
diff -puN net/core/ethtool.c~interface_stats_clear net/core/ethtool.c
--- linux-2.6.17-rc3-git2/net/core/ethtool.c~interface_stats_clear	2006-04-29 19:44:41.000000000 -0700
+++ linux-2.6.17-rc3-git2-phil/net/core/ethtool.c	2006-04-29 19:44:41.000000000 -0700
@@ -741,6 +741,17 @@ static int ethtool_get_stats(struct net_
 	return ret;
 }
 
+static int ethtool_clear_stats(struct net_device *dev, void __user *useraddr)
+{
+	struct ethtool_ops *ops = dev->ethtool_ops;
+	if (!ops->clear_ethtool_stats)
+		return -EOPNOTSUPP;
+
+	ops->clear_ethtool_stats(dev);
+
+	return 0;
+}
+
 static int ethtool_get_perm_addr(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_perm_addr epaddr;
@@ -906,6 +917,9 @@ int dev_ethtool(struct ifreq *ifr)
 	case ETHTOOL_SUFO:
 		rc = ethtool_set_ufo(dev, useraddr);
 		break;
+	case ETHTOOL_CSTATS:
+		rc = ethtool_clear_stats(dev, useraddr);
+		break;
 	default:
 		rc =  -EOPNOTSUPP;
 	}
_

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: ethtool3-clearstats.patch --]
[-- Type: text/x-patch; name="ethtool3-clearstats.patch", Size: 3683 bytes --]

--- ethtool-3/ethtool.c.b4phil	2006-04-29 19:01:18.000000000 -0700
+++ ethtool-3/ethtool.c	2006-04-29 19:01:36.000000000 -0700
@@ -66,6 +66,7 @@
 static int do_goffload(int fd, struct ifreq *ifr);
 static int do_soffload(int fd, struct ifreq *ifr);
 static int do_gstats(int fd, struct ifreq *ifr);
+static int do_cstats(int fd, struct ifreq *ifr);
 static int send_ioctl(int fd, struct ifreq *ifr);
 static int check_for_pre24_kernel();
 
@@ -242,6 +243,7 @@
 	MODE_GOFFLOAD,
 	MODE_SOFFLOAD,
 	MODE_GSTATS,
+	MODE_CSTATS,
 } mode = MODE_GSET;
 
 static int goffload_changed = 0;
@@ -470,6 +472,8 @@
 				mode = MODE_TEST;
 			else if (!strcmp(argp[i], "-S"))
 				mode = MODE_GSTATS;
+			else if (!strcmp(argp[i], "-z"))
+				mode = MODE_CSTATS;
 			else if (!strcmp(argp[i], "-h"))
 				show_usage(0);
 			else
@@ -492,6 +496,7 @@
 			    (mode == MODE_GOFFLOAD) ||
 			    (mode == MODE_SOFFLOAD) ||
 			    (mode == MODE_GSTATS) ||
+			    (mode == MODE_CSTATS) ||
 			    (mode == MODE_PHYS_ID)) {
 				devname = argp[i];
 				break;
@@ -1266,6 +1271,8 @@
 		return do_soffload(fd, &ifr);
 	} else if (mode == MODE_GSTATS) {
 		return do_gstats(fd, &ifr);
+	} else if (mode == MODE_CSTATS) {
+		return do_cstats(fd, &ifr);
 	}
 
 	return 69;
@@ -2010,6 +2017,79 @@
 	return 0;
 }
 
+static int do_cstats(int fd, struct ifreq *ifr)
+{
+	struct ethtool_drvinfo drvinfo;
+	struct ethtool_gstrings *strings;
+	struct ethtool_stats *stats;
+	unsigned int n_stats, sz_str, sz_stats, i;
+	int err;
+
+	drvinfo.cmd = ETHTOOL_GDRVINFO;
+	ifr->ifr_data = (caddr_t)&drvinfo;
+	err = send_ioctl(fd, ifr);
+	if (err < 0) {
+		perror("Cannot get driver information");
+		return 71;
+	}
+
+	n_stats = drvinfo.n_stats;
+	if (n_stats < 1) {
+		fprintf(stderr, "no stats available\n");
+		return 94;
+	}
+
+	sz_str = n_stats * ETH_GSTRING_LEN;
+	sz_stats = n_stats * sizeof(u64);
+
+	strings = calloc(1, sz_str + sizeof(struct ethtool_gstrings));
+	stats = calloc(1, sz_stats + sizeof(struct ethtool_stats));
+	if (!strings || !stats) {
+		fprintf(stderr, "no memory available\n");
+		return 95;
+	}
+
+	strings->cmd = ETHTOOL_GSTRINGS;
+	strings->string_set = ETH_SS_STATS;
+	strings->len = n_stats;
+	ifr->ifr_data = (caddr_t) strings;
+	err = send_ioctl(fd, ifr);
+	if (err < 0) {
+		perror("Cannot get stats strings information");
+		free(strings);
+		free(stats);
+		return 96;
+	}
+
+	stats->cmd = ETHTOOL_CSTATS;
+	stats->n_stats = n_stats;
+	ifr->ifr_data = (caddr_t) stats;
+	err = send_ioctl(fd, ifr);
+	if (err < 0) {
+		perror("Cannot get stats information");
+		free(strings);
+		free(stats);
+		return 97;
+	}
+
+	/* todo - pretty-print the strings per-driver */
+	/*
+	fprintf(stdout, "NIC statistics:\n");
+	for (i = 0; i < n_stats; i++) {
+		char s[ETH_GSTRING_LEN];
+
+		strncpy(s, &strings->data[i * ETH_GSTRING_LEN],
+			ETH_GSTRING_LEN);
+		fprintf(stdout, "     %s: %llu\n",
+			s, stats->data[i]);
+	}
+	*/
+	free(strings);
+	free(stats);
+
+	return 0;
+}
+
 static int send_ioctl(int fd, struct ifreq *ifr)
 {
 	int err;
--- ethtool-3/ethtool-copy.h.b4phil	2006-04-29 19:01:26.000000000 -0700
+++ ethtool-3/ethtool-copy.h	2006-04-29 19:01:36.000000000 -0700
@@ -283,6 +283,7 @@
 #define ETHTOOL_GSTATS		0x0000001d /* get NIC-specific statistics */
 #define ETHTOOL_GTSO		0x0000001e /* Get TSO enable (ethtool_value) */
 #define ETHTOOL_STSO		0x0000001f /* Set TSO enable (ethtool_value) */
+#define ETHTOOL_CSTATS		0x00000023 /* get NIC-specific statistics */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply

* Re: Fw: Bug: PPP dropouts in >=2.6.16 - updates
From: Nuri Jawad @ 2006-04-30  4:31 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20060421010809.6c3cfc34.akpm@osdl.org>

Some more info:

- turning off Hyper Threading and using a uniprocessor kernel
   did not improve things
- so didn't using 2.6.17rc3, in fact the bug manifested after
   only 4 minutes with a 43 seconds gap
- those kernel debug watchdog routines don't detect anything

Going to try kernel PPPoE next time. Btw, at least with rp-pppoe 
it requires HDLC and that dependency isn't caught in menuconfig.

I would try to roll back some patches between 2.6.15.7 and 2.6.16 but
that changelog is pretty large. I'm sure there are good reasons for 
the current development model, but with the old unstable/stable
system and its few changes between stable versions, the right
one could've been spotted easily :/.

Regards, Nuri

^ permalink raw reply

* Re: determine outgoing interface (eth0,eth1) for a packet according to the dest IP
From: Lennert Buytenhek @ 2006-04-30  9:17 UTC (permalink / raw)
  To: Herbert Xu; +Cc: John Que, ak, netdev
In-Reply-To: <E1FYkWm-0003MM-00@gondolin.me.apana.org.au>

On Wed, Apr 26, 2006 at 11:58:00PM +1000, Herbert Xu wrote:

> > I had spent time trying to write something which
> > uses RTA_SRC and RTA_DST and got some problems.
> > (I probably made something stupid.)
> > I googled for such examples and did not get much.
> > I saw that the zebra project and iproute uses
> > netlinks but it is complex.,
> 
> Have a look at
> 
> http://gondor.apana.org.au/~herbert/findsaddr-linux.c
> 
> which I wrote for traceroute some years back.

A fragile and ugly but easier/shorter way of getting the source address
(which I've used a couple of times in the past) is to open a SOCK_DGRAM
socket, connect() it to the intended destination, and then do
getsockname().

(That doesn't give you the interface, though.)


--L

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox