Netdev List
 help / color / mirror / Atom feed
* Re: [patch 1/1][NETNS][IPV6] protect addrconf from loopback registration
From: Eric W. Biederman @ 2007-11-13 12:59 UTC (permalink / raw)
  To: David Miller
  Cc: den, dlezcano, netdev, xemul, containers, yoshfuji,
	benjamin.thery
In-Reply-To: <20071112.142455.73541417.davem@davemloft.net>

David Miller <davem@davemloft.net> writes:

Well this is a weird way to get to this part of the conversation.

> From: "Denis V. Lunev" <den@sw.ru>
> Date: Mon, 12 Nov 2007 19:49:03 +0300
>
>> Unregister for a loopback in !init_net is a _valid_ operation and should
>> be clean, i.e. without kludges in the path. This is the only way to
>> check the ref-counting.
>
> For ipv6 the stack really wants to pin down the loopback
> device because we need a valid inet6_dev object to reference
> at all times in order to simplify the per-device SNMP
> statistic bumping.
>
> When a non-loopback device goes down, we point any existing
> references to that device's idev to the loopback one instead.
>
> I really consider taking down the loopback device to be
> an invalid operation at least how things are implemented
> currently.

In a secondary network namespace the current implementation
registers the loopback device before all other network devices
in a network namespace and it unregisters the loopback device
after all other network devices.

So we don't endanger the current scheme of pointing any existing
reference to the loopback device.  In fact the current ipv6 addrconf_cleanup
largely does the same thing.

Unregistering the loopback device is definitely a case where we need
to tread very carefully.

Bug we absolutely need to do all of our cleanup for a network
namespace went it goes away and that includes removing the per network
namespace copy of the loopback device.

Eric

^ permalink raw reply

* Re: possible bug in tcp_probe
From: Evgeniy Polyakov @ 2007-11-13 13:02 UTC (permalink / raw)
  To: Gavin McCullagh; +Cc: netdev
In-Reply-To: <20071113112615.GA7491@nuim.ie>

Hi.

On Tue, Nov 13, 2007 at 11:26:15AM +0000, Gavin McCullagh (Gavin.McCullagh@nuim.ie) wrote:
> 74.259589763 192.168.2.1 36988 192.168.3.5 5001 0x679c23dc 0x679bc3b4 18 13 9114624 78 76 10000 0 64
> 74.260590660 192.168.2.1 44261 192.168.3.5 5006 0x573bb3ed 0x573b700d 13 9 5254144 155 127 10000 0 64
> 74.261607478 192.168.2.1 44261 192.168.3.5 5006 0x588.066586741 192.168.2.1 33739 192.168.3.5 5009 0xe26d1767 0xe26cf577 2 3 13090816 443 15818 10000 0 64
> 88.066690797 192.168.2.1 33739 192.168.3.5 5009 0xe26d1767 0xe26cfb1f 3 3 13092864 2365 15818 10000 0 64
> 88.067625714 192.168.2.1 59385 192.168.3.5 5012 0x411c1090 0x411bd258 12 9 14578688 2807 15812 10000 0 64
> 
> As you can see the third line has been truncated as well as the next
> roughly 14 seconds of data after which data continues writing as usual.
> 
> I don't think my small changes are causing this but perhaps I'm wrong.
> Does anyone know what might be causing the above?

Log buffer has limited size, you can not write from different threads to
it and expect all data being printed synchronously, there is nothing
exceptional here.

-- 
	Evgeniy Polyakov

^ permalink raw reply

* [PATCH][NET] Convert init_timer into setup_timer
From: Pavel Emelyanov @ 2007-11-13 13:10 UTC (permalink / raw)
  To: David Miller, Linux Netdev List; +Cc: devel

Many-many code in the kernel initialized the timer->function 
and  timer->data together with calling init_timer(timer). There 
is already a helper for this. Use it for networking code.

The patch is HUGE, but makes the code 130 lines shorter 
(98 insertions(+), 228 deletions(-)).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

 net/802/tr.c                     |    4 +---
 net/appletalk/aarp.c             |    4 +---
 net/appletalk/ddp.c              |    5 ++---
 net/atm/lec.c                    |    5 ++---
 net/ax25/af_ax25.c               |    5 ++---
 net/bluetooth/hci_conn.c         |    9 ++-------
 net/bluetooth/hidp/core.c        |    5 +----
 net/bluetooth/l2cap.c            |   13 ++-----------
 net/bluetooth/rfcomm/core.c      |    4 +---
 net/bluetooth/sco.c              |    9 +--------
 net/core/flow.c                  |    3 +--
 net/core/neighbour.c             |   12 +++---------
 net/dccp/ccids/ccid2.c           |    6 ++----
 net/dccp/ccids/ccid3.c           |    7 ++-----
 net/dccp/timer.c                 |    5 ++---
 net/decnet/dn_route.c            |    3 +--
 net/econet/af_econet.c           |    3 +--
 net/ieee80211/ieee80211_module.c |    5 ++---
 net/ipv4/igmp.c                  |   14 +++++---------
 net/ipv4/inet_connection_sock.c  |   17 +++++------------
 net/ipv4/inet_fragment.c         |    5 ++---
 net/ipv4/ipmr.c                  |    3 +--
 net/ipv4/ipvs/ip_vs_conn.c       |    4 +---
 net/ipv4/ipvs/ip_vs_est.c        |    3 +--
 net/ipv4/ipvs/ip_vs_lblc.c       |    5 ++---
 net/ipv4/ipvs/ip_vs_lblcr.c      |    5 ++---
 net/ipv4/route.c                 |    6 ++----
 net/ipv6/addrconf.c              |    4 +---
 net/ipv6/mcast.c                 |   14 +++++---------
 net/irda/af_irda.c               |    5 ++---
 net/iucv/af_iucv.c               |    9 +--------
 net/llc/llc_conn.c               |   20 ++++++++------------
 net/llc/llc_station.c            |    5 ++---
 net/mac80211/sta_info.c          |    5 ++---
 net/netrom/nr_timer.c            |   19 ++++---------------
 net/rose/af_rose.c               |    5 ++---
 net/sched/sch_generic.c          |    9 +--------
 net/sched/sch_sfq.c              |    4 +---
 net/sctp/associola.c             |    8 +++-----
 net/sctp/transport.c             |   13 ++++---------
 net/sunrpc/sched.c               |    5 ++---
 net/sunrpc/xprt.c                |    5 ++---
 net/tipc/core.h                  |    4 +---
 net/x25/x25_link.c               |    5 +----
 net/x25/x25_timer.c              |    4 +---
 net/xfrm/xfrm_policy.c           |    5 ++---
 net/xfrm/xfrm_state.c            |    9 +++------
 47 files changed, 98 insertions(+), 228 deletions(-)

diff --git a/net/802/tr.c b/net/802/tr.c
index a2bd0f2..d8a5386 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -641,10 +641,8 @@ struct net_device *alloc_trdev(int sizeof_priv)
 
 static int __init rif_init(void)
 {
-	init_timer(&rif_timer);
 	rif_timer.expires  = sysctl_tr_rif_timeout;
-	rif_timer.data     = 0L;
-	rif_timer.function = rif_check_expire;
+	setup_timer(&rif_timer, rif_check_expire, 0);
 	add_timer(&rif_timer);
 
 	proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 6c5c6dc..b950fb6 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -874,9 +874,7 @@ void __init aarp_proto_init(void)
 	aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
 	if (!aarp_dl)
 		printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
-	init_timer(&aarp_timer);
-	aarp_timer.function = aarp_expire_timeout;
-	aarp_timer.data	    = 0;
+	setup_timer(&aarp_timer, aarp_expire_timeout, 0);
 	aarp_timer.expires  = jiffies + sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
 	register_netdevice_notifier(&aarp_notifier);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index e0d37d6..3be55c8 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -177,10 +177,9 @@ static inline void atalk_destroy_socket(struct sock *sk)
 
 	if (atomic_read(&sk->sk_wmem_alloc) ||
 	    atomic_read(&sk->sk_rmem_alloc)) {
-		init_timer(&sk->sk_timer);
+		setup_timer(&sk->sk_timer, atalk_destroy_timer,
+				(unsigned long)sk);
 		sk->sk_timer.expires	= jiffies + SOCK_DESTROY_TIME;
-		sk->sk_timer.function	= atalk_destroy_timer;
-		sk->sk_timer.data	= (unsigned long)sk;
 		add_timer(&sk->sk_timer);
 	} else
 		sock_put(sk);
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 7eb1b21..0a9c426 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1789,9 +1789,8 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv,
 	}
 	memcpy(to_return->mac_addr, mac_addr, ETH_ALEN);
 	INIT_HLIST_NODE(&to_return->next);
-	init_timer(&to_return->timer);
-	to_return->timer.function = lec_arp_expire_arp;
-	to_return->timer.data = (unsigned long)to_return;
+	setup_timer(&to_return->timer, lec_arp_expire_arp,
+			(unsigned long)to_return);
 	to_return->last_used = jiffies;
 	to_return->priv = priv;
 	skb_queue_head_init(&to_return->tx_wait);
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 8378afd..95a19c5 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -318,10 +318,9 @@ void ax25_destroy_socket(ax25_cb *ax25)
 		if (atomic_read(&ax25->sk->sk_wmem_alloc) ||
 		    atomic_read(&ax25->sk->sk_rmem_alloc)) {
 			/* Defer: outstanding buffers */
-			init_timer(&ax25->dtimer);
+			setup_timer(&ax25->dtimer, ax25_destroy_timer,
+					(unsigned long)ax25);
 			ax25->dtimer.expires  = jiffies + 2 * HZ;
-			ax25->dtimer.function = ax25_destroy_timer;
-			ax25->dtimer.data     = (unsigned long)ax25;
 			add_timer(&ax25->dtimer);
 		} else {
 			struct sock *sk=ax25->sk;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 9483320..7099f74 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -208,13 +208,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 
 	skb_queue_head_init(&conn->data_q);
 
-	init_timer(&conn->disc_timer);
-	conn->disc_timer.function = hci_conn_timeout;
-	conn->disc_timer.data = (unsigned long) conn;
-
-	init_timer(&conn->idle_timer);
-	conn->idle_timer.function = hci_conn_idle;
-	conn->idle_timer.data = (unsigned long) conn;
+	setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn);
+	setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn);
 
 	atomic_set(&conn->refcnt, 0);
 
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 4bbacdd..782a226 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -811,10 +811,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
 	session->intr_sock = intr_sock;
 	session->state     = BT_CONNECTED;
 
-	init_timer(&session->timer);
-
-	session->timer.function = hidp_idle_timeout;
-	session->timer.data     = (unsigned long) session;
+	setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session);
 
 	skb_queue_head_init(&session->ctrl_transmit);
 	skb_queue_head_init(&session->intr_transmit);
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 477e052..a8811c0 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -99,13 +99,6 @@ static void l2cap_sock_clear_timer(struct sock *sk)
 	sk_stop_timer(sk, &sk->sk_timer);
 }
 
-static void l2cap_sock_init_timer(struct sock *sk)
-{
-	init_timer(&sk->sk_timer);
-	sk->sk_timer.function = l2cap_sock_timeout;
-	sk->sk_timer.data = (unsigned long)sk;
-}
-
 /* ---- L2CAP channels ---- */
 static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
 {
@@ -395,9 +388,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
 
 	conn->feat_mask = 0;
 
-	init_timer(&conn->info_timer);
-	conn->info_timer.function = l2cap_info_timeout;
-	conn->info_timer.data = (unsigned long) conn;
+	setup_timer(&conn->info_timer, l2cap_info_timeout, (unsigned long)conn);
 
 	spin_lock_init(&conn->lock);
 	rwlock_init(&conn->chan_list.lock);
@@ -622,7 +613,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
 	sk->sk_protocol = proto;
 	sk->sk_state    = BT_OPEN;
 
-	l2cap_sock_init_timer(sk);
+	setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long)sk);
 
 	bt_sock_link(&l2cap_sk_list, sk);
 	return sk;
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index e7ac6ba..d3e4e18 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -279,9 +279,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
 	if (!d)
 		return NULL;
 
-	init_timer(&d->timer);
-	d->timer.function = rfcomm_dlc_timeout;
-	d->timer.data = (unsigned long) d;
+	setup_timer(&d->timer, rfcomm_dlc_timeout, (unsigned long)d);
 
 	skb_queue_head_init(&d->tx_queue);
 	spin_lock_init(&d->lock);
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 93ad1aa..b91d3c8 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -97,13 +97,6 @@ static void sco_sock_clear_timer(struct sock *sk)
 	sk_stop_timer(sk, &sk->sk_timer);
 }
 
-static void sco_sock_init_timer(struct sock *sk)
-{
-	init_timer(&sk->sk_timer);
-	sk->sk_timer.function = sco_sock_timeout;
-	sk->sk_timer.data = (unsigned long)sk;
-}
-
 /* ---- SCO connections ---- */
 static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
 {
@@ -436,7 +429,7 @@ static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int pro
 	sk->sk_protocol = proto;
 	sk->sk_state    = BT_OPEN;
 
-	sco_sock_init_timer(sk);
+	setup_timer(&sk->sk_timer, sco_sock_timeout, (unsigned long)sk);
 
 	bt_sock_link(&sco_sk_list, sk);
 	return sk;
diff --git a/net/core/flow.c b/net/core/flow.c
index 3ed2b4b..a618f89 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -352,8 +352,7 @@ static int __init flow_cache_init(void)
 	flow_lwm = 2 * flow_hash_size;
 	flow_hwm = 4 * flow_hash_size;
 
-	init_timer(&flow_hash_rnd_timer);
-	flow_hash_rnd_timer.function = flow_cache_new_hashrnd;
+	setup_timer(&flow_hash_rnd_timer, flow_cache_new_hashrnd, 0);
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
 	add_timer(&flow_hash_rnd_timer);
 
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 29b8ee4..175bbc0 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -270,9 +270,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl)
 	n->nud_state	  = NUD_NONE;
 	n->output	  = neigh_blackhole;
 	n->parms	  = neigh_parms_clone(&tbl->parms);
-	init_timer(&n->timer);
-	n->timer.function = neigh_timer_handler;
-	n->timer.data	  = (unsigned long)n;
+	setup_timer(&n->timer, neigh_timer_handler, (unsigned long)n);
 
 	NEIGH_CACHE_STAT_INC(tbl, allocs);
 	n->tbl		  = tbl;
@@ -1372,15 +1370,11 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
 	get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd));
 
 	rwlock_init(&tbl->lock);
-	init_timer(&tbl->gc_timer);
-	tbl->gc_timer.data     = (unsigned long)tbl;
-	tbl->gc_timer.function = neigh_periodic_timer;
+	setup_timer(&tbl->gc_timer, neigh_periodic_timer, (unsigned long)tbl);
 	tbl->gc_timer.expires  = now + 1;
 	add_timer(&tbl->gc_timer);
 
-	init_timer(&tbl->proxy_timer);
-	tbl->proxy_timer.data	  = (unsigned long)tbl;
-	tbl->proxy_timer.function = neigh_proxy_process;
+	setup_timer(&tbl->proxy_timer, neigh_proxy_process, (unsigned long)tbl);
 	skb_queue_head_init_class(&tbl->proxy_queue,
 			&neigh_table_proxy_queue_class);
 
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index d694656..c9c465e 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -760,10 +760,8 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
 	hctx->ccid2hctx_rttvar	 = -1;
 	hctx->ccid2hctx_rpdupack = -1;
 	hctx->ccid2hctx_last_cong = jiffies;
-
-	hctx->ccid2hctx_rtotimer.function = &ccid2_hc_tx_rto_expire;
-	hctx->ccid2hctx_rtotimer.data	  = (unsigned long)sk;
-	init_timer(&hctx->ccid2hctx_rtotimer);
+	setup_timer(&hctx->ccid2hctx_rtotimer, ccid2_hc_tx_rto_expire,
+			(unsigned long)sk);
 
 	ccid2_hc_tx_check_sanity(hctx);
 	return 0;
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 19b3358..dfe1aa7 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -606,11 +606,8 @@ static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)
 
 	hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT;
 	INIT_LIST_HEAD(&hctx->ccid3hctx_hist);
-
-	hctx->ccid3hctx_no_feedback_timer.function =
-				ccid3_hc_tx_no_feedback_timer;
-	hctx->ccid3hctx_no_feedback_timer.data     = (unsigned long)sk;
-	init_timer(&hctx->ccid3hctx_no_feedback_timer);
+	setup_timer(&hctx->ccid3hctx_no_feedback_timer,
+			ccid3_hc_tx_no_feedback_timer, (unsigned long)sk);
 
 	return 0;
 }
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index 3af0673..8703a79 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -280,9 +280,8 @@ static void dccp_init_write_xmit_timer(struct sock *sk)
 {
 	struct dccp_sock *dp = dccp_sk(sk);
 
-	init_timer(&dp->dccps_xmit_timer);
-	dp->dccps_xmit_timer.data = (unsigned long)sk;
-	dp->dccps_xmit_timer.function = dccp_write_xmit_timer;
+	setup_timer(&dp->dccps_xmit_timer, dccp_write_xmit_timer,
+			(unsigned long)sk);
 }
 
 void dccp_init_xmit_timers(struct sock *sk)
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 66663e5..ed24277 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1752,8 +1752,7 @@ void __init dn_route_init(void)
 	dn_dst_ops.kmem_cachep =
 		kmem_cache_create("dn_dst_cache", sizeof(struct dn_route), 0,
 				  SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
-	init_timer(&dn_route_timer);
-	dn_route_timer.function = dn_dst_check_expire;
+	setup_timer(&dn_route_timer, dn_dst_check_expire, 0);
 	dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ;
 	add_timer(&dn_route_timer);
 
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index f70df07..bc0f625 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -1014,9 +1014,8 @@ static int __init aun_udp_initialise(void)
 
 	skb_queue_head_init(&aun_queue);
 	spin_lock_init(&aun_queue_lock);
-	init_timer(&ab_cleanup_timer);
+	setup_timer(&ab_cleanup_timer, ab_cleanup, 0);
 	ab_cleanup_timer.expires = jiffies + (HZ*2);
-	ab_cleanup_timer.function = ab_cleanup;
 	add_timer(&ab_cleanup_timer);
 
 	memset(&sin, 0, sizeof(sin));
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index 69cb6aa..3bca97f 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -181,9 +181,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
 	ieee->ieee802_1x = 1;	/* Default to supporting 802.1x */
 
 	INIT_LIST_HEAD(&ieee->crypt_deinit_list);
-	init_timer(&ieee->crypt_deinit_timer);
-	ieee->crypt_deinit_timer.data = (unsigned long)ieee;
-	ieee->crypt_deinit_timer.function = ieee80211_crypt_deinit_handler;
+	setup_timer(&ieee->crypt_deinit_timer, ieee80211_crypt_deinit_handler,
+			(unsigned long)ieee);
 	ieee->crypt_quiesced = 0;
 
 	spin_lock_init(&ieee->lock);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 7dbc282..7015585 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1234,9 +1234,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
 	spin_lock_init(&im->lock);
 #ifdef CONFIG_IP_MULTICAST
 	im->tm_running=0;
-	init_timer(&im->timer);
-	im->timer.data=(unsigned long)im;
-	im->timer.function=&igmp_timer_expire;
+	setup_timer(&im->timer, &igmp_timer_expire, (unsigned long)im);
 	im->unsolicit_count = IGMP_Unsolicited_Report_Count;
 	im->reporter = 0;
 	im->gsquery = 0;
@@ -1338,13 +1336,11 @@ void ip_mc_init_dev(struct in_device *in_dev)
 	in_dev->mc_tomb = NULL;
 #ifdef CONFIG_IP_MULTICAST
 	in_dev->mr_gq_running = 0;
-	init_timer(&in_dev->mr_gq_timer);
-	in_dev->mr_gq_timer.data=(unsigned long) in_dev;
-	in_dev->mr_gq_timer.function=&igmp_gq_timer_expire;
+	setup_timer(&in_dev->mr_gq_timer, igmp_gq_timer_expire,
+			(unsigned long)in_dev);
 	in_dev->mr_ifc_count = 0;
-	init_timer(&in_dev->mr_ifc_timer);
-	in_dev->mr_ifc_timer.data=(unsigned long) in_dev;
-	in_dev->mr_ifc_timer.function=&igmp_ifc_timer_expire;
+	setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire,
+			(unsigned long)in_dev);
 	in_dev->mr_qrv = IGMP_Unsolicited_Report_Count;
 #endif
 
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 8fb6ca2..1c2a32f 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -277,18 +277,11 @@ void inet_csk_init_xmit_timers(struct sock *sk,
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
 
-	init_timer(&icsk->icsk_retransmit_timer);
-	init_timer(&icsk->icsk_delack_timer);
-	init_timer(&sk->sk_timer);
-
-	icsk->icsk_retransmit_timer.function = retransmit_handler;
-	icsk->icsk_delack_timer.function     = delack_handler;
-	sk->sk_timer.function		     = keepalive_handler;
-
-	icsk->icsk_retransmit_timer.data =
-		icsk->icsk_delack_timer.data =
-			sk->sk_timer.data  = (unsigned long)sk;
-
+	setup_timer(&icsk->icsk_retransmit_timer, retransmit_handler,
+			(unsigned long)sk);
+	setup_timer(&icsk->icsk_delack_timer, delack_handler,
+			(unsigned long)sk);
+	setup_timer(&sk->sk_timer, keepalive_handler, (unsigned long)sk);
 	icsk->icsk_pending = icsk->icsk_ack.pending = 0;
 }
 
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index e15e04f..7379107 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -66,9 +66,8 @@ void inet_frags_init(struct inet_frags *f)
 	f->nqueues = 0;
 	atomic_set(&f->mem, 0);
 
-	init_timer(&f->secret_timer);
-	f->secret_timer.function = inet_frag_secret_rebuild;
-	f->secret_timer.data = (unsigned long)f;
+	setup_timer(&f->secret_timer, inet_frag_secret_rebuild,
+			(unsigned long)f);
 	f->secret_timer.expires = jiffies + f->ctl->secret_interval;
 	add_timer(&f->secret_timer);
 }
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 37bb497..ba6c23c 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1889,8 +1889,7 @@ void __init ip_mr_init(void)
 				       sizeof(struct mfc_cache),
 				       0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
 				       NULL);
-	init_timer(&ipmr_expire_timer);
-	ipmr_expire_timer.function=ipmr_expire_process;
+	setup_timer(&ipmr_expire_timer, ipmr_expire_process, 0);
 	register_netdevice_notifier(&ip_mr_notifier);
 #ifdef CONFIG_PROC_FS
 	proc_net_fops_create(&init_net, "ip_mr_vif", 0, &ipmr_vif_fops);
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 0a9f3c3..a22cee4 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -629,9 +629,7 @@ ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport
 	}
 
 	INIT_LIST_HEAD(&cp->c_list);
-	init_timer(&cp->timer);
-	cp->timer.data     = (unsigned long)cp;
-	cp->timer.function = ip_vs_conn_expire;
+	setup_timer(&cp->timer, ip_vs_conn_expire, (unsigned long)cp);
 	cp->protocol	   = proto;
 	cp->caddr	   = caddr;
 	cp->cport	   = cport;
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c
index 7d68b80..efdd74e 100644
--- a/net/ipv4/ipvs/ip_vs_est.c
+++ b/net/ipv4/ipvs/ip_vs_est.c
@@ -146,9 +146,8 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats)
 	write_lock_bh(&est_lock);
 	est->next = est_list;
 	if (est->next == NULL) {
-		init_timer(&est_timer);
+		setup_timer(&est_timer, estimation_timer, 0);
 		est_timer.expires = jiffies + 2*HZ;
-		est_timer.function = estimation_timer;
 		add_timer(&est_timer);
 	}
 	est_list = est;
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 052f4ed..83ecf27 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -393,9 +393,8 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
 	/*
 	 *    Hook periodic timer for garbage collection
 	 */
-	init_timer(&tbl->periodic_timer);
-	tbl->periodic_timer.data = (unsigned long)tbl;
-	tbl->periodic_timer.function = ip_vs_lblc_check_expire;
+	setup_timer(&tbl->periodic_timer, ip_vs_lblc_check_expire,
+			(unsigned long)tbl);
 	tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL;
 	add_timer(&tbl->periodic_timer);
 
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 427b593..d83ddab 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -577,9 +577,8 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
 	/*
 	 *    Hook periodic timer for garbage collection
 	 */
-	init_timer(&tbl->periodic_timer);
-	tbl->periodic_timer.data = (unsigned long)tbl;
-	tbl->periodic_timer.function = ip_vs_lblcr_check_expire;
+	setup_timer(&tbl->periodic_timer, ip_vs_lblcr_check_expire,
+			(unsigned long)tbl);
 	tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL;
 	add_timer(&tbl->periodic_timer);
 
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 4565183..3a03463 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2962,10 +2962,8 @@ int __init ip_rt_init(void)
 	devinet_init();
 	ip_fib_init();
 
-	init_timer(&rt_flush_timer);
-	rt_flush_timer.function = rt_run_flush;
-	init_timer(&rt_secret_timer);
-	rt_secret_timer.function = rt_secret_rebuild;
+	setup_timer(&rt_flush_timer, rt_run_flush, 0);
+	setup_timer(&rt_secret_timer, rt_secret_rebuild, 0);
 
 	/* All the timers, started at system startup tend
 	   to synchronize. Perturb it a bit.
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1bd8d81..f825b92 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -366,9 +366,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
 	in6_dev_hold(ndev);
 
 #ifdef CONFIG_IPV6_PRIVACY
-	init_timer(&ndev->regen_timer);
-	ndev->regen_timer.function = ipv6_regen_rndid;
-	ndev->regen_timer.data = (unsigned long) ndev;
+	setup_timer(&ndev->regen_timer, ipv6_regen_rndid, (unsigned long)ndev);
 	if ((dev->flags&IFF_LOOPBACK) ||
 	    dev->type == ARPHRD_TUNNEL ||
 #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 331d728..17d7318 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -903,9 +903,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr)
 		return -ENOMEM;
 	}
 
-	init_timer(&mc->mca_timer);
-	mc->mca_timer.function = igmp6_timer_handler;
-	mc->mca_timer.data = (unsigned long) mc;
+	setup_timer(&mc->mca_timer, igmp6_timer_handler, (unsigned long)mc);
 
 	ipv6_addr_copy(&mc->mca_addr, addr);
 	mc->idev = idev;
@@ -2259,14 +2257,12 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
 	write_lock_bh(&idev->lock);
 	rwlock_init(&idev->mc_lock);
 	idev->mc_gq_running = 0;
-	init_timer(&idev->mc_gq_timer);
-	idev->mc_gq_timer.data = (unsigned long) idev;
-	idev->mc_gq_timer.function = &mld_gq_timer_expire;
+	setup_timer(&idev->mc_gq_timer, mld_gq_timer_expire,
+			(unsigned long)idev);
 	idev->mc_tomb = NULL;
 	idev->mc_ifc_count = 0;
-	init_timer(&idev->mc_ifc_timer);
-	idev->mc_ifc_timer.data = (unsigned long) idev;
-	idev->mc_ifc_timer.function = &mld_ifc_timer_expire;
+	setup_timer(&idev->mc_ifc_timer, mld_ifc_timer_expire,
+			(unsigned long)idev);
 	idev->mc_qrv = MLD_QRV_DEFAULT;
 	idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL;
 	idev->mc_v1_seen = 0;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 48ce59a..9a0a296 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2388,9 +2388,8 @@ bed:
 
 			/* Set watchdog timer to expire in <val> ms. */
 			self->errno = 0;
-			init_timer(&self->watchdog);
-			self->watchdog.function = irda_discovery_timeout;
-			self->watchdog.data = (unsigned long) self;
+			setup_timer(&self->watchdog, irda_discovery_timeout,
+					(unsigned long)self);
 			self->watchdog.expires = jiffies + (val * HZ/1000);
 			add_timer(&(self->watchdog));
 
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index aef6645..2255e3c 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -94,13 +94,6 @@ static void iucv_sock_clear_timer(struct sock *sk)
 	sk_stop_timer(sk, &sk->sk_timer);
 }
 
-static void iucv_sock_init_timer(struct sock *sk)
-{
-	init_timer(&sk->sk_timer);
-	sk->sk_timer.function = iucv_sock_timeout;
-	sk->sk_timer.data = (unsigned long)sk;
-}
-
 static struct sock *__iucv_get_sock_by_name(char *nm)
 {
 	struct sock *sk;
@@ -238,7 +231,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio)
 	sk->sk_protocol = proto;
 	sk->sk_state	= IUCV_OPEN;
 
-	iucv_sock_init_timer(sk);
+	setup_timer(&sk->sk_timer, iucv_sock_timeout, (unsigned long)sk);
 
 	iucv_sock_link(&iucv_sk_list, sk);
 	return sk;
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 5c0b484..441bc18 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -831,25 +831,21 @@ static void llc_sk_init(struct sock* sk)
 	llc->inc_cntr = llc->dec_cntr = 2;
 	llc->dec_step = llc->connect_step = 1;
 
-	init_timer(&llc->ack_timer.timer);
+	setup_timer(&llc->ack_timer.timer, llc_conn_ack_tmr_cb,
+			(unsigned long)sk);
 	llc->ack_timer.expire	      = sysctl_llc2_ack_timeout;
-	llc->ack_timer.timer.data     = (unsigned long)sk;
-	llc->ack_timer.timer.function = llc_conn_ack_tmr_cb;
 
-	init_timer(&llc->pf_cycle_timer.timer);
+	setup_timer(&llc->pf_cycle_timer.timer, llc_conn_pf_cycle_tmr_cb,
+			(unsigned long)sk);
 	llc->pf_cycle_timer.expire	   = sysctl_llc2_p_timeout;
-	llc->pf_cycle_timer.timer.data     = (unsigned long)sk;
-	llc->pf_cycle_timer.timer.function = llc_conn_pf_cycle_tmr_cb;
 
-	init_timer(&llc->rej_sent_timer.timer);
+	setup_timer(&llc->rej_sent_timer.timer, llc_conn_rej_tmr_cb,
+			(unsigned long)sk);
 	llc->rej_sent_timer.expire	   = sysctl_llc2_rej_timeout;
-	llc->rej_sent_timer.timer.data     = (unsigned long)sk;
-	llc->rej_sent_timer.timer.function = llc_conn_rej_tmr_cb;
 
-	init_timer(&llc->busy_state_timer.timer);
+	setup_timer(&llc->busy_state_timer.timer, llc_conn_busy_tmr_cb,
+			(unsigned long)sk);
 	llc->busy_state_timer.expire	     = sysctl_llc2_busy_timeout;
-	llc->busy_state_timer.timer.data     = (unsigned long)sk;
-	llc->busy_state_timer.timer.function = llc_conn_busy_tmr_cb;
 
 	llc->n2 = 2;   /* max retransmit */
 	llc->k  = 2;   /* tx win size, will adjust dynam */
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
index 576355a..6f2ea20 100644
--- a/net/llc/llc_station.c
+++ b/net/llc/llc_station.c
@@ -688,9 +688,8 @@ int __init llc_station_init(void)
 	skb_queue_head_init(&llc_main_station.mac_pdu_q);
 	skb_queue_head_init(&llc_main_station.ev_q.list);
 	spin_lock_init(&llc_main_station.ev_q.lock);
-	init_timer(&llc_main_station.ack_timer);
-	llc_main_station.ack_timer.data     = (unsigned long)&llc_main_station;
-	llc_main_station.ack_timer.function = llc_station_ack_tmr_cb;
+	setup_timer(&llc_main_station.ack_timer, llc_station_ack_tmr_cb,
+			(unsigned long)&llc_main_station);
 	llc_main_station.ack_timer.expires  = jiffies +
 						sysctl_llc_station_ack_timeout;
 	skb = alloc_skb(0, GFP_ATOMIC);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index e849155..bf84d27 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -344,10 +344,9 @@ void sta_info_init(struct ieee80211_local *local)
 	rwlock_init(&local->sta_lock);
 	INIT_LIST_HEAD(&local->sta_list);
 
-	init_timer(&local->sta_cleanup);
+	setup_timer(&local->sta_cleanup, sta_info_cleanup,
+			(unsigned long)local);
 	local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL;
-	local->sta_cleanup.data = (unsigned long) local;
-	local->sta_cleanup.function = sta_info_cleanup;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
 	INIT_WORK(&local->sta_debugfs_add, sta_info_debugfs_add_task);
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 6cfaad9..1cb98e8 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -40,21 +40,10 @@ void nr_init_timers(struct sock *sk)
 {
 	struct nr_sock *nr = nr_sk(sk);
 
-	init_timer(&nr->t1timer);
-	nr->t1timer.data     = (unsigned long)sk;
-	nr->t1timer.function = &nr_t1timer_expiry;
-
-	init_timer(&nr->t2timer);
-	nr->t2timer.data     = (unsigned long)sk;
-	nr->t2timer.function = &nr_t2timer_expiry;
-
-	init_timer(&nr->t4timer);
-	nr->t4timer.data     = (unsigned long)sk;
-	nr->t4timer.function = &nr_t4timer_expiry;
-
-	init_timer(&nr->idletimer);
-	nr->idletimer.data     = (unsigned long)sk;
-	nr->idletimer.function = &nr_idletimer_expiry;
+	setup_timer(&nr->t1timer, nr_t1timer_expiry, (unsigned long)sk);
+	setup_timer(&nr->t2timer, nr_t2timer_expiry, (unsigned long)sk);
+	setup_timer(&nr->t4timer, nr_t4timer_expiry, (unsigned long)sk);
+	setup_timer(&nr->idletimer, nr_idletimer_expiry, (unsigned long)sk);
 
 	/* initialized by sock_init_data */
 	sk->sk_timer.data     = (unsigned long)sk;
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index ed2d65c..323d42a 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -345,10 +345,9 @@ void rose_destroy_socket(struct sock *sk)
 	if (atomic_read(&sk->sk_wmem_alloc) ||
 	    atomic_read(&sk->sk_rmem_alloc)) {
 		/* Defer: outstanding buffers */
-		init_timer(&sk->sk_timer);
+		setup_timer(&sk->sk_timer, rose_destroy_timer,
+				(unsigned long)sk);
 		sk->sk_timer.expires  = jiffies + 10 * HZ;
-		sk->sk_timer.function = rose_destroy_timer;
-		sk->sk_timer.data     = (unsigned long)sk;
 		add_timer(&sk->sk_timer);
 	} else
 		sock_put(sk);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index fa1a6f4..7f49620 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -210,13 +210,6 @@ static void dev_watchdog(unsigned long arg)
 	dev_put(dev);
 }
 
-static void dev_watchdog_init(struct net_device *dev)
-{
-	init_timer(&dev->watchdog_timer);
-	dev->watchdog_timer.data = (unsigned long)dev;
-	dev->watchdog_timer.function = dev_watchdog;
-}
-
 void __netdev_watchdog_up(struct net_device *dev)
 {
 	if (dev->tx_timeout) {
@@ -607,7 +600,7 @@ void dev_init_scheduler(struct net_device *dev)
 	INIT_LIST_HEAD(&dev->qdisc_list);
 	qdisc_unlock_tree(dev);
 
-	dev_watchdog_init(dev);
+	setup_timer(&dev->watchdog_timer, dev_watchdog, (unsigned long)dev);
 }
 
 void dev_shutdown(struct net_device *dev)
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index b542c87..6529387 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -426,9 +426,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
 	struct sfq_sched_data *q = qdisc_priv(sch);
 	int i;
 
-	init_timer(&q->perturb_timer);
-	q->perturb_timer.data = (unsigned long)sch;
-	q->perturb_timer.function = sfq_perturbation;
+	setup_timer(&q->perturb_timer, sfq_perturbation, (unsigned long)sch);
 
 	for (i=0; i<SFQ_HASH_DIVISOR; i++)
 		q->ht[i] = SFQ_DEPTH;
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 013e3d3..33ae9b0 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -167,11 +167,9 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
 		sp->autoclose * HZ;
 
 	/* Initilizes the timers */
-	for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) {
-		init_timer(&asoc->timers[i]);
-		asoc->timers[i].function = sctp_timer_events[i];
-		asoc->timers[i].data = (unsigned long) asoc;
-	}
+	for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i)
+		setup_timer(&asoc->timers[i], sctp_timer_events[i],
+				(unsigned long)asoc);
 
 	/* Pull default initialization values from the sock options.
 	 * Note: This assumes that the values have already been
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index d55ce83..dfa1093 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -99,15 +99,10 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
 	INIT_LIST_HEAD(&peer->send_ready);
 	INIT_LIST_HEAD(&peer->transports);
 
-	/* Set up the retransmission timer.  */
-	init_timer(&peer->T3_rtx_timer);
-	peer->T3_rtx_timer.function = sctp_generate_t3_rtx_event;
-	peer->T3_rtx_timer.data = (unsigned long)peer;
-
-	/* Set up the heartbeat timer. */
-	init_timer(&peer->hb_timer);
-	peer->hb_timer.function = sctp_generate_heartbeat_event;
-	peer->hb_timer.data = (unsigned long)peer;
+	setup_timer(&peer->T3_rtx_timer, sctp_generate_t3_rtx_event,
+			(unsigned long)peer);
+	setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event,
+			(unsigned long)peer);
 
 	/* Initialize the 64-bit random nonce sent with heartbeat. */
 	get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce));
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index c98873f..eed5dd9 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -811,9 +811,8 @@ EXPORT_SYMBOL_GPL(rpc_free);
 void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, const struct rpc_call_ops *tk_ops, void *calldata)
 {
 	memset(task, 0, sizeof(*task));
-	init_timer(&task->tk_timer);
-	task->tk_timer.data     = (unsigned long) task;
-	task->tk_timer.function = (void (*)(unsigned long)) rpc_run_timer;
+	setup_timer(&task->tk_timer, (void (*)(unsigned long))rpc_run_timer,
+			(unsigned long)task);
 	atomic_set(&task->tk_count, 1);
 	task->tk_client = clnt;
 	task->tk_flags  = flags;
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 282a9a2..8823241 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1011,9 +1011,8 @@ found:
 	INIT_LIST_HEAD(&xprt->free);
 	INIT_LIST_HEAD(&xprt->recv);
 	INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
-	init_timer(&xprt->timer);
-	xprt->timer.function = xprt_init_autodisconnect;
-	xprt->timer.data = (unsigned long) xprt;
+	setup_timer(&xprt->timer, xprt_init_autodisconnect,
+			(unsigned long)xprt);
 	xprt->last_used = jiffies;
 	xprt->cwnd = RPC_INITCWND;
 	xprt->bind_index = 0;
diff --git a/net/tipc/core.h b/net/tipc/core.h
index e40ada9..feabca5 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -212,9 +212,7 @@ static inline void k_init_timer(struct timer_list *timer, Handler routine,
 				unsigned long argument)
 {
 	dbg("initializing timer %p\n", timer);
-	init_timer(timer);
-	timer->function = routine;
-	timer->data = argument;
+	setup_timer(timer, routine, argument);
 }
 
 /**
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c
index 741ce95..753f2b6 100644
--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -247,10 +247,7 @@ void x25_link_device_up(struct net_device *dev)
 		return;
 
 	skb_queue_head_init(&nb->queue);
-
-	init_timer(&nb->t20timer);
-	nb->t20timer.data     = (unsigned long)nb;
-	nb->t20timer.function = &x25_t20timer_expiry;
+	setup_timer(&nb->t20timer, x25_t20timer_expiry, (unsigned long)nb);
 
 	dev_hold(dev);
 	nb->dev      = dev;
diff --git a/net/x25/x25_timer.c b/net/x25/x25_timer.c
index 2af190d..d3e3e54 100644
--- a/net/x25/x25_timer.c
+++ b/net/x25/x25_timer.c
@@ -33,9 +33,7 @@ void x25_init_timers(struct sock *sk)
 {
 	struct x25_sock *x25 = x25_sk(sk);
 
-	init_timer(&x25->timer);
-	x25->timer.data     = (unsigned long)sk;
-	x25->timer.function = &x25_timer_expiry;
+	setup_timer(&x25->timer, x25_timer_expiry, (unsigned long)sk);
 
 	/* initialized by sock_init_data */
 	sk->sk_timer.data     = (unsigned long)sk;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b702bd8..6451008 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -196,9 +196,8 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp)
 		INIT_HLIST_NODE(&policy->byidx);
 		rwlock_init(&policy->lock);
 		atomic_set(&policy->refcnt, 1);
-		init_timer(&policy->timer);
-		policy->timer.data = (unsigned long)policy;
-		policy->timer.function = xfrm_policy_timer;
+		setup_timer(&policy->timer, xfrm_policy_timer,
+				(unsigned long)policy);
 	}
 	return policy;
 }
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 224b44e..1b30a89 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -504,12 +504,9 @@ struct xfrm_state *xfrm_state_alloc(void)
 		INIT_HLIST_NODE(&x->bydst);
 		INIT_HLIST_NODE(&x->bysrc);
 		INIT_HLIST_NODE(&x->byspi);
-		init_timer(&x->timer);
-		x->timer.function = xfrm_timer_handler;
-		x->timer.data	  = (unsigned long)x;
-		init_timer(&x->rtimer);
-		x->rtimer.function = xfrm_replay_timer_handler;
-		x->rtimer.data     = (unsigned long)x;
+		setup_timer(&x->timer, xfrm_timer_handler, (unsigned long)x);
+		setup_timer(&x->rtimer, xfrm_replay_timer_handler,
+				(unsigned long)x);
 		x->curlft.add_time = get_seconds();
 		x->lft.soft_byte_limit = XFRM_INF;
 		x->lft.soft_packet_limit = XFRM_INF;

^ permalink raw reply related

* Re: Problem with frame time stamping
From: Eric Dumazet @ 2007-11-13 13:13 UTC (permalink / raw)
  To: Antoine Zen-Ruffinen; +Cc: netdev, linux-net, netfilter-devel, patrik.arlos
In-Reply-To: <2cbbd8de0711130434s75e78c35rfda90b81686ee9e1@mail.gmail.com>

Antoine Zen-Ruffinen a écrit :
> THIS is what I did at the beginning. But is seem me to be some thing
> wrong. So I put a static value in skb->tstamp  instead of
> ktime_get_real() for debug purpose. And I was still becoming the
> amount of second, microsecond since 1970. We are back to my initial
> mail ! The value of skb->tsamp doesn't seems to be returned by
> ioctl().
>   
OK Antoine.

Yes, 'struct timeval' is as you discovered, ie relative to *something*, 
a given event in the past. (in your case, CLOCK_REALTIME Epoch : January 
1th 1970)

It is even documented (man gettimeofday)

DESCRIPTION
       The  gettimeofday() function shall obtain the current time, 
expressed as seconds and microseconds since the Epoch, and store it in the
       timeval structure pointed to by tp.

For timespec STAMPNS, see clock_gettime() description.

clock_gettime(CLOCK_REALTIME, &ts);

If in your driver you stick in tstamp.tv64 a value like 0x00010002, then 
the result of ioctl(SIOCGSTAMP) will be :
tv.tv_sec = 0   (so yes, January 1th 1970)
tv.tv_usec = 65   (because 0x10002/1000 = 65)

Not counting the fact that .tv64 should not be directly set, unless for 
0 value, because it is not portable.






^ permalink raw reply

* Re: [patch 1/1][NETNS][IPV6] protect addrconf from loopback registration
From: Eric W. Biederman @ 2007-11-13 13:11 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明
  Cc: dlezcano, den, davem, netdev, xemul, containers, benjamin.thery
In-Reply-To: <20071113.105229.57026325.yoshfuji@linux-ipv6.org>

YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> writes:

> In article <m16407450i.fsf@ebiederm.dsl.xmission.com> (at Mon, 12 Nov 2007
> 12:50:53 -0700), ebiederm@xmission.com (Eric W. Biederman) says:
>
>> My opinion is that both your analysis is slightly off (as to the cause
>> of your problems) and that your approach to fix your problem is wrong
>> because you don't untangle the knot you keep it.
> :
>> I have register_pernet_subsys and register_per_net_device to ensure
>> that when we create a new network namespace all of the subsystems are
>> initialized before the network devices are initialize.  So ipv6 should
>> be ready before we initialize the new loopback device comes into
>> existence.
>
> User may not load ipv6.ko at boot, and then do "modprobe ipv6".
> Do you take this into account?

Absolutely.

In the general case the infrastructure has to work for netfilter, ipv6,
and other parts of the networking stack that can be made modular.

The only limitation is that if you update struct net to add a new field
to help a modular ipv6 the core kernel needs to be recompiled.

When you load ipv6.ko late in the game first we call the init methods
which will eventually register the per network namespace registration
methods.  Then register_netdevice_notifier is called.  At which point
ipv6 is ready for the registration method.

For additional network namespace (which is the case that was claimed
was in trouble) the pernet_susbsys logic initializes all of the
subsystems before it initializes any of the network devices.
Effectively persevering the initialization order that exists today
with just the init methods and register_netdevice_notifier.


Eric

^ permalink raw reply

* Re: possible bug in tcp_probe
From: Andi Kleen @ 2007-11-13 13:28 UTC (permalink / raw)
  To: Gavin McCullagh; +Cc: netdev
In-Reply-To: <20071113112615.GA7491@nuim.ie>

Gavin McCullagh <Gavin.McCullagh@nuim.ie> writes:

> I'm using linux v2.6.22.6 and tcp_probe with a couple of small
> modifications[1]. 
>
> Even with moderately large numbers of flows (16 on the one machine) and
> increasingly as I monitor more flows than that, I get strange overflow
> problems such as this one:

You probably just need to increase the buffer (bufsize option to the 
module or tcp_probe.bufsize if compiled in) 

In general I think tcp_probe was always more intended a demo of how kprobes
could be used than a real production tool (with no offense to sch) 

-Andi


^ permalink raw reply

* Re: [PATCH][NET] Convert init_timer into setup_timer
From: David Miller @ 2007-11-13 13:34 UTC (permalink / raw)
  To: xemul; +Cc: netdev, devel
In-Reply-To: <4739A22B.20600@openvz.org>

From: Pavel Emelyanov <xemul@openvz.org>
Date: Tue, 13 Nov 2007 16:10:03 +0300

> Many-many code in the kernel initialized the timer->function 
> and  timer->data together with calling init_timer(timer). There 
> is already a helper for this. Use it for networking code.
> 
> The patch is HUGE, but makes the code 130 lines shorter 
> (98 insertions(+), 228 deletions(-)).
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

I have no objection to this patch, but it is 2.6.25
material for sure.

^ permalink raw reply

* Re: [NET] netfilter : xt_time should not assume CONFIG_KTIME_SCALAR
From: Eric Dumazet @ 2007-11-13 12:48 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David Miller, netdev
In-Reply-To: <4739938E.6010905@trash.net>

Patrick McHardy a écrit :
> David Miller wrote:
>> From: Eric Dumazet <dada1@cosmosbay.com>
>> Date: Tue, 13 Nov 2007 12:30:37 +0100
>>
>>> It is not correct to assume one can get nsec from a ktime directly 
>>> by using .tv64 field.
>>>
>>> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
>>
>> Patrick, this is very clearly a correct bug fix, so I'm
>> going to apply this directly.
>
>
> Thanks, thats obviously correct. Still, I would prefer if
> people would CC netfilter-devel and myself, it has become
> a bad habit lately especially to skip netfilter-devel.
>
>
Sorry for forgeting netfilter-devel, I'll try to remember for next time...

Thank you





^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Ingo Molnar @ 2007-11-13 13:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Miller, protasnb, linux-kernel, netdev, alsa-devel,
	linux-ide, linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <20071113041259.79c9a8c5.akpm@linux-foundation.org>


* Andrew Morton <akpm@linux-foundation.org> wrote:

> > > Do you believe that our response to bug reports is adequate?
> > 
> > Do you feel that making us feel and look like shit helps?
> 
> That doesn't answer my question.
> 
> See, first we need to work out whether we have a problem.  If we do 
> this, then we can then have a think about what to do about it.
> 
> I tried to convince the 2006 KS attendees that we have a problem and I 
> resoundingly failed.  People seemed to think that we're doing OK.
> 
> But it appears that data such as this contradicts that belief.
> 
> This is not a minor matter.  If the kernel _is_ slowly deteriorating 
> then this won't become readily apparent until it has been happening 
> for a number of years.  By that stage there will be so much work to do 
> to get us back to an acceptable level that it will take a huge effort.  
> And it will take a long time after that for the kerel to get its 
> reputation back.
> 
> So it is important that we catch deterioration *early* if it is 
> happening.

yes, yes, yes, and i agree with you that there is a problem. I tried to 
make this point at the 2007 KS: not only is degradation in quality not 
apparent for years, slow degradation in quality can give kernel 
developers the exact _opposite_ perception! (Fewer testers means fewer 
bugreports and that results in apparent "improved" quality and fewer 
reported regressions - while exactly the opposite is happening and 
testers are leaving us without giving us any indication that this is 
happening. We just dont notice.)

I'm not moaning about bugs that slip through - those are unavoidable 
facts of a high flux codebase. I'm moaning about reoccuring, avoidable 
bugs, i'm moaning about hostility towards testers, i'm moaning about 
hostility towards automated testing, i'm moaning about unnecessary hoops 
a willing (but unskilled) tester has to go through to help us out.

I tried to make the point that the only good approach is to remove our 
current subjective bias from quality metrics and to at least realize 
what a cavalier attitude we still have to QA. The moment we are able to 
_measure_ how bad we are, kernel developers will adopt in a second and 
will improve those metrics. Lets use more debug tools, both static and 
dynamic ones. Lets measure tester base and we need to measure _lost_ 
early adopters and the reasons why they are lost. Regression metrics are 
a very important first step too and i'm very happy about the increasing 
effort that is being spent on this.

This is all QA-101 that _cannot be argued against on a rational basis_, 
it's just that these sorts of things have been largely ignored for 
years, in favor of the all-too-easy "open source means many eyeballs and 
that is our QA" answer, which is a _good_ answer but by far not the most 
intelligent answer! Today "many eyeballs" is simply not good enough and 
nature (and other OS projects) will route us around if we dont change.

We kernel developers have been spoiled by years of abundance in testing 
resources. We squander tons of resources in this area, and we could be 
so much more economic about this without hindering our development model 
in any way. We could be so much better about QA and everyone would 
benefit without having to compromize on the incoming flux of changes - 
it's so much easier to write new features for a high quality kernel.

My current guesstimation is that we are utilizing our current testing 
resources at around 10% efficiency. (i.e. if we did an 'ideal' job we 
could fix 10 times as many bugs with the same size of tester effort!) It 
used to be around 5%. (and i mainly attribute the increase from 5% to 
10% to Andrew and the many other people who do kernel QA - kudos!) 10% 
is still awful and we very much suck.

Paradoxically, the "end product" is still considerably good quality in 
absolute terms because other pieces of our infrastructure are so good 
and powerful, but QA is still a 'weak link' of our path to the user that 
reduces the quality of the end result. We could _really_ be so much 
better without any compromises that hurt.

(and this is in no way directed at the networking folks - it holds for 
all of us. I have one main complaint about networking: the separate 
netdev list is a bad idea - networking regressions should be discussed 
and fixed on lkml, like most other subsystems are. Any artificial split 
of the lk discussion space is bad.)

	Ingo

^ permalink raw reply

* [NET] random : secure_tcp_sequence_number should not assume CONFIG_KTIME_SCALAR
From: Eric Dumazet @ 2007-11-13 13:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, kaber, stable
In-Reply-To: <20071113.035019.268404275.davem@davemloft.net>

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

I discovered one other incorrect use of .tv64 (coming from me, I must 
confess)

I guess this patch is  needed for 2.6.24 and stable (2.6.22 & 2.6.23)

Thank you

[NET] random : secure_tcp_sequence_number should not assume 
CONFIG_KTIME_SCALAR

All 32 bits machines but i386 dont have CONFIG_KTIME_SCALAR. On these 
machines, ktime.tv64
is more than 4 times the (correct) result given by ktime_to_ns()

Again on these machines, using ktime_get_real().tv64 >> 6 give a 32bits 
rollover every 64 seconds,
which is not wanted (less than the 120 s MSL)

Using ktime_to_ns() is the portable way to get nsecs from a ktime, and 
have correct code.


Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>


[-- Attachment #2: random.patch --]
[-- Type: text/plain, Size: 1146 bytes --]

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 1756b1f..5fee056 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1494,7 +1494,7 @@ __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
 	seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK;
 	seq += keyptr->count;
 
-	seq += ktime_get_real().tv64;
+	seq += ktime_to_ns(ktime_get_real());
 
 	return seq;
 }
@@ -1556,7 +1556,7 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
 	 *	overlaps less than one time per MSL (2 minutes).
 	 *	Choosing a clock of 64 ns period is OK. (period of 274 s)
 	 */
-	seq += ktime_get_real().tv64 >> 6;
+	seq += ktime_to_ns(ktime_get_real()) >> 6;
 #if 0
 	printk("init_seq(%lx, %lx, %d, %d) = %d\n",
 	       saddr, daddr, sport, dport, seq);
@@ -1616,7 +1616,7 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
 	seq = half_md4_transform(hash, keyptr->secret);
 	seq |= ((u64)keyptr->count) << (32 - HASH_BITS);
 
-	seq += ktime_get_real().tv64;
+	seq += ktime_to_ns(ktime_get_real());
 	seq &= (1ull << 48) - 1;
 #if 0
 	printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n",

^ permalink raw reply related

* Re: [PATCH][NET] Convert init_timer into setup_timer
From: Arnaldo Carvalho de Melo @ 2007-11-13 13:43 UTC (permalink / raw)
  To: David Miller; +Cc: xemul, netdev, devel
In-Reply-To: <20071113.053421.68786227.davem@davemloft.net>

Em Tue, Nov 13, 2007 at 05:34:21AM -0800, David Miller escreveu:
> From: Pavel Emelyanov <xemul@openvz.org>
> Date: Tue, 13 Nov 2007 16:10:03 +0300
> 
> > Many-many code in the kernel initialized the timer->function 
> > and  timer->data together with calling init_timer(timer). There 
> > is already a helper for this. Use it for networking code.
> > 
> > The patch is HUGE, but makes the code 130 lines shorter 
> > (98 insertions(+), 228 deletions(-)).
> > 
> > Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> I have no objection to this patch, but it is 2.6.25
> material for sure.

Agreed, Pavel, if you want please stick:

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

- Arnaldo

^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Mark Lord @ 2007-11-13 13:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Natalie Protasevich, linux-kernel, netdev, alsa-devel, linux-ide,
	linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <20071113031553.3c7b5c16.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Mon, 12 Nov 2007 22:42:32 -0800 "Natalie Protasevich" <protasnb@gmail.com> wrote:
..
>> with CONFIG_NO_HZ and/or CONFIG_HPET_TIMER set kernel 2.6.23 doesn't
>> boot (ARM, Timer)
>> http://bugzilla.kernel.org/show_bug.cgi?id=9229
>> Kernel: 2.6.23
> 
> No response from developers
..

Note:  that same bug exists/existed on i386 back when NO_HZ was
introduced (2.6.21?).  I still see it from time to time on my Quad core
system (very rare), but not any more on my Duo notebook where it used
to happen about 1 in n boots (n < 10).

AFAICT no fix was ever released for it.



>> Suspend to RAM resume hangs on a tickless (NO_HZ) kernel
>> http://bugzilla.kernel.org/show_bug.cgi?id=9275
>> Kernel: 2.6.23
>> This is HP notebook nc6320 T2400 945GM
> No response from developers
..

I *still* get very slow resume-from-RAM quite often here
(new in 2.6.22 kernel, wasn't there in early 2.6.23-rc*).
Something eventually times out after a minute or so
and it comes back.  Cannot make it happen reliably,
unless I'm in a hurry to get something done.  :)
I suspect USB here, probably the same loopy bug that
we added a "loop limit failsafe" for back in 2.6.21(?).

^ permalink raw reply

* Re: [PATCH][NET] Convert init_timer into setup_timer
From: Pavel Emelyanov @ 2007-11-13 14:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, David Miller; +Cc: netdev, devel
In-Reply-To: <20071113134340.GI3943@ghostprotocols.net>

Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 13, 2007 at 05:34:21AM -0800, David Miller escreveu:
>> From: Pavel Emelyanov <xemul@openvz.org>
>> Date: Tue, 13 Nov 2007 16:10:03 +0300
>>
>>> Many-many code in the kernel initialized the timer->function 
>>> and  timer->data together with calling init_timer(timer). There 
>>> is already a helper for this. Use it for networking code.
>>>
>>> The patch is HUGE, but makes the code 130 lines shorter 
>>> (98 insertions(+), 228 deletions(-)).
>>>
>>> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>> I have no objection to this patch, but it is 2.6.25
>> material for sure.

OK.

> Agreed, Pavel, if you want please stick:
> 
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Thanks! :)

> - Arnaldo
> 


^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Mark Lord @ 2007-11-13 14:08 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andrew Morton, David Miller, protasnb, linux-kernel, netdev,
	alsa-devel, linux-ide, linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <20071113134029.GA30978@elte.hu>

Ingo Molnar wrote:
..
> This is all QA-101 that _cannot be argued against on a rational basis_, 
> it's just that these sorts of things have been largely ignored for 
> years, in favor of the all-too-easy "open source means many eyeballs and 
> that is our QA" answer, which is a _good_ answer but by far not the most 
> intelligent answer! Today "many eyeballs" is simply not good enough and 
> nature (and other OS projects) will route us around if we dont change.
..

QA-101 and "many eyeballs" are not at all in opposition.
The latter is how we find out about bugs on uncommon hardware,
and the former is what we need to track them and overall quality.

A HUGE problem I have with current "efforts", is that once someone
reports a bug, the onus seems to be 99% on the *reporter* to find
the exact line of code or commit.  Ghad what a repressive method.

And if the "developer" who broke the damn thing, or who at least
"claims" to be supporting that code, cannot "reproduce" the bug,
they drop it completely.

Contrast that flawed approach with how Linus does things..
he thinks through the symptoms, matches them to the code,
and figures out what the few possibilities might be,
and feeds back some trial balloon patches for the bug reporter to try.

MUCH better. 

Linus also asks for a git bisect, but doesn't insist upon the reporter
learning an entire new (poorly documented) toolset just to to report a bug.

Blah!

And remember, *I'm* an old-time Linux kernel developer.. just think about
the people reporting bugs who haven't been around here since 1992..

-ml

^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Mark Lord @ 2007-11-13 14:18 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Natalie Protasevich, linux-kernel, netdev, alsa-devel, linux-ide,
	linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <4739ADA2.4060604@rtr.ca>

Mark Lord wrote:
> Andrew Morton wrote:
>> On Mon, 12 Nov 2007 22:42:32 -0800 "Natalie Protasevich" 
>> <protasnb@gmail.com> wrote:
> ..
..
>>> Suspend to RAM resume hangs on a tickless (NO_HZ) kernel
>>> http://bugzilla.kernel.org/show_bug.cgi?id=9275
>>> Kernel: 2.6.23
>>> This is HP notebook nc6320 T2400 945GM
>> No response from developers
> ..
> 
> I *still* get very slow resume-from-RAM quite often here
> (new in 2.6.22 kernel, wasn't there in early 2.6.23-rc*).
..

Typo.  That should have said:

> (new in 2.6.23 kernel, wasn't there in early 2.6.23-rc*).

^ permalink raw reply

* Re: Problem with frame time stamping
From: Antoine Zen-Ruffinen @ 2007-11-13 14:46 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, linux-net, netfilter-devel, patrik.arlos
In-Reply-To: <4739A2FB.8030800@cosmosbay.com>

ok, I now understood where my error was.  It was a mismatch between my
old kernel headers and my new kernel that I am running !!!! Pretty
stupid !

Tank's you for your time, you learn me some stuff, I appreciate it.

Antoine

2007/11/13, Eric Dumazet <dada1@cosmosbay.com>:
> Antoine Zen-Ruffinen a écrit :
> > THIS is what I did at the beginning. But is seem me to be some thing
> > wrong. So I put a static value in skb->tstamp  instead of
> > ktime_get_real() for debug purpose. And I was still becoming the
> > amount of second, microsecond since 1970. We are back to my initial
> > mail ! The value of skb->tsamp doesn't seems to be returned by
> > ioctl().
> >
> OK Antoine.
>
> Yes, 'struct timeval' is as you discovered, ie relative to *something*,
> a given event in the past. (in your case, CLOCK_REALTIME Epoch : January
> 1th 1970)
>
> It is even documented (man gettimeofday)
>
> DESCRIPTION
>        The  gettimeofday() function shall obtain the current time,
> expressed as seconds and microseconds since the Epoch, and store it in the
>        timeval structure pointed to by tp.
>
> For timespec STAMPNS, see clock_gettime() description.
>
> clock_gettime(CLOCK_REALTIME, &ts);
>
> If in your driver you stick in tstamp.tv64 a value like 0x00010002, then
> the result of ioctl(SIOCGSTAMP) will be :
> tv.tv_sec = 0   (so yes, January 1th 1970)
> tv.tv_usec = 65   (because 0x10002/1000 = 65)
>
> Not counting the fact that .tv64 should not be directly set, unless for
> 0 value, because it is not portable.
>
>
>
>
>
>

^ permalink raw reply

* Re: possible bug in tcp_probe
From: SANGTAE HA @ 2007-11-13 14:59 UTC (permalink / raw)
  To: Gavin McCullagh; +Cc: netdev
In-Reply-To: <20071113112615.GA7491@nuim.ie>

Hi Gavin,

This is fixed in the current version of tcp_probe by Stephen.  Please
see the below.

commit 662ad4f8efd3ba2ed710d36003f968b500e6f123
Author: Stephen Hemminger <shemminger@linux-foundation.org>
Date:   Wed Jul 11 19:43:52 2007 -0700

   [TCP]: tcp probe wraparound handling and other changes

   Switch from formatting messages in probe routine and copying with
   kfifo, to using a small circular queue of information and formatting
   on read.  This avoids wraparound issues with kfifo, and saves one
   copy.

   Also make sure to state correct license, rather than copying off some
   other driver I started with.

   Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
   Signed-off-by: David S. Miller <davem@davemloft.net>

You can copy the current version of tcp_probe to your kernel version
and it should work.
Before this has not been fixed, in my case, I changed kfifo not to put
the data if it doesn't have enough space.
I will send you a patch if you want this.

Regards,
Sangtae

On Nov 13, 2007 6:26 AM, Gavin McCullagh <Gavin.McCullagh@nuim.ie> wrote:
> Hi,
>
> I'm using linux v2.6.22.6 and tcp_probe with a couple of small
> modifications[1].
>
> Even with moderately large numbers of flows (16 on the one machine) and
> increasingly as I monitor more flows than that, I get strange overflow
> problems such as this one:
>
> 74.259589763 192.168.2.1 36988 192.168.3.5 5001 0x679c23dc 0x679bc3b4 18 13 9114624 78 76 10000 0 64
> 74.260590660 192.168.2.1 44261 192.168.3.5 5006 0x573bb3ed 0x573b700d 13 9 5254144 155 127 10000 0 64
> 74.261607478 192.168.2.1 44261 192.168.3.5 5006 0x588.066586741 192.168.2.1 33739 192.168.3.5 5009 0xe26d1767 0xe26cf577 2 3 13090816 443 15818 10000 0 64
> 88.066690797 192.168.2.1 33739 192.168.3.5 5009 0xe26d1767 0xe26cfb1f 3 3 13092864 2365 15818 10000 0 64
> 88.067625714 192.168.2.1 59385 192.168.3.5 5012 0x411c1090 0x411bd258 12 9 14578688 2807 15812 10000 0 64
>
> As you can see the third line has been truncated as well as the next
> roughly 14 seconds of data after which data continues writing as usual.
>
> I don't think my small changes are causing this but perhaps I'm wrong.
> Does anyone know what might be causing the above?
>
> Many thanks for any ideas,
> Gavin
>
> [1] I have slightly modified tcp_probe to print out information for a range
> of ports (instead of one port or all) and to print info from the congestion
> avoidance inet_csk_ca struct.  This adds a couple of extra fields to the
> end.  If either of these are of interest as patches I'll happily submit
> them.
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* Re: [PATCH] Add support for the RDC R6040 Fast Ethernet controller
From: Florian Fainelli @ 2007-11-13 11:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, shemminger, jeff
In-Reply-To: <20071112.213132.105717381.davem@davemloft.net>

Le Tuesday 13 November 2007 06:31:32 David Miller, vous avez écrit :
> I've added this to my netdev-2.6 tree, thanks!

Thanks David !



^ permalink raw reply

* Re: possible bug in tcp_probe
From: Gavin McCullagh @ 2007-11-13 15:20 UTC (permalink / raw)
  To: SANGTAE HA; +Cc: netdev
In-Reply-To: <649aecc70711130659p3040b532jff62c69d81414eef@mail.gmail.com>

Hi Sangtae,

On Tue, 13 Nov 2007, SANGTAE HA wrote:

> This is fixed in the current version of tcp_probe by Stephen.  Please
> see the below.

> You can copy the current version of tcp_probe to your kernel version
> and it should work.

Many thanks, I'll give this a try,

Gavin


^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Bartlomiej Zolnierkiewicz @ 2007-11-13 15:21 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Natalie Protasevich, linux-kernel, netdev, alsa-devel, linux-ide,
	linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <20071113031553.3c7b5c16.akpm@linux-foundation.org>

On Nov 13, 2007 12:15 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 12 Nov 2007 22:42:32 -0800 "Natalie Protasevich" <protasnb@gmail.com> wrote:
>
> > This is the listing of the open bugs that are relatively new, around
> > 2.6.22 and up. They are vaguely classified by specific area.
> > (not a full list, there are more :)

[...]

> > IDE/SATA=========================================================

[...]

> > DVD-RAM umount and disk free bug
> > http://bugzilla.kernel.org/show_bug.cgi?id=9265
> > Kernel: 2.6.15  (asked to try current kernel)
>
> No response from developers

Bug was filled under IO/Storage-Other so is it assigned to
<other_other@kernel-bugs.osdl.org>.

Could be a FS problem as well but it is the best to wait for
confirmation with 2.6.23 before proceeding further...

^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Giacomo A. Catenazzi @ 2007-11-13 15:24 UTC (permalink / raw)
  To: Mark Lord
  Cc: Ingo Molnar, Andrew Morton, David Miller, protasnb, linux-kernel,
	netdev, alsa-devel, linux-ide, linux-pcmcia, linux-input,
	bugme-daemon
In-Reply-To: <4739AFE0.20705@rtr.ca>

Mark Lord wrote:
> Ingo Molnar wrote:
> ..
>> This is all QA-101 that _cannot be argued against on a rational 
>> basis_, it's just that these sorts of things have been largely ignored 
>> for years, in favor of the all-too-easy "open source means many 
>> eyeballs and that is our QA" answer, which is a _good_ answer but by 
>> far not the most intelligent answer! Today "many eyeballs" is simply 
>> not good enough and nature (and other OS projects) will route us 
>> around if we dont change.
> ..
> 
> QA-101 and "many eyeballs" are not at all in opposition.
> The latter is how we find out about bugs on uncommon hardware,
> and the former is what we need to track them and overall quality.
> 
> A HUGE problem I have with current "efforts", is that once someone
> reports a bug, the onus seems to be 99% on the *reporter* to find
> the exact line of code or commit.  Ghad what a repressive method.


As a long time kernel tester, I see some problem with the
newer "new development model". In the short merge windows,
after to much time, there are to many patches.
So there are problem to bisect bugs, and to have attention
of developers. My impression is that in a week there are
many more messages in lkml and to much bugs to be
handled in these few days.

I've two proposal:

- better patch quality. I would like that every commit
would compile. So an automatic commit test and public
blames could increase the quality of first commits.
[bisecting with non compilable point it is not a trivial
task]

- a slow down the patch inclusion on the merge windows
(aka: not to much big changes in the first days).
As tester I prefer that some big changes would be
included in a "secondary window" (pre o rc release),
in an other period as the big patch rush.

ciao
	cate

^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: James Bottomley @ 2007-11-13 15:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Natalie Protasevich, linux-kernel, netdev, alsa-devel, linux-ide,
	linux-pcmcia, linux-input, bugme-daemon, linux-scsi
In-Reply-To: <20071113031553.3c7b5c16.akpm@linux-foundation.org>

On Tue, 2007-11-13 at 03:15 -0800, Andrew Morton wrote:
> >
> SCSI==================================================================
> > 
> > qla2xxx: driver initialization does not complete when booting with
> > Port connected
> > http://bugzilla.kernel.org/show_bug.cgi?id=9267
> > Kernel: 2.6.23.1
> 
> No response from developers

Urm, well, if no-one ever tells the SCSI list it's unrealistic to expect
anyone to be working on it.  As far as I can tell, email was sent to
Andrew Vasquez only on 31 October. However, the fault looks to be
generic, so he probably just dropped it.

This seems to be the significant line from the trace:

Oct  7 23:35:07 t-host kernel:   ISP2422: PCI-X Mode 1 (133 MHz) @
0000:01:03.0
hdma-, host#=1, fw=4.00.27 [IP] 
Oct  7 23:35:07 t-host kernel: ACPI: PCI Interrupt 0000:01:03.1[B] -> GSI 29
(level, low) -> IRQ 22
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Found an ISP2422, irq 22,
iobase 0xf8cf4000
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Configuring PCI space...
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Configure NVRAM
parameters...
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Verifying loaded RISC
code...
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Allocated (64 KB) for
EFT...
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: Allocated (1413 KB) for
firmware dump...
Oct  7 23:35:07 t-host kernel: scsi2 : qla2xxx
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.1: 
Oct  7 23:35:07 t-host kernel:  QLogic Fibre Channel HBA Driver: 8.01.07-k7
Oct  7 23:35:07 t-host kernel:   QLogic QLA2462 - PCI-X 2.0 to 4Gb FC, Dual
Channel
Oct  7 23:35:07 t-host kernel:   ISP2422: PCI-X Mode 1 (133 MHz) @ 0000:01:03.1
hdma-, host#=2, fw=4.00.27 [IP] 
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.0: LIP reset occured (f8f7).
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.0: LIP occured (f8f7).
Oct  7 23:35:07 t-host kernel: qla2xxx 0000:01:03.0: LOOP UP detected (4 Gbps).
Oct  7 23:35:07 t-host kernel: ohci_hcd 0000:03:00.0: auto-stop root hub
Oct  7 23:35:07 t-host kernel: ohci_hcd 0000:03:00.1: auto-stop root hub
Oct  7 23:35:07 t-host kernel: scsi 1:0:0:0: Direct-Access     transtec
PV610F16R1C      348B PQ: 0 ANSI: 4
Oct  7 23:35:07 t-host kernel: kobject_add failed for 1:0:0:0 with -EEXIST,
don't try to register things with the same name in the same directory.
Oct  7 23:35:07 t-host kernel:  [<c022c841>] kobject_shadow_add+0x111/0x190
Oct  7 23:35:07 t-host kernel:  [<c0286814>] device_add+0xc4/0x570
Oct  7 23:35:07 t-host kernel:  [<c02c90ce>] scsi_adjust_queue_depth+0x9e/0xf0
Oct  7 23:35:07 t-host kernel:  [<c02249b2>] __blk_queue_init_tags+0x32/0x70
Oct  7 23:35:07 t-host kernel:  [<c02d302f>] scsi_sysfs_add_sdev+0x4f/0x230
Oct  7 23:35:07 t-host kernel:  [<f8d93421>] qla2xxx_slave_configure+0x71/0x100
[qla2xxx]
Oct  7 23:35:07 t-host kernel:  [<c02d0ecf>] scsi_probe_and_add_lun+0xa5f/0xb40
Oct  7 23:35:07 t-host kernel:  [<c02d1559>] __scsi_scan_target+0xd9/0x6c0
Oct  7 23:35:07 t-host kernel:  [<c03a5be1>] schedule+0x2e1/0x950
Oct  7 23:35:07 t-host kernel:  [<c02d21f9>] scsi_scan_target+0xa9/0xe0
Oct  7 23:35:07 t-host kernel:  [<c02d5640>] fc_scsi_scan_rport+0x0/0x80
Oct  7 23:35:07 t-host kernel:  [<c02d56a9>] fc_scsi_scan_rport+0x69/0x80
Oct  7 23:35:07 t-host kernel:  [<c012b032>] run_workqueue+0x72/0x100
Oct  7 23:35:07 t-host kernel:  [<c012e8d0>] prepare_to_wait+0x20/0x70
Oct  7 23:35:07 t-host kernel:  [<c012b8c0>] worker_thread+0x0/0x100
Oct  7 23:35:07 t-host kernel:  [<c012b964>] worker_thread+0xa4/0x100
Oct  7 23:35:07 t-host kernel:  [<c012e720>] autoremove_wake_function+0x0/0x50
Oct  7 23:35:07 t-host kernel:  [<c012b8c0>] worker_thread+0x0/0x100
Oct  7 23:35:07 t-host kernel:  [<c012e462>] kthread+0x42/0x70
Oct  7 23:35:07 t-host kernel:  [<c012e420>] kthread+0x0/0x70
Oct  7 23:35:07 t-host kernel:  [<c0103573>] kernel_thread_helper+0x7/0x14
Oct  7 23:35:07 t-host kernel:  =======================
Oct  7 23:35:07 t-host kernel: error 1

It looks like some type of sysfs/kobject race in SCSI ... and I think we
might have seen it before, just not able to reproduce it reliably.

My bet would be that the LIP which acts like a reset and occurs in the
middle of the scan and so the initialising object is killed on the first
scan but not yet dead and then can't be re-added on the second scan.

Hannes has patches to help with this, but they're rather complex, and
not really 2.6.24 material.  I could see if there's a simpler fix.

James



^ permalink raw reply

* Re: [BUG] New Kernel Bugs
From: Alan Cox @ 2007-11-13 15:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Natalie Protasevich, linux-kernel, netdev, alsa-devel, linux-ide,
	linux-pcmcia, linux-input, bugme-daemon
In-Reply-To: <20071113031553.3c7b5c16.akpm@linux-foundation.org>

> > pata_pdc202xx_old excessive ATA bus errors
> > http://bugzilla.kernel.org/show_bug.cgi?id=9337
> > 2.6.24-rc2
> 
> No response from developers

Untrue. We've been discussing it on list in the past and its now on
bugzilla. Not obvious from outside I realise. That one I'm afraid is
probably a longer term item.

> > DVD-RAM umount and disk free bug
> > http://bugzilla.kernel.org/show_bug.cgi?id=9265
> > Kernel: 2.6.15  (asked to try current kernel)
> 
> No response from developers

Not actually sure who is looking after this now ?

> > LPC IT8705 POST port making noise on parallel port
> > http://bugzilla.kernel.org/show_bug.cgi?id=9306
> > Kernel: 2.6.16+
> > 
> 
> No response from developers

Not sure who really owns parallel. Have grabbed and will sort
out.

^ permalink raw reply

* Re: [NET] netfilter : xt_time should not assume CONFIG_KTIME_SCALAR
From: Patrick McHardy @ 2007-11-13 15:38 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <47399D34.40306@cosmosbay.com>

Eric Dumazet wrote:
> Patrick McHardy a écrit :
>> David Miller wrote:
>>>
>>> Patrick, this is very clearly a correct bug fix, so I'm
>>> going to apply this directly.
>>
>>
>> Thanks, thats obviously correct. Still, I would prefer if
>> people would CC netfilter-devel and myself, it has become
>> a bad habit lately especially to skip netfilter-devel.
>>
>>
> Sorry for forgeting netfilter-devel, I'll try to remember for next time...


Thanks Eric. I missed that I actually was CCed because greylisting
took a bit longer to let it through :)

^ permalink raw reply

* Re: [PATCH]iwlwifi not correctly dealing with hotunplug
From: Dan Williams @ 2007-11-13 15:37 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: netdev
In-Reply-To: <200711131249.25320.oliver@neukum.org>

On Tue, 2007-11-13 at 12:49 +0100, Oliver Neukum wrote:
> It makes no sense to enable interrupts if a device has been unplugged.
> In addition if in doubt IRQ_HANDLED should be returned.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.de>

Might want to forward to linux-wireless@ ?  And maybe cc the ipw2100@
sourceforge upstream lists too.

Dan

> 	Regards
> 		Oliver
> 
> ----
> 
> --- linux-2.6.24-rc1/drivers/net/wireless/iwlwifi/iwl3945-base.c.alt	2007-11-13 12:23:07.000000000 +0100
> +++ linux-2.6.24-rc1/drivers/net/wireless/iwlwifi/iwl3945-base.c	2007-11-13 12:26:00.000000000 +0100
> @@ -4850,7 +4850,7 @@ static irqreturn_t iwl_isr(int irq, void
>  	if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
>  		/* Hardware disappeared */
>  		IWL_WARNING("HARDWARE GONE?? INTA == 0x%080x\n", inta);
> -		goto none;
> +		goto unplugged;
>  	}
>  
>  	IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
> @@ -4858,6 +4858,7 @@ static irqreturn_t iwl_isr(int irq, void
>  
>  	/* iwl_irq_tasklet() will service interrupts and re-enable them */
>  	tasklet_schedule(&priv->irq_tasklet);
> +unplugged:
>  	spin_unlock(&priv->lock);
>  
>  	return IRQ_HANDLED;
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ 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