Re: git-net warnings

2005-12-11 Thread David S. Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Sat, 10 Dec 2005 23:46:36 -0800

 It gets uglier.  This is with just 2.6.15-rc5, linus.patch and
 git-net.patch, btw:

 We get a slab scribble.  ppc64 and x86 seem OK.  For some reason, x86_64
 doesn't like it.

This rules out Ben's AF_UNIX optimizations. :-)  (I assume
git-net.patch is my plain net-2.6 tree, not my full net-2.6.16
tree.  Please correct if I'm wrong)

Looking through the net-2.6 tree there isn't much interesting
in there.

A bunch of netfilter bits, a DECNET fix, a TCP fix for Vegas
congestion control, converting AF_PACKET over to vm_insert_page(),
a tg3 driver bug fix, and a NULL pointer check in some checksum
debugging code.

Only the net-2.6.16 tree has any truly possible suspects in it.
So if this tree didn't have the net-2.6.16 stuff in it, it's
probably some other change.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git-net warnings

2005-12-11 Thread Andrew Morton
David S. Miller [EMAIL PROTECTED] wrote:

 From: Andrew Morton [EMAIL PROTECTED]
 Date: Sat, 10 Dec 2005 23:46:36 -0800
 
  It gets uglier.  This is with just 2.6.15-rc5, linus.patch and
  git-net.patch, btw:
 
  We get a slab scribble.  ppc64 and x86 seem OK.  For some reason, x86_64
  doesn't like it.
 
 This rules out Ben's AF_UNIX optimizations. :-)  (I assume
 git-net.patch is my plain net-2.6 tree, not my full net-2.6.16
 tree.  Please correct if I'm wrong)

Ah, sorry.  -mm's git-net is from
git+ssh://master.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.16.git

I tend to prefer the latest and greatest of everything.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git-net warnings

2005-12-11 Thread David S. Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Sun, 11 Dec 2005 00:19:58 -0800

 Ah, sorry.  -mm's git-net is from
 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.16.git
 
 I tend to prefer the latest and greatest of everything.

Ok.  Ben, you're not off the hook sorry :-)
Maybe that stream sendmsg() AF_UNIX peer socket
reference bump is really needed.

Andrew, does reverting the following make the problem go
away?

diff-tree 918374e04126ac04f42c58905cd3e88d785a8eef (from 
1e0fe0b7e1b017d47930351ec50a3f49d7c7257b)
Author: Benjamin LaHaise [EMAIL PROTECTED]
Date:   Sat Dec 10 11:52:17 2005 -0800

[AF_UNIX]: Remove superfluous reference counting in unix_stream_sendmsg

AF_UNIX stream socket performance on P4 CPUs tends to suffer due to a
lot of pipeline flushes from atomic operations.  The patch below
removes the sock_hold() and sock_put() in unix_stream_sendmsg().  This
should be safe as the socket still holds a reference to its peer which
is only released after the file descriptor's final user invokes
unix_release_sock().  The only consideration is that we must add a
memory barrier before setting the peer initially.

Signed-off-by: Benjamin LaHaise [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index acc73ba..3593b90 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1063,10 +1063,12 @@ restart:
/* Set credentials */
sk-sk_peercred = other-sk_peercred;
 
-   sock_hold(newsk);
-   unix_peer(sk)   = newsk;
sock-state = SS_CONNECTED;
sk-sk_state= TCP_ESTABLISHED;
+   sock_hold(newsk);
+
+   smp_mb__after_atomic_inc(); /* sock_hold() does an atomic_inc() */
+   unix_peer(sk)   = newsk;
 
unix_state_wunlock(sk);
 
@@ -1414,7 +1416,7 @@ static int unix_stream_sendmsg(struct ki
} else {
sunaddr = NULL;
err = -ENOTCONN;
-   other = unix_peer_get(sk);
+   other = unix_peer(sk);
if (!other)
goto out_err;
}
@@ -1476,7 +1478,6 @@ static int unix_stream_sendmsg(struct ki
other-sk_data_ready(other, size);
sent+=size;
}
-   sock_put(other);
 
scm_destroy(siocb-scm);
siocb-scm = NULL;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git-net warnings

2005-12-11 Thread David S. Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Sun, 11 Dec 2005 00:39:42 -0800

 David S. Miller [EMAIL PROTECTED] wrote:
 
  Andrew, does reverting the following make the problem go
   away?
 
 yup.

Ok, thanks for testing.  I'll revert until we figure out
exactly what's going on here.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git-net warnings

2005-12-11 Thread Andrew Morton
David S. Miller [EMAIL PROTECTED] wrote:

 Andrew, does reverting the following make the problem go
  away?

yup.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4][TWSK]: Introduce struct timewait_sock_ops

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

   Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

Best Regards,

- Arnaldo
tree a2bd0ce30e3dd56e9605fe508af4dc18eac9445f
parent 384beca5393a67bab83c2825fe354791b6a27052
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134307585 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134307585 -0200

[TWSK]: Introduce struct timewait_sock_ops

So that we can share several timewait sockets related functions and make the
timewait mini sockets infrastructure closer to the request mini sockets one.

Next changesets will take advantage of this, moving more code out of TCP and
DCCP v4 and v6 to common infrastructure.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 include/linux/ipv6.h |3 +
 include/net/inet_timewait_sock.h |3 +
 include/net/sock.h   |4 +-
 include/net/tcp.h|3 +
 include/net/timewait_sock.h  |   31 +
 net/core/sock.c  |   21 ++-
 net/dccp/ipv4.c  |9 
 net/dccp/ipv6.c  |6 ++-
 net/ipv4/inet_timewait_sock.c|5 +-
 net/ipv4/tcp_ipv4.c  |   71 +++
 net/ipv6/tcp_ipv6.c  |   25 -
 11 files changed, 118 insertions(+), 63 deletions(-)

--

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 7d39085..a0d0489 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -360,7 +360,8 @@ struct tcp6_timewait_sock {
 
 static inline u16 inet6_tw_offset(const struct proto *prot)
 {
-	return prot-twsk_obj_size - sizeof(struct inet6_timewait_sock);
+	return prot-twsk_prot-twsk_obj_size -
+			sizeof(struct inet6_timewait_sock);
 }
 
 static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index ca240f8..e396a65 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -26,6 +26,7 @@
 
 #include net/sock.h
 #include net/tcp_states.h
+#include net/timewait_sock.h
 
 #include asm/atomic.h
 
@@ -200,7 +201,7 @@ static inline void inet_twsk_put(struct 
 		printk(KERN_DEBUG %s timewait_sock %p released\n,
 		   tw-tw_prot-name, tw);
 #endif
-		kmem_cache_free(tw-tw_prot-twsk_slab, tw);
+		kmem_cache_free(tw-tw_prot-twsk_prot-twsk_slab, tw);
 		module_put(owner);
 	}
 }
diff --git a/include/net/sock.h b/include/net/sock.h
index 6036340..d7910e7 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -493,6 +493,7 @@ extern void sk_stream_kill_queues(struct
 extern int sk_wait_data(struct sock *sk, long *timeo);
 
 struct request_sock_ops;
+struct timewait_sock_ops;
 
 /* Networking protocol blocks we attach to sockets.
  * socket layer - transport layer interface
@@ -557,11 +558,10 @@ struct proto {
 	kmem_cache_t		*slab;
 	unsigned int		obj_size;
 
-	kmem_cache_t		*twsk_slab;
-	unsigned int		twsk_obj_size;
 	atomic_t		*orphan_count;
 
 	struct request_sock_ops	*rsk_prot;
+	struct timewait_sock_ops *twsk_prot;
 
 	struct module		*owner;
 
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 83b117a..176221c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -287,6 +287,9 @@ extern int			tcp_rcv_established(struct 
 
 extern void			tcp_rcv_space_adjust(struct sock *sk);
 
+extern int			tcp_twsk_unique(struct sock *sk,
+		struct sock *sktw, void *twp);
+
 static inline void tcp_dec_quickack_mode(struct sock *sk,
 	 const unsigned int pkts)
 {
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h
new file mode 100644
index 000..2544281
--- /dev/null
+++ b/include/net/timewait_sock.h
@@ -0,0 +1,31 @@
+/*
+ * NET		Generic infrastructure for Network protocols.
+ *
+ * Authors:	Arnaldo Carvalho de Melo [EMAIL PROTECTED]
+ *
+ *		This program is free software; you can redistribute it and/or
+ *		modify it under the terms of the GNU General Public License
+ *		as published by the Free Software Foundation; either version
+ *		2 of the License, or (at your option) any later version.
+ */
+#ifndef _TIMEWAIT_SOCK_H
+#define _TIMEWAIT_SOCK_H
+
+#include linux/slab.h
+#include net/sock.h
+
+struct timewait_sock_ops {
+	kmem_cache_t	*twsk_slab;
+	unsigned int	twsk_obj_size;
+	int		(*twsk_unique)(struct sock *sk,
+   struct sock *sktw, void *twp);
+};
+
+static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
+{
+	if (sk-sk_prot-twsk_prot-twsk_unique != NULL)
+		return sk-sk_prot-twsk_prot-twsk_unique(sk, sktw, twp);
+	return 0;
+}
+
+#endif /* _TIMEWAIT_SOCK_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 13cc3be..6465b0e 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1488,7 +1488,7 @@ int proto_register(struct proto *prot, i
 			}
 		}
 
-		if 

[PATCH 2/4][DCCP]: Use reqsk_free in dccp_v4_conn_request

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

   Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

Best Regards,

- Arnaldo
tree ac1d79fd17d21f598047598d408299637b62f37d
parent 582d6eefc1777888941300a74fcb5ecb810fb3a4
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134303864 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134303864 -0200

[DCCP]: Use reqsk_free in dccp_v4_conn_request

Now we have the destructor (dccp_v4_reqsk_destructor) in our request_sock_ops
vtable.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 ipv4.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

--

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 83ea891..acdd96c 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -721,10 +721,7 @@ int dccp_v4_conn_request(struct sock *sk
 	return 0;
 
 drop_and_free:
-	/*
-	 * FIXME: should be reqsk_free after implementing req-rsk_ops
-	 */
-	__reqsk_free(req);
+	reqsk_free(req);
 drop:
 	DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS);
 	dcb-dccpd_reset_code = reset_code;


[PATCH 4/4][INET]: Generalise tcp_v4_hash_connect

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

   Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

Best Regards,

- Arnaldo
tree d1285f31fef358cf1b30deb4bdc0723c006e64e5
parent 96ba4b224c010ad590ff1206f4f6d1cec1389ebf
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134308990 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134308990 -0200

[INET]: Generalise tcp_v4_hash_connect

Renaming it to inet_hash_connect, making it possible to ditch
dccp_v4_hash_connect and share the same code with TCP instead.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 drivers/char/random.c |6 -
 include/linux/random.h|2 
 include/net/inet_hashtables.h |3 
 net/dccp/ipv4.c   |  160 -
 net/ipv4/inet_hashtables.c|  178 ++
 net/ipv4/tcp_ipv4.c   |  173 
 6 files changed, 186 insertions(+), 336 deletions(-)

--

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 7999da2..79b59d9 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1554,10 +1554,8 @@ __u32 secure_tcp_sequence_number(__u32 s
 
 EXPORT_SYMBOL(secure_tcp_sequence_number);
 
-
-
-/* Generate secure starting point for ephemeral TCP port search */
-u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport)
+/* Generate secure starting point for ephemeral IPV4 transport port search */
+u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport)
 {
 	struct keydata *keyptr = get_keyptr();
 	u32 hash[4];
diff --git a/include/linux/random.h b/include/linux/random.h
index 7b2adb3..01424a8 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -52,7 +52,7 @@ extern void get_random_bytes(void *buf, 
 void generate_random_uuid(unsigned char uuid_out[16]);
 
 extern __u32 secure_ip_id(__u32 daddr);
-extern u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport);
+extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport);
 extern u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, 
    __u16 dport);
 extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 07840ba..c83baa7 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -434,4 +434,7 @@ static inline struct sock *inet_lookup(s
 
 	return sk;
 }
+
+extern int inet_hash_connect(struct inet_timewait_death_row *death_row,
+			 struct sock *sk);
 #endif /* _INET_HASHTABLES_H */
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index f8c6a15..2702094 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -54,164 +54,6 @@ void dccp_unhash(struct sock *sk)
 
 EXPORT_SYMBOL_GPL(dccp_unhash);
 
-/* called with local bh disabled */
-static int __dccp_v4_check_established(struct sock *sk, const __u16 lport,
-  struct inet_timewait_sock **twp)
-{
-	struct inet_sock *inet = inet_sk(sk);
-	const u32 daddr = inet-rcv_saddr;
-	const u32 saddr = inet-daddr;
-	const int dif = sk-sk_bound_dev_if;
-	INET_ADDR_COOKIE(acookie, saddr, daddr)
-	const __u32 ports = INET_COMBINED_PORTS(inet-dport, lport);
-	unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet-dport);
-	struct inet_ehash_bucket *head = inet_ehash_bucket(dccp_hashinfo, hash);
-	const struct sock *sk2;
-	const struct hlist_node *node;
-	struct inet_timewait_sock *tw;
-
-	prefetch(head-chain.first);
-	write_lock(head-lock);
-
-	/* Check TIME-WAIT sockets first. */
-	sk_for_each(sk2, node, (head + dccp_hashinfo.ehash_size)-chain) {
-		tw = inet_twsk(sk2);
-
-		if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif))
-			goto not_unique;
-	}
-	tw = NULL;
-
-	/* And established part... */
-	sk_for_each(sk2, node, head-chain) {
-		if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif))
-			goto not_unique;
-	}
-
-	/* Must record num and sport now. Otherwise we will see
-	 * in hash table socket with a funny identity. */
-	inet-num = lport;
-	inet-sport = htons(lport);
-	sk-sk_hash = hash;
-	BUG_TRAP(sk_unhashed(sk));
-	__sk_add_node(sk, head-chain);
-	sock_prot_inc_use(sk-sk_prot);
-	write_unlock(head-lock);
-
-	if (twp != NULL) {
-		*twp = tw;
-		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
-	} else if (tw != NULL) {
-		/* Silly. Should hash-dance instead... */
-		inet_twsk_deschedule(tw, dccp_death_row);
-		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
-
-		inet_twsk_put(tw);
-	}
-
-	return 0;
-
-not_unique:
-	write_unlock(head-lock);
-	return -EADDRNOTAVAIL;
-}
-
-/*
- * Bind a port for a connect operation and hash it.
- */
-static int dccp_v4_hash_connect(struct sock *sk)
-{
-	const unsigned short snum = inet_sk(sk)-num;
- 	struct inet_bind_hashbucket *head;
- 	struct 

[PATCH 1/4][DCCP]: Introduce DCCPv6

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

   Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

Best Regards,

- Arnaldo
tree b70c90d93d9d1855b055e943cf25ec775644af17
parent c084c1a9a00a5d872fa19d4fc206e996dc582c44
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134303282 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134303282 -0200

[DCCP]: Introduce DCCPv6

Still needs mucho polishing, specially in the checksum code, but works just
fine, inet_diag/iproute2 and all 8)

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 Makefile|4 
 ipv6.c  | 1440 
 ipv6.h  |   37 +
 minisocks.c |   13 
 4 files changed, 1493 insertions(+), 1 deletion(-)

--

diff --git a/net/dccp/Makefile b/net/dccp/Makefile
index 344a8da..87b27ff 100644
--- a/net/dccp/Makefile
+++ b/net/dccp/Makefile
@@ -1,3 +1,7 @@
+obj-$(CONFIG_IPV6) += dccp_ipv6.o
+
+dccp_ipv6-y := ipv6.o
+
 obj-$(CONFIG_IP_DCCP) += dccp.o
 
 dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
new file mode 100644
index 000..23058dc
--- /dev/null
+++ b/net/dccp/ipv6.c
@@ -0,0 +1,1440 @@
+/*
+ *	DCCP over IPv6
+ *	Linux INET6 implementation 
+ *
+ *	Based on net/dccp6/ipv6.c
+ *
+ *	Arnaldo Carvalho de Melo [EMAIL PROTECTED]
+ *
+ *	This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#include linux/config.h
+#include linux/module.h
+#include linux/random.h
+#include linux/xfrm.h
+
+#include net/addrconf.h
+#include net/inet_common.h
+#include net/inet_hashtables.h
+#include net/inet6_connection_sock.h
+#include net/inet6_hashtables.h
+#include net/ip6_route.h
+#include net/ipv6.h
+#include net/protocol.h
+#include net/transp_v6.h
+#include net/xfrm.h
+
+#include dccp.h
+#include ipv6.h
+
+static void dccp_v6_ctl_send_reset(struct sk_buff *skb);
+static void dccp_v6_reqsk_send_ack(struct sk_buff *skb,
+   struct request_sock *req);
+static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb);
+
+static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
+
+static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
+static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
+
+static int dccp_v6_get_port(struct sock *sk, unsigned short snum)
+{
+	return inet_csk_get_port(dccp_hashinfo, sk, snum,
+ inet6_csk_bind_conflict);
+}
+
+static void dccp_v6_hash(struct sock *sk)
+{
+	if (sk-sk_state != DCCP_CLOSED) {
+		if (inet_csk(sk)-icsk_af_ops == dccp_ipv6_mapped) {
+			dccp_prot.hash(sk);
+			return;
+		}
+		local_bh_disable();
+		__inet6_hash(dccp_hashinfo, sk);
+		local_bh_enable();
+	}
+}
+
+static inline u16 dccp_v6_check(struct dccp_hdr *dh, int len,
+struct in6_addr *saddr, 
+struct in6_addr *daddr, 
+unsigned long base)
+{
+	return csum_ipv6_magic(saddr, daddr, len, IPPROTO_DCCP, base);
+}
+
+static __u32 dccp_v6_init_sequence(struct sock *sk, struct sk_buff *skb)
+{
+	const struct dccp_hdr *dh = dccp_hdr(skb);
+
+	if (skb-protocol == htons(ETH_P_IPV6))
+		return secure_tcpv6_sequence_number(skb-nh.ipv6h-daddr.s6_addr32,
+		skb-nh.ipv6h-saddr.s6_addr32,
+		dh-dccph_dport,
+		dh-dccph_sport);
+	else
+		return secure_dccp_sequence_number(skb-nh.iph-daddr,
+		   skb-nh.iph-saddr,
+		   dh-dccph_dport,
+		   dh-dccph_sport);
+}
+
+static int __dccp_v6_check_established(struct sock *sk, const __u16 lport,
+   struct inet_timewait_sock **twp)
+{
+	struct inet_sock *inet = inet_sk(sk);
+	const struct ipv6_pinfo *np = inet6_sk(sk);
+	const struct in6_addr *daddr = np-rcv_saddr;
+	const struct in6_addr *saddr = np-daddr;
+	const int dif = sk-sk_bound_dev_if;
+	const u32 ports = INET_COMBINED_PORTS(inet-dport, lport);
+	const unsigned int hash = inet6_ehashfn(daddr, inet-num,
+		saddr, inet-dport);
+	struct inet_ehash_bucket *head = inet_ehash_bucket(dccp_hashinfo, hash);
+	struct sock *sk2;
+	const struct hlist_node *node;
+	struct inet_timewait_sock *tw;
+
+	prefetch(head-chain.first);
+	write_lock(head-lock);
+
+	/* Check TIME-WAIT sockets first. */
+	sk_for_each(sk2, node, (head + dccp_hashinfo.ehash_size)-chain) {
+		const struct inet6_timewait_sock *tw6 = inet6_twsk(sk2);
+
+		tw = inet_twsk(sk2);
+
+		if(*((__u32 *)(tw-tw_dport))	== ports	 
+		   sk2-sk_family		== PF_INET6	 
+		   ipv6_addr_equal(tw6-tw_v6_daddr, saddr)	 
+		   ipv6_addr_equal(tw6-tw_v6_rcv_saddr, daddr) 
+		   sk2-sk_bound_dev_if == sk-sk_bound_dev_if)
+			goto not_unique;
+	}
+	tw = NULL;
+
+	/* And established part... */
+	sk_for_each(sk2, node, 

Re: git-net warnings

2005-12-11 Thread Benjamin LaHaise
On Sat, Dec 10, 2005 at 11:28:33PM -0800, Andrew Morton wrote:
 
 This is from my x86_64 box's boot output:
 
 
 Badness in sk_del_node_init at include/net/sock.h:330

I wonder why this didn't trigger on my box.  It looks like I missed the 
sock_put in the error codepath, which the following fixes.  Does this 
help?

-ben

--- a/net/unix/af_unix.c.old2005-12-11 11:22:13.0 -0500
+++ b/net/unix/af_unix.c2005-12-11 11:54:43.0 -0500
@@ -1492,8 +1492,6 @@
send_sig(SIGPIPE,current,0);
err = -EPIPE;
 out_err:
-if (other)
-   sock_put(other);
scm_destroy(siocb-scm);
siocb-scm = NULL;
return sent ? : err;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] drivers/net/arcnet/: possible cleanups

2005-12-11 Thread Adrian Bunk
This patch contains the following possible cleanups:
- make needlessly global code static
- arcnet.c: don't print the outdated VERSION
- arcnet.c: remove the unneeded EXPORT_SYMBOL(arc_proto_null)
- arcnet.c: remove the unneeded EXPORT_SYMBOL(arcnet_dump_packet)

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

---

This patch was already sent on:
- 30 Oct 2005

 drivers/net/arcnet/arc-rawmode.c |2 +-
 drivers/net/arcnet/arcnet.c  |   17 ++---
 drivers/net/arcnet/rfc1051.c |2 +-
 drivers/net/arcnet/rfc1201.c |2 +-
 include/linux/arcdevice.h|9 -
 5 files changed, 13 insertions(+), 19 deletions(-)
  
diff -puN drivers/net/arcnet/arcnet.c~drivers-net-arcnet-possible-cleanups 
drivers/net/arcnet/arcnet.c
--- devel/drivers/net/arcnet/arcnet.c~drivers-net-arcnet-possible-cleanups  
2005-07-09 01:24:43.0 -0700
+++ devel-akpm/drivers/net/arcnet/arcnet.c  2005-07-09 01:24:43.0 
-0700
@@ -61,6 +59,7 @@ static int null_build_header(struct sk_b
 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
   int length, int bufnum);
 
+static void arcnet_rx(struct net_device *dev, int bufnum);
 
 /*
  * one ArcProto per possible proto ID.  None of the elements of
@@ -71,7 +70,7 @@ static int null_prepare_tx(struct net_de
  struct ArcProto *arc_proto_map[256], *arc_proto_default,
*arc_bcast_proto, *arc_raw_proto;
 
-struct ArcProto arc_proto_null =
+static struct ArcProto arc_proto_null =
 {
.suffix = '?',
.mtu= XMTU,
@@ -90,7 +89,6 @@ EXPORT_SYMBOL(arc_proto_map);
 EXPORT_SYMBOL(arc_proto_default);
 EXPORT_SYMBOL(arc_bcast_proto);
 EXPORT_SYMBOL(arc_raw_proto);
-EXPORT_SYMBOL(arc_proto_null);
 EXPORT_SYMBOL(arcnet_unregister_proto);
 EXPORT_SYMBOL(arcnet_debug);
 EXPORT_SYMBOL(alloc_arcdev);
@@ -118,7 +116,7 @@ static int __init arcnet_init(void)
 
arcnet_debug = debug;
 
-   printk(VERSION);
+   printk(arcnet loaded.\n);
 
 #ifdef ALPHA_WARNING
BUGLVL(D_EXTRA) {
@@ -178,8 +176,8 @@ EXPORT_SYMBOL(arcnet_dump_skb);
  * Dump the contents of an ARCnet buffer
  */
 #if (ARCNET_DEBUG_MAX  (D_RX | D_TX))
-void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc,
-   int take_arcnet_lock)
+static void arcnet_dump_packet(struct net_device *dev, int bufnum,
+  char *desc, int take_arcnet_lock)
 {
struct arcnet_local *lp = dev-priv;
int i, length;
@@ -208,7 +206,10 @@ void arcnet_dump_packet(struct net_devic
 
 }
 
-EXPORT_SYMBOL(arcnet_dump_packet);
+#else
+
+#define arcnet_dump_packet(dev, bufnum, desc,take_arcnet_lock) do { } while (0)
+
 #endif
 
 
@@ -987,7 +988,7 @@ irqreturn_t arcnet_interrupt(int irq, vo
  * This is a generic packet receiver that calls arcnet??_rx depending on the
  * protocol ID found.
  */
-void arcnet_rx(struct net_device *dev, int bufnum)
+static void arcnet_rx(struct net_device *dev, int bufnum)
 {
struct arcnet_local *lp = dev-priv;
struct archdr pkt;
diff -puN drivers/net/arcnet/arc-rawmode.c~drivers-net-arcnet-possible-cleanups 
drivers/net/arcnet/arc-rawmode.c
--- devel/drivers/net/arcnet/arc-rawmode.c~drivers-net-arcnet-possible-cleanups 
2005-07-09 01:24:43.0 -0700
+++ devel-akpm/drivers/net/arcnet/arc-rawmode.c 2005-07-09 01:24:43.0 
-0700
@@ -42,7 +42,7 @@ static int build_header(struct sk_buff *
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
  int bufnum);
 
-struct ArcProto rawmode_proto =
+static struct ArcProto rawmode_proto =
 {
.suffix = 'r',
.mtu= XMTU,
diff -puN drivers/net/arcnet/rfc1051.c~drivers-net-arcnet-possible-cleanups 
drivers/net/arcnet/rfc1051.c
--- devel/drivers/net/arcnet/rfc1051.c~drivers-net-arcnet-possible-cleanups 
2005-07-09 01:24:43.0 -0700
+++ devel-akpm/drivers/net/arcnet/rfc1051.c 2005-07-09 01:24:43.0 
-0700
@@ -43,7 +43,7 @@ static int prepare_tx(struct net_device 
  int bufnum);
 
 
-struct ArcProto rfc1051_proto =
+static struct ArcProto rfc1051_proto =
 {
.suffix = 's',
.mtu= XMTU - RFC1051_HDR_SIZE,
diff -puN drivers/net/arcnet/rfc1201.c~drivers-net-arcnet-possible-cleanups 
drivers/net/arcnet/rfc1201.c
--- devel/drivers/net/arcnet/rfc1201.c~drivers-net-arcnet-possible-cleanups 
2005-07-09 01:24:43.0 -0700
+++ devel-akpm/drivers/net/arcnet/rfc1201.c 2005-07-09 01:24:43.0 
-0700
@@ -43,7 +43,7 @@ static int prepare_tx(struct net_device 
  int bufnum);
 static int continue_tx(struct net_device *dev, int bufnum);
 
-struct ArcProto rfc1201_proto =
+static struct ArcProto rfc1201_proto =
 {
.suffix = 'a',
.mtu= 1500, /* could be more, but some receivers can't 
handle it... */
diff -puN 

[-mm patch] ACX should select, not depend on FW_LOADER

2005-12-11 Thread Adrian Bunk
If a driver needs FW_LOADER, it should select this option, not depend on 
it.


Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

--- linux-2.6.15-rc5-mm2-full/drivers/net/wireless/tiacx/Kconfig.old
2005-12-11 19:04:49.0 +0100
+++ linux-2.6.15-rc5-mm2-full/drivers/net/wireless/tiacx/Kconfig
2005-12-11 19:05:08.0 +0100
@@ -1,6 +1,7 @@
 config ACX
tristate TI acx100/acx111 802.11b/g wireless chipsets
-   depends on NET_RADIO  EXPERIMENTAL  FW_LOADER  (USB || PCI)
+   depends on NET_RADIO  EXPERIMENTAL  (USB || PCI)
+   select FW_LOADER
---help---
A driver for 802.11b/g wireless cards based on
Texas Instruments acx100 and acx111 chipsets.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] net: Remove unneeded kmalloc() return value casts

2005-12-11 Thread Jesper Juhl

Get rid of needless casting of kmalloc() return value in net/


Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
---

 net/bluetooth/hci_conn.c |2 +-
 net/sunrpc/svc.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc5-git1-orig/net/bluetooth/hci_conn.c 2005-10-28 
02:02:08.0 +0200
+++ linux-2.6.15-rc5-git1/net/bluetooth/hci_conn.c  2005-12-11 
19:50:32.0 +0100
@@ -403,7 +403,7 @@ int hci_get_conn_list(void __user *arg)
 
size = sizeof(req) + req.conn_num * sizeof(*ci);
 
-   if (!(cl = (void *) kmalloc(size, GFP_KERNEL)))
+   if (!(cl = kmalloc(size, GFP_KERNEL)))
return -ENOMEM;
 
if (!(hdev = hci_dev_get(req.dev_id))) {
--- linux-2.6.15-rc5-git1-orig/net/sunrpc/svc.c 2005-12-04 18:49:00.0 
+0100
+++ linux-2.6.15-rc5-git1/net/sunrpc/svc.c  2005-12-11 19:54:05.0 
+0100
@@ -167,8 +167,8 @@ svc_create_thread(svc_thread_fn func, st
memset(rqstp, 0, sizeof(*rqstp));
init_waitqueue_head(rqstp-rq_wait);
 
-   if (!(rqstp-rq_argp = (u32 *) kmalloc(serv-sv_xdrsize, GFP_KERNEL))
-|| !(rqstp-rq_resp = (u32 *) kmalloc(serv-sv_xdrsize, GFP_KERNEL))
+   if (!(rqstp-rq_argp = kmalloc(serv-sv_xdrsize, GFP_KERNEL))
+|| !(rqstp-rq_resp = kmalloc(serv-sv_xdrsize, GFP_KERNEL))
 || !svc_init_buffer(rqstp, serv-sv_bufsz))
goto out_thread;
 



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4][FIXED][DCCP]: Introduce DCCPv6

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

  Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

This one has a fix for the problem spotted by Francois, next message will
have the fix for tcp_v6_send_{ack,reset}, the origin of this problem,
[2..4/4] are the same as last series, as we chatted.

Best Regards,

- Arnaldo
tree 3be0bc7ded1550ae7c33f192760410df6536c176
parent c084c1a9a00a5d872fa19d4fc206e996dc582c44
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134349305 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134349305 -0200

[DCCP]: Introduce DCCPv6

Still needs mucho polishing, specially in the checksum code, but works just
fine, inet_diag/iproute2 and all 8)

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 Makefile|4 
 ipv6.c  | 1438 
 ipv6.h  |   37 +
 minisocks.c |   13 
 4 files changed, 1491 insertions(+), 1 deletion(-)

--

diff --git a/net/dccp/Makefile b/net/dccp/Makefile
index 344a8da..87b27ff 100644
--- a/net/dccp/Makefile
+++ b/net/dccp/Makefile
@@ -1,3 +1,7 @@
+obj-$(CONFIG_IPV6) += dccp_ipv6.o
+
+dccp_ipv6-y := ipv6.o
+
 obj-$(CONFIG_IP_DCCP) += dccp.o
 
 dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
new file mode 100644
index 000..a7d2aee
--- /dev/null
+++ b/net/dccp/ipv6.c
@@ -0,0 +1,1438 @@
+/*
+ *	DCCP over IPv6
+ *	Linux INET6 implementation 
+ *
+ *	Based on net/dccp6/ipv6.c
+ *
+ *	Arnaldo Carvalho de Melo [EMAIL PROTECTED]
+ *
+ *	This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#include linux/config.h
+#include linux/module.h
+#include linux/random.h
+#include linux/xfrm.h
+
+#include net/addrconf.h
+#include net/inet_common.h
+#include net/inet_hashtables.h
+#include net/inet6_connection_sock.h
+#include net/inet6_hashtables.h
+#include net/ip6_route.h
+#include net/ipv6.h
+#include net/protocol.h
+#include net/transp_v6.h
+#include net/xfrm.h
+
+#include dccp.h
+#include ipv6.h
+
+static void dccp_v6_ctl_send_reset(struct sk_buff *skb);
+static void dccp_v6_reqsk_send_ack(struct sk_buff *skb,
+   struct request_sock *req);
+static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb);
+
+static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
+
+static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
+static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
+
+static int dccp_v6_get_port(struct sock *sk, unsigned short snum)
+{
+	return inet_csk_get_port(dccp_hashinfo, sk, snum,
+ inet6_csk_bind_conflict);
+}
+
+static void dccp_v6_hash(struct sock *sk)
+{
+	if (sk-sk_state != DCCP_CLOSED) {
+		if (inet_csk(sk)-icsk_af_ops == dccp_ipv6_mapped) {
+			dccp_prot.hash(sk);
+			return;
+		}
+		local_bh_disable();
+		__inet6_hash(dccp_hashinfo, sk);
+		local_bh_enable();
+	}
+}
+
+static inline u16 dccp_v6_check(struct dccp_hdr *dh, int len,
+struct in6_addr *saddr, 
+struct in6_addr *daddr, 
+unsigned long base)
+{
+	return csum_ipv6_magic(saddr, daddr, len, IPPROTO_DCCP, base);
+}
+
+static __u32 dccp_v6_init_sequence(struct sock *sk, struct sk_buff *skb)
+{
+	const struct dccp_hdr *dh = dccp_hdr(skb);
+
+	if (skb-protocol == htons(ETH_P_IPV6))
+		return secure_tcpv6_sequence_number(skb-nh.ipv6h-daddr.s6_addr32,
+		skb-nh.ipv6h-saddr.s6_addr32,
+		dh-dccph_dport,
+		dh-dccph_sport);
+	else
+		return secure_dccp_sequence_number(skb-nh.iph-daddr,
+		   skb-nh.iph-saddr,
+		   dh-dccph_dport,
+		   dh-dccph_sport);
+}
+
+static int __dccp_v6_check_established(struct sock *sk, const __u16 lport,
+   struct inet_timewait_sock **twp)
+{
+	struct inet_sock *inet = inet_sk(sk);
+	const struct ipv6_pinfo *np = inet6_sk(sk);
+	const struct in6_addr *daddr = np-rcv_saddr;
+	const struct in6_addr *saddr = np-daddr;
+	const int dif = sk-sk_bound_dev_if;
+	const u32 ports = INET_COMBINED_PORTS(inet-dport, lport);
+	const unsigned int hash = inet6_ehashfn(daddr, inet-num,
+		saddr, inet-dport);
+	struct inet_ehash_bucket *head = inet_ehash_bucket(dccp_hashinfo, hash);
+	struct sock *sk2;
+	const struct hlist_node *node;
+	struct inet_timewait_sock *tw;
+
+	prefetch(head-chain.first);
+	write_lock(head-lock);
+
+	/* Check TIME-WAIT sockets first. */
+	sk_for_each(sk2, node, (head + dccp_hashinfo.ehash_size)-chain) {
+		const struct inet6_timewait_sock *tw6 = inet6_twsk(sk2);
+
+		tw = inet_twsk(sk2);
+
+		if(*((__u32 *)(tw-tw_dport))	== ports	 
+		   sk2-sk_family		== PF_INET6	 
+		   ipv6_addr_equal(tw6-tw_v6_daddr, saddr)	 
+		   

[PATCH 5/5][TCPv6]: Fix skb leak

2005-12-11 Thread Arnaldo Carvalho de Melo
Hi David,

  Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git

Best Regards,

- Arnaldo
tree 402c2b51d32d31f999fed91365c509d1fbd355c7
parent 9b0c0171dae84125f43b6ca80f9108768863df97
author Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134349890 -0200
committer Arnaldo Carvalho de Melo [EMAIL PROTECTED] 1134349890 -0200

[TCPv6]: Fix skb leak

Spotted by Francois Romieu, thanks! The DCCP case was fixed as
well in another patch.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]

--

 tcp_ipv6.c |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

--

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7a077de..514b57b 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -779,13 +779,12 @@ static void tcp_v6_send_reset(struct sk_
 	/* sk = NULL, but it is safe for now. RST socket required. */
 	if (!ip6_dst_lookup(NULL, buff-dst, fl)) {
 
-		if ((xfrm_lookup(buff-dst, fl, NULL, 0))  0)
+		if (xfrm_lookup(buff-dst, fl, NULL, 0) = 0) {
+			ip6_xmit(NULL, buff, fl, NULL, 0);
+			TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+			TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
 			return;
-
-		ip6_xmit(NULL, buff, fl, NULL, 0);
-		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
-		TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
-		return;
+		}
 	}
 
 	kfree_skb(buff);
@@ -844,11 +843,11 @@ static void tcp_v6_send_ack(struct sk_bu
 	fl.fl_ip_sport = t1-source;
 
 	if (!ip6_dst_lookup(NULL, buff-dst, fl)) {
-		if ((xfrm_lookup(buff-dst, fl, NULL, 0))  0)
+		if (xfrm_lookup(buff-dst, fl, NULL, 0) = 0) {
+			ip6_xmit(NULL, buff, fl, NULL, 0);
+			TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
 			return;
-		ip6_xmit(NULL, buff, fl, NULL, 0);
-		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
-		return;
+		}
 	}
 
 	kfree_skb(buff);


[2.6 patch] remove drivers/net/tulip/xircom_tulip_cb.c

2005-12-11 Thread Adrian Bunk
This patch removes the obsolete drivers/net/tulip/xircom_tulip_cb.c 
driver.


Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

This patch was already sent on:
- 18 Nov 2005

 drivers/net/tulip/Kconfig   |   16 
 drivers/net/tulip/Makefile  |1 
 drivers/net/tulip/xircom_tulip_cb.c | 1748 
 3 files changed, 1 insertion(+), 1764 deletions(-)

--- linux-2.6.15-rc1-mm1-full/drivers/net/tulip/Kconfig.old 2005-11-18 
03:45:53.0 +0100
+++ linux-2.6.15-rc1-mm1-full/drivers/net/tulip/Kconfig 2005-11-18 
03:46:20.0 +0100
@@ -148,7 +148,7 @@
  be called uli526x.
  
 config PCMCIA_XIRCOM
-   tristate Xircom CardBus support (new driver)
+   tristate Xircom CardBus support
depends on NET_TULIP  CARDBUS
---help---
  This driver is for the Digital Tulip Ethernet CardBus adapters.
@@ -160,19 +160,5 @@
  file:Documentation/networking/net-modules.txt.  The module will
  be called xircom_cb.  If unsure, say N.
 
-config PCMCIA_XIRTULIP
-   tristate Xircom Tulip-like CardBus support (old driver)
-   depends on NET_TULIP  CARDBUS  BROKEN_ON_SMP
-   select CRC32
-   ---help---
- This driver is for the Digital Tulip Ethernet CardBus adapters.
- It should work with most DEC 21*4*-based chips/ethercards, as well
- as with work-alike chips from Lite-On (PNIC) and Macronix (MXIC) and
- ASIX.
-
- To compile this driver as a module, choose M here and read
- file:Documentation/networking/net-modules.txt.  The module will
- be called xircom_tulip_cb.  If unsure, say N.
-
 endmenu
 
--- linux-2.6.15-rc1-mm1-full/drivers/net/tulip/Makefile.old2005-11-18 
03:46:32.0 +0100
+++ linux-2.6.15-rc1-mm1-full/drivers/net/tulip/Makefile2005-11-18 
03:46:41.0 +0100
@@ -2,7 +2,6 @@
 # Makefile for the Linux Tulip family network device drivers.
 #
 
-obj-$(CONFIG_PCMCIA_XIRTULIP)  += xircom_tulip_cb.o
 obj-$(CONFIG_PCMCIA_XIRCOM)+= xircom_cb.o
 obj-$(CONFIG_DM9102)   += dmfe.o
 obj-$(CONFIG_WINBOND_840)  += winbond-840.o
--- linux-2.6.15-rc1-mm1-full/drivers/net/tulip/xircom_tulip_cb.c   
2005-10-28 02:02:08.0 +0200
+++ /dev/null   2005-11-08 19:07:57.0 +0100
@@ -1,1748 +0,0 @@
-/* xircom_tulip_cb.c: A Xircom CBE-100 ethernet driver for Linux. */
-/*
-   Written/copyright 1994-1999 by Donald Becker.
-
-   This software may be used and distributed according to the terms
-   of the GNU General Public License, incorporated herein by reference.
-
-   The author may be reached as [EMAIL PROTECTED], or C/O
-   Scyld Computing Corporation
-   410 Severn Ave., Suite 210
-   Annapolis MD 21403
-
-   ---
-
-   Linux kernel-specific changes:
-
-   LK1.0 (Ion Badulescu)
-   - Major cleanup
-   - Use 2.4 PCI API
-   - Support ethtool
-   - Rewrite perfect filter/hash code
-   - Use interrupts for media changes
-
-   LK1.1 (Ion Badulescu)
-   - Disallow negotiation of unsupported full-duplex modes
-*/
-
-#define DRV_NAME   xircom_tulip_cb
-#define DRV_VERSION0.91+LK1.1
-#define DRV_RELDATEOctober 11, 2001
-
-#define CARDBUS 1
-
-/* A few user-configurable values. */
-
-#define xircom_debug debug
-#ifdef XIRCOM_DEBUG
-static int xircom_debug = XIRCOM_DEBUG;
-#else
-static int xircom_debug = 1;
-#endif
-
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 25;
-
-#define MAX_UNITS 4
-/* Used to pass the full-duplex flag, etc. */
-static int full_duplex[MAX_UNITS];
-static int options[MAX_UNITS];
-static int mtu[MAX_UNITS]; /* Jumbo MTU for interfaces. */
-
-/* Keep the ring sizes a power of two for efficiency.
-   Making the Tx ring too large decreases the effectiveness of channel
-   bonding and packet priority.
-   There are no ill effects from too-large receive rings. */
-#define TX_RING_SIZE   16
-#define RX_RING_SIZE   32
-
-/* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
-#ifdef __alpha__
-static int rx_copybreak = 1518;
-#else
-static int rx_copybreak = 100;
-#endif
-
-/*
-  Set the bus performance register.
-   Typical: Set 16 longword cache alignment, no burst limit.
-   Cache alignment bits 15:14   Burst length 13:8
-   No alignment  0x unlimited  0800 8 
longwords
-   40008  longwords0100 1 longword 1000 16 
longwords
-   800016 longwords0200 2 longwords2000 32 
longwords
-   C00032  longwords   0400 4 longwords
-   Warning: many older 486 systems are broken and require setting 
0x00A04800
-  8 longword cache alignment, 8 longword burst.
-   ToDo: Non-Intel setting could be better.
-*/
-
-#if 

[2.6 patch] drivers/net/bonding/bonding.h: extern inline - static inline

2005-12-11 Thread Adrian Bunk
extern inline doesn't make much sense.


Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

This patch was already sent on:
- 18 Nov 2005

 drivers/net/bonding/bonding.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6.15-rc1-mm1-full/drivers/net/bonding/bonding.h.old 2005-11-18 
02:36:37.0 +0100
+++ linux-2.6.15-rc1-mm1-full/drivers/net/bonding/bonding.h 2005-11-18 
02:37:05.0 +0100
@@ -218,7 +218,7 @@
  *
  * Caller must hold bond lock for read
  */
-extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct 
net_device *slave_dev)
+static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct 
net_device *slave_dev)
 {
struct slave *slave = NULL;
int i;
@@ -232,7 +232,7 @@
return slave;
 }
 
-extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
+static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
 {
if (!slave || !slave-dev-master) {
return NULL;
@@ -241,13 +241,13 @@
return (struct bonding *)slave-dev-master-priv;
 }
 
-extern inline void bond_set_slave_inactive_flags(struct slave *slave)
+static inline void bond_set_slave_inactive_flags(struct slave *slave)
 {
slave-state = BOND_STATE_BACKUP;
slave-dev-flags |= IFF_NOARP;
 }
 
-extern inline void bond_set_slave_active_flags(struct slave *slave)
+static inline void bond_set_slave_active_flags(struct slave *slave)
 {
slave-state = BOND_STATE_ACTIVE;
slave-dev-flags = ~IFF_NOARP;

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] drivers/net/Kconfig: indentation fix

2005-12-11 Thread Adrian Bunk
This patch fixes a wrong indentation.


Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

This patch was already sent on:
- 19 Nov 2005

--- linux-2.6.15-rc1-mm2-full/drivers/net/Kconfig.old   2005-11-19 
04:03:27.0 +0100
+++ linux-2.6.15-rc1-mm2-full/drivers/net/Kconfig   2005-11-19 
04:03:38.0 +0100
@@ -129,7 +129,7 @@
 
  If you don't have this card, of course say N.
 
-   source drivers/net/arcnet/Kconfig
+source drivers/net/arcnet/Kconfig
 
 source drivers/net/phy/Kconfig
 


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] drivers/net/gianfar.h: extern inline - static inline

2005-12-11 Thread Adrian Bunk
extern inline doesn't make much sense.


Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

This patch was already sent on:
- 18 Nov 2005

 drivers/net/gianfar.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.15-rc1-mm1-full/drivers/net/gianfar.h.old 2005-11-18 
02:38:02.0 +0100
+++ linux-2.6.15-rc1-mm1-full/drivers/net/gianfar.h 2005-11-18 
02:38:10.0 +0100
@@ -711,14 +711,14 @@
uint32_t msg_enable;
 };
 
-extern inline u32 gfar_read(volatile unsigned *addr)
+static inline u32 gfar_read(volatile unsigned *addr)
 {
u32 val;
val = in_be32(addr);
return val;
 }
 
-extern inline void gfar_write(volatile unsigned *addr, u32 val)
+static inline void gfar_write(volatile unsigned *addr, u32 val)
 {
out_be32(addr, val);
 }

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fw: Re: 2.6.15-rc5-mm2

2005-12-11 Thread Andrew Morton

Odd net behaviour with Dave's net-2.6.16 tree.



Begin forwarded message:

Date: Sun, 11 Dec 2005 16:17:09 +0100
From: Benoit Boissinot [EMAIL PROTECTED]
To: Andrew Morton [EMAIL PROTECTED]
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.15-rc5-mm2


On 12/11/05, Andrew Morton [EMAIL PROTECTED] wrote:

 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15-rc5/2.6.15-rc5-mm2/

 - Many new driver updates and architecture updates

 - New CPU scheduler policy: SCHED_BATCH.

 - New version of the hrtimers code.

I have some issues with this kernel (both issue are reproductible on two
different computers):

- i cannot login with xdm, as soon as i login, the X server restarts.
  Login with startx works (.xinitrc is a symlink to .xsession)
  It works fine with 2.6.15-rc5-mm1.
  If you need any log please ask.

- there is a warning when pinging an inexistent ip
  (it works fine with 2.6.15-rc5-mm1 too)

casaverde tonfa # ping 192.168.1.42
PING 192.168.1.42 (192.168.1.42) 56(84) bytes of data.
WARNING: kernel is not very fresh, upgrade is recommended.
From 192.168.42.1: icmp_seq=2 Destination Host Unreachable

from iputils source code (ping.c):
} else {
static int once;
/* Sigh, IP_RECVERR for raw socket
 * was broken until 2.4.9. So, we ignore
 * the first error and warn on the second.
 */
if (once++ == 1)
fprintf(stderr, \rWARNING: kernel is not very fresh, upgrade 
is recommended.\n);
if (once == 1)
return 0;
}

dmesg and config are attached, please ask if you need something else.

regards,

Benoit

[17179569.184000] Linux version 2.6.15-rc5-mm2-casaverde ([EMAIL PROTECTED]) 
(gcc version 4.0.2 (Gentoo 4.0.2-r1, pie-8.7.8)) #6 Sun Dec 11 16:02:01 CET 2005
[17179569.184000] BIOS-provided physical RAM map:
[17179569.184000]  BIOS-e820:  - 0009f000 (usable)
[17179569.184000]  BIOS-e820: 0009f000 - 000a (reserved)
[17179569.184000]  BIOS-e820: 0010 - 1ffae000 (usable)
[17179569.184000]  BIOS-e820: 1ffae000 - 2000 (reserved)
[17179569.184000]  BIOS-e820: feda - fee0 (reserved)
[17179569.184000]  BIOS-e820: ffb0 - 0001 (reserved)
[17179569.184000] 511MB LOWMEM available.
[17179569.184000] On node 0 totalpages: 130990
[17179569.184000]   DMA zone: 4096 pages, LIFO batch:0
[17179569.184000]   DMA32 zone: 0 pages, LIFO batch:0
[17179569.184000]   Normal zone: 126894 pages, LIFO batch:31
[17179569.184000]   HighMem zone: 0 pages, LIFO batch:0
[17179569.184000] DMI 2.3 present.
[17179569.184000] ACPI: RSDP (v000 DELL  ) @ 
0x000fdf00
[17179569.184000] ACPI: RSDT (v001 DELLCPi R   0x27d5011a ASL  0x0061) 
@ 0x1fff
[17179569.184000] ACPI: FADT (v001 DELLCPi R   0x27d5011a ASL  0x0061) 
@ 0x1fff0400
[17179569.184000] ACPI: ASF! (v016 DELLCPi R   0x27d5011a ASL  0x0061) 
@ 0x1fff0800
[17179569.184000] ACPI: DSDT (v001 INT430 SYSFexxx 0x1001 MSFT 0x010e) 
@ 0x
[17179569.184000] Allocating PCI resources starting at 3000 (gap: 
2000:deda)
[17179569.184000] Built 1 zonelists
[17179569.184000] Local APIC disabled by BIOS -- you can enable it with lapic
[17179569.184000] mapped APIC to d000 (01401000)
[17179569.184000] Enabling fast FPU save and restore... done.
[17179569.184000] Enabling unmasked SIMD FPU exception support... done.
[17179569.184000] Initializing CPU#0
[17179569.184000] Kernel command line: root=/dev/hda5 video=vesa:mtrr vga=0x317 
resume=/dev/hda3
[17179569.184000] CPU 0 irqstacks, hard=c03f9000 soft=c03f8000
[17179569.184000] PID hash table entries: 2048 (order: 11, 32768 bytes)
[0.00] Detected 1598.905 MHz processor.
[6.713094] Using tsc for high-res timesource
[6.713130] Console: colour dummy device 80x25
[6.713822] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[6.714589] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[6.728683] Memory: 515208k/523960k available (2163k kernel code, 8228k 
reserved, 671k data, 180k init, 0k highmem)
[6.728696] Checking if this processor honours the WP bit even in supervisor 
mode... Ok.
[6.805330] Calibrating delay using timer specific routine.. 3201.11 
BogoMIPS (lpj=6402220)
[6.805370] Mount-cache hash table entries: 512
[6.805468] CPU: After generic identify, caps: afe9f9bf   
 0180  
[6.805477] CPU: After vendor identify, caps: afe9f9bf   
 0180  
[6.805486] CPU: L1 I cache: 32K, L1 D cache: 32K
[6.805491] CPU: L2 cache: 2048K
[6.805495] CPU: After all inits, caps: afe9f9bf   0040 
0180  
[6.805501] Intel machine check architecture supported.
[6.805507] Intel machine check reporting enabled on CPU#0.
[6.805517] mtrr: 

Re: 2.6.15-rc5-mm2

2005-12-11 Thread David S. Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Sun, 11 Dec 2005 18:39:32 -0800

 Odd net behaviour with Dave's net-2.6.16 tree.
 ...
 - i cannot login with xdm, as soon as i login, the X server restarts.
   Login with startx works (.xinitrc is a symlink to .xsession)
   It works fine with 2.6.15-rc5-mm1.
   If you need any log please ask.
 
 - there is a warning when pinging an inexistent ip
   (it works fine with 2.6.15-rc5-mm1 too)

32-bit x86 ping binary running on an x86_64 system?  That might be a
clue for the second bug.

The first one is mysterious without some more info.

Can you retest for the ping bug after reverting the following patch?

Thanks.

diff-tree 07dda0399dded840d4d1fde39d1cbb0b37123606 (from 
2fbe0a2c52cafa9e6533d0a1747617a46bf8bac6)
Author: Benjamin LaHaise [EMAIL PROTECTED]
Date:   Sun Dec 11 17:28:15 2005 -0800

[NET]: Avoid atomic xchg() for non-error case

It also looks like there were 2 places where the test on sk_err was 
missing from the event wait logic (in sk_stream_wait_connect and 
sk_stream_wait_memory), while the rest of the sock_error() users look 
to be doing the right thing.  This version of the patch fixes those, 
and cleans up a few places that were testing -sk_err directly.

Signed-off-by: Benjamin LaHaise [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

diff --git a/include/net/sock.h b/include/net/sock.h
index 982b4ec..6036340 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1166,8 +1166,11 @@ static inline int sock_queue_err_skb(str
  
 static inline int sock_error(struct sock *sk)
 {
-   int err = xchg(sk-sk_err, 0);
-   return -err;
+   int err;
+   if (likely(!sk-sk_err))
+   return 0;
+   err = xchg(sk-sk_err, 0);
+   return unlikely(-err);
 }
 
 static inline unsigned long sock_wspace(struct sock *sk)
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index ea616e3..fb031fe 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -287,10 +287,9 @@ int bt_sock_wait_state(struct sock *sk, 
timeo = schedule_timeout(timeo);
lock_sock(sk);
 
-   if (sk-sk_err) {
-   err = sock_error(sk);
+   err = sock_error(sk);
+   if (err)
break;
-   }
}
set_current_state(TASK_RUNNING);
remove_wait_queue(sk-sk_sleep, wait);
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index e3bb11c..95f33cc 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -767,8 +767,9 @@ static int l2cap_sock_sendmsg(struct kio
 
BT_DBG(sock %p, sk %p, sock, sk);
 
-   if (sk-sk_err)
-   return sock_error(sk);
+   err = sock_error(sk);
+   if (err)
+   return err;
 
if (msg-msg_flags  MSG_OOB)
return -EOPNOTSUPP;
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 9cb00dc..6481814 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -637,8 +637,9 @@ static int sco_sock_sendmsg(struct kiocb
 
BT_DBG(sock %p, sk %p, sock, sk);
 
-   if (sk-sk_err)
-   return sock_error(sk);
+   err = sock_error(sk);
+   if (err)
+   return err;
 
if (msg-msg_flags  MSG_OOB)
return -EOPNOTSUPP;
diff --git a/net/core/stream.c b/net/core/stream.c
index 15bfd03..35e2525 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -55,8 +55,9 @@ int sk_stream_wait_connect(struct sock *
int done;
 
do {
-   if (sk-sk_err)
-   return sock_error(sk);
+   int err = sock_error(sk);
+   if (err)
+   return err;
if ((1  sk-sk_state)  ~(TCPF_SYN_SENT | TCPF_SYN_RECV))
return -EPIPE;
if (!*timeo_p)
@@ -67,6 +68,7 @@ int sk_stream_wait_connect(struct sock *
prepare_to_wait(sk-sk_sleep, wait, TASK_INTERRUPTIBLE);
sk-sk_write_pending++;
done = sk_wait_event(sk, timeo_p,
+!sk-sk_err 
 !((1  sk-sk_state)  
   ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)));
finish_wait(sk-sk_sleep, wait);
@@ -137,7 +139,9 @@ int sk_stream_wait_memory(struct sock *s
 
set_bit(SOCK_NOSPACE, sk-sk_socket-flags);
sk-sk_write_pending++;
-   sk_wait_event(sk, current_timeo, sk_stream_memory_free(sk) 
+   sk_wait_event(sk, current_timeo, !sk-sk_err  
+ !(sk-sk_shutdown  
SEND_SHUTDOWN) 
+ sk_stream_memory_free(sk) 
  vm_wait);
sk-sk_write_pending--;
 
diff --git 

Re: [-mm patch] ACX should select, not depend on FW_LOADER

2005-12-11 Thread Denis Vlasenko
On Sunday 11 December 2005 20:29, Adrian Bunk wrote:
 If a driver needs FW_LOADER, it should select this option, not depend on 
 it.
 
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 
 --- linux-2.6.15-rc5-mm2-full/drivers/net/wireless/tiacx/Kconfig.old  
 2005-12-11 19:04:49.0 +0100
 +++ linux-2.6.15-rc5-mm2-full/drivers/net/wireless/tiacx/Kconfig  
 2005-12-11 19:05:08.0 +0100
 @@ -1,6 +1,7 @@
  config ACX
   tristate TI acx100/acx111 802.11b/g wireless chipsets
 - depends on NET_RADIO  EXPERIMENTAL  FW_LOADER  (USB || PCI)
 + depends on NET_RADIO  EXPERIMENTAL  (USB || PCI)
 + select FW_LOADER
   ---help---
   A driver for 802.11b/g wireless cards based on
   Texas Instruments acx100 and acx111 chipsets.

Applied to acx, thanks!
--
vda
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] core: add RFC2863 operstate

2005-12-11 Thread David S. Miller
From: jamal [EMAIL PROTECTED]
Date: Wed, 07 Dec 2005 19:03:17 -0500

 What you in submitting the patch is probably a better approach to break
 any stalemate. I think its time we need to have Dave and Jeff both
 involved - we get to hear other opinions and i dont think the difference
 of opinions is that strong to reach a quick decision either way.

I'll try to look at this some time on Monday, no promises tho :)
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: make reno default for mortals

2005-12-11 Thread David S. Miller
From: David S. Miller [EMAIL PROTECTED]
Date: Tue, 06 Dec 2005 21:08:27 -0800 (PST)

 Then we shouldn't be changing BIC, but instead make a new
 tcp_cubic.c :-)

As I mentioned in my net-2.6.16 rebase posting tonight,
I took care of this.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html