All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
@ 2007-02-02 12:05 Frank Pavlic
  2007-02-06 22:41 ` David Miller
  2007-02-08 22:00 ` David Miller
  0 siblings, 2 replies; 13+ messages in thread
From: Frank Pavlic @ 2007-02-02 12:05 UTC (permalink / raw)
  To: netdev

Hello,
The Inter-User Communication Vehicle (IUCV) is a z/VM communication facility 
that enables a program running in one virtual machine to communicate with 
another virtual machine, or with a control program, or even with itself. 
The communication takes place over a predefined linkage called a path.
AF_IUCV provides a complete socket interface for socket communication 
from Linux to Linux (running on z/VM) or Linux on VM to CMS.
The AF_IUCV Protocol Support will use IUCV to provide AF_IUCV 
protocol support for communication with z/VM back-end services.
It also can connect socket applications operating in Linux kernels 
running on different VM user IDs, or to connect a Linux 
application to another socket application running in a VM guest.
AF_IUCV is using a different addressing scheme and therefore there is no
chance to use existing drivers like netiucv for such functionality.

The patch set consists of following patches:

[1/7] [S390]: Rewrite of the IUCV base code, part 1
[2/7] [S390]: Rewrite of the IUCV base code, part 2
[3/7] [S390]: Adapt monreader driver to new IUCV API
[4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
[5/7] [S390]: Adapt netiucv driver to new IUCV API
[6/7] [S390]: Adapt special message interface to new IUCV API
[7/7] [S390]: Add AF_IUCV socket support

Basically it will remove the old IUCV base code from drivers/s390/net,
adds the new rewritten one to net/iucv.
Then all iucv based device drivers like monreader, 
vmlogrdr, netiucv and special message interface 
will be adapted to the new IUCV API.
The last patch then adds the AF_IUCV socket support residing
in net/iucv either.

I am asking for integration now and of course 
code review comments and suggestions are very appreciated .

Thank you very much

Frank

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
  2007-02-02 12:05 [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
@ 2007-02-06 22:41 ` David Miller
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
                     ` (2 more replies)
  2007-02-08 22:00 ` David Miller
  1 sibling, 3 replies; 13+ messages in thread
From: David Miller @ 2007-02-06 22:41 UTC (permalink / raw)
  To: fpavlic; +Cc: netdev

From: Frank Pavlic <fpavlic@de.ibm.com>
Date: Fri, 2 Feb 2007 13:05:28 +0100

> The patch set consists of following patches:
> 
> [1/7] [S390]: Rewrite of the IUCV base code, part 1
> [2/7] [S390]: Rewrite of the IUCV base code, part 2
> [3/7] [S390]: Adapt monreader driver to new IUCV API
> [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> [5/7] [S390]: Adapt netiucv driver to new IUCV API
> [6/7] [S390]: Adapt special message interface to new IUCV API
> [7/7] [S390]: Add AF_IUCV socket support

I have no fundamental objections to this, although I think
I'll end up needing something similar on Niagara at some
point :-)

The list ate the first patch due to it's size.  Could you
email me a copy privately so can integrate all of your work
into my net-2.6.21 tree?

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] NET : cleanup sock_from_file()
  2007-02-06 22:41 ` David Miller
@ 2007-02-06 23:03   ` Eric Dumazet
  2007-02-08 21:35     ` [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer Eric Dumazet
                       ` (4 more replies)
  2007-02-07 10:31   ` [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
  2007-02-07 11:36   ` Frank Pavlic
  2 siblings, 5 replies; 13+ messages in thread
From: Eric Dumazet @ 2007-02-06 23:03 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

I believe dead code from sock_from_file() can be cleaned up.

All sockets are now built using sock_attach_fd(), that puts the 'sock' pointer 
into file->private_data and &socket_file_ops into file->f_op

I could not find a place where file->private_data could be set to NULL, 
keeping opened the file.

So to get 'sock' from a 'file' pointer, either :

- This is a socket file (f_op == &socket_file_ops), and we can directly get 
'sock' from private_data.
- This is not a socket, we return -ENOTSOCK and dont even try to find a socket 
via dentry/inode :)

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

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

--- linux/net/socket.c	2007-02-07 00:37:44.000000000 +0100
+++ linux-ed/net/socket.c	2007-02-07 00:43:36.000000000 +0100
@@ -407,24 +407,11 @@ int sock_map_fd(struct socket *sock)
 
 static struct socket *sock_from_file(struct file *file, int *err)
 {
-	struct inode *inode;
-	struct socket *sock;
-
 	if (file->f_op == &socket_file_ops)
 		return file->private_data;	/* set in sock_map_fd */
 
-	inode = file->f_path.dentry->d_inode;
-	if (!S_ISSOCK(inode->i_mode)) {
-		*err = -ENOTSOCK;
-		return NULL;
-	}
-
-	sock = SOCKET_I(inode);
-	if (sock->file != file) {
-		printk(KERN_ERR "socki_lookup: socket file changed!\n");
-		sock->file = file;
-	}
-	return sock;
+	*err = -ENOTSOCK;
+	return NULL;
 }
 
 /**

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
  2007-02-06 22:41 ` David Miller
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
@ 2007-02-07 10:31   ` Frank Pavlic
  2007-02-07 11:36   ` Frank Pavlic
  2 siblings, 0 replies; 13+ messages in thread
From: Frank Pavlic @ 2007-02-07 10:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote:
> From: Frank Pavlic <fpavlic@de.ibm.com>
> Date: Fri, 2 Feb 2007 13:05:28 +0100
> 
> > The patch set consists of following patches:
> > 
> > [1/7] [S390]: Rewrite of the IUCV base code, part 1
> > [2/7] [S390]: Rewrite of the IUCV base code, part 2
> > [3/7] [S390]: Adapt monreader driver to new IUCV API
> > [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> > [5/7] [S390]: Adapt netiucv driver to new IUCV API
> > [6/7] [S390]: Adapt special message interface to new IUCV API
> > [7/7] [S390]: Add AF_IUCV socket support
> 
> I have no fundamental objections to this, although I think
> I'll end up needing something similar on Niagara at some
> point :-)
> 
> The list ate the first patch due to it's size.  Could you
> email me a copy privately so can integrate all of your work
> into my net-2.6.21 tree?
> 
> Thanks.
> -
Dave,
Really good news for me, I just have started to split the first patch :-)
Thank you 
I send you a copy privately...

Frank

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
  2007-02-06 22:41 ` David Miller
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
  2007-02-07 10:31   ` [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
@ 2007-02-07 11:36   ` Frank Pavlic
  2 siblings, 0 replies; 13+ messages in thread
From: Frank Pavlic @ 2007-02-07 11:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote:
> From: Frank Pavlic <fpavlic@de.ibm.com>
> Date: Fri, 2 Feb 2007 13:05:28 +0100
> 
> > The patch set consists of following patches:
> > 
> > [1/7] [S390]: Rewrite of the IUCV base code, part 1
> > [2/7] [S390]: Rewrite of the IUCV base code, part 2
> > [3/7] [S390]: Adapt monreader driver to new IUCV API
> > [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> > [5/7] [S390]: Adapt netiucv driver to new IUCV API
> > [6/7] [S390]: Adapt special message interface to new IUCV API
> > [7/7] [S390]: Add AF_IUCV socket support
> 
> I have no fundamental objections to this, although I think
> I'll end up needing something similar on Niagara at some
> point :-)
I guess there are and will be more than two guys needing such a vehicle.
With all the virtualization support in Linux we have right now
and the stuff which will come in the future IMO we will need some kind
of a generic inter-communication infrastructure (what a wording :-) )
in Linux . 
> 
> The list ate the first patch due to it's size.  Could you
> email me a copy privately so can integrate all of your work
> into my net-2.6.21 tree?
> 
> Thanks.
> -
> 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	[flat|nested] 13+ messages in thread

* [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
@ 2007-02-08 21:35     ` Eric Dumazet
  2007-02-08 21:36     ` [PATCH 3/5] NET : Convert ipv6 " Eric Dumazet
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Eric Dumazet @ 2007-02-08 21:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

This patch removes the rt_next pointer from 'struct rtable.u' union, and 
renames u.rt_next to u.dst_rt_next.

It also moves 'struct flowi' right after 'struct dst_entry' to prepare the 
gain on lookups.

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

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

--- linux-2.6.20/include/net/route.h	2007-02-08 21:12:52.000000000 +0100
+++ linux-2.6.20-ed/include/net/route.h	2007-02-08 21:12:52.000000000 +0100
@@ -53,9 +53,11 @@ struct rtable
 	union
 	{
 		struct dst_entry	dst;
-		struct rtable		*rt_next;
 	} u;
 
+	/* Cache lookup keys */
+	struct flowi		fl;
+
 	struct in_device	*idev;
 	
 	unsigned		rt_flags;
@@ -69,9 +71,6 @@ struct rtable
 	/* Info on neighbour */
 	__be32			rt_gateway;
 
-	/* Cache lookup keys */
-	struct flowi		fl;
-
 	/* Miscellaneous cached information */
 	__be32			rt_spec_dst; /* RFC1122 specific destination */
 	struct inet_peer	*peer; /* long-living peer info */
--- linux-2.6.20/net/ipv4/route.c	2007-02-08 21:13:44.000000000 +0100
+++ linux-2.6.20-ed/net/ipv4/route.c	2007-02-08 21:13:44.000000000 +0100
@@ -289,7 +289,7 @@ static struct rtable *rt_cache_get_next(
 {
 	struct rt_cache_iter_state *st = rcu_dereference(seq->private);
 
-	r = r->u.rt_next;
+	r = r->u.dst.rt_next;
 	while (!r) {
 		rcu_read_unlock_bh();
 		if (--st->bucket < 0)
@@ -512,7 +512,7 @@ static __inline__ int rt_fast_clean(stru
 	/* Kill broadcast/multicast entries very aggresively, if they
 	   collide in hash table with more useful entries */
 	return (rth->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) &&
-		rth->fl.iif && rth->u.rt_next;
+		rth->fl.iif && rth->u.dst.rt_next;
 }
 
 static __inline__ int rt_valuable(struct rtable *rth)
@@ -595,10 +595,10 @@ static struct rtable **rt_remove_balance
 		if (((*rthp)->u.dst.flags & DST_BALANCED) != 0  &&
 		    compare_keys(&(*rthp)->fl, &expentry->fl)) {
 			if (*rthp == expentry) {
-				*rthp = rth->u.rt_next;
+				*rthp = rth->u.dst.rt_next;
 				continue;
 			} else {
-				*rthp = rth->u.rt_next;
+				*rthp = rth->u.dst.rt_next;
 				rt_free(rth);
 				if (removed_count)
 					++(*removed_count);
@@ -606,9 +606,9 @@ static struct rtable **rt_remove_balance
 		} else {
 			if (!((*rthp)->u.dst.flags & DST_BALANCED) &&
 			    passedexpired && !nextstep)
-				nextstep = &rth->u.rt_next;
+				nextstep = &rth->u.dst.rt_next;
 
-			rthp = &rth->u.rt_next;
+			rthp = &rth->u.dst.rt_next;
 		}
 	}
 
@@ -649,12 +649,12 @@ static void rt_check_expire(unsigned lon
 				/* Entry is expired even if it is in use */
 				if (time_before_eq(now, rth->u.dst.expires)) {
 					tmo >>= 1;
-					rthp = &rth->u.rt_next;
+					rthp = &rth->u.dst.rt_next;
 					continue;
 				}
 			} else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) {
 				tmo >>= 1;
-				rthp = &rth->u.rt_next;
+				rthp = &rth->u.dst.rt_next;
 				continue;
 			}
 
@@ -668,11 +668,11 @@ static void rt_check_expire(unsigned lon
 				if (!rthp)
 					break;
 			} else {
-				*rthp = rth->u.rt_next;
+				*rthp = rth->u.dst.rt_next;
 				rt_free(rth);
 			}
 #else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
- 			*rthp = rth->u.rt_next;
+ 			*rthp = rth->u.dst.rt_next;
  			rt_free(rth);
 #endif /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
 		}
@@ -706,7 +706,7 @@ static void rt_run_flush(unsigned long d
 		spin_unlock_bh(rt_hash_lock_addr(i));
 
 		for (; rth; rth = next) {
-			next = rth->u.rt_next;
+			next = rth->u.dst.rt_next;
 			rt_free(rth);
 		}
 	}
@@ -840,7 +840,7 @@ static int rt_garbage_collect(void)
 			while ((rth = *rthp) != NULL) {
 				if (!rt_may_expire(rth, tmo, expire)) {
 					tmo >>= 1;
-					rthp = &rth->u.rt_next;
+					rthp = &rth->u.dst.rt_next;
 					continue;
 				}
 #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
@@ -858,12 +858,12 @@ static int rt_garbage_collect(void)
 					if (!rthp)
 						break;
 				} else {
-					*rthp = rth->u.rt_next;
+					*rthp = rth->u.dst.rt_next;
 					rt_free(rth);
 					goal--;
 				}
 #else /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
-				*rthp = rth->u.rt_next;
+				*rthp = rth->u.dst.rt_next;
 				rt_free(rth);
 				goal--;
 #endif /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */
@@ -947,13 +947,13 @@ restart:
 		if (compare_keys(&rth->fl, &rt->fl)) {
 #endif
 			/* Put it first */
-			*rthp = rth->u.rt_next;
+			*rthp = rth->u.dst.rt_next;
 			/*
 			 * Since lookup is lockfree, the deletion
 			 * must be visible to another weakly ordered CPU before
 			 * the insertion at the start of the hash chain.
 			 */
-			rcu_assign_pointer(rth->u.rt_next,
+			rcu_assign_pointer(rth->u.dst.rt_next,
 					   rt_hash_table[hash].chain);
 			/*
 			 * Since lookup is lockfree, the update writes
@@ -983,7 +983,7 @@ restart:
 
 		chain_length++;
 
-		rthp = &rth->u.rt_next;
+		rthp = &rth->u.dst.rt_next;
 	}
 
 	if (cand) {
@@ -994,7 +994,7 @@ restart:
 		 * only 2 entries per bucket. We will see.
 		 */
 		if (chain_length > ip_rt_gc_elasticity) {
-			*candp = cand->u.rt_next;
+			*candp = cand->u.dst.rt_next;
 			rt_free(cand);
 		}
 	}
@@ -1034,13 +1034,13 @@ restart:
 		}
 	}
 
-	rt->u.rt_next = rt_hash_table[hash].chain;
+	rt->u.dst.rt_next = rt_hash_table[hash].chain;
 #if RT_CACHE_DEBUG >= 2
-	if (rt->u.rt_next) {
+	if (rt->u.dst.rt_next) {
 		struct rtable *trt;
 		printk(KERN_DEBUG "rt_cache @%02x: %u.%u.%u.%u", hash,
 		       NIPQUAD(rt->rt_dst));
-		for (trt = rt->u.rt_next; trt; trt = trt->u.rt_next)
+		for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next)
 			printk(" . %u.%u.%u.%u", NIPQUAD(trt->rt_dst));
 		printk("\n");
 	}
@@ -1117,9 +1117,9 @@ static void rt_del(unsigned hash, struct
 	spin_lock_bh(rt_hash_lock_addr(hash));
 	ip_rt_put(rt);
 	for (rthp = &rt_hash_table[hash].chain; *rthp;
-	     rthp = &(*rthp)->u.rt_next)
+	     rthp = &(*rthp)->u.dst.rt_next)
 		if (*rthp == rt) {
-			*rthp = rt->u.rt_next;
+			*rthp = rt->u.dst.rt_next;
 			rt_free(rt);
 			break;
 		}
@@ -1167,7 +1167,7 @@ void ip_rt_redirect(__be32 old_gw, __be3
 				    rth->fl.fl4_src != skeys[i] ||
 				    rth->fl.oif != ikeys[k] ||
 				    rth->fl.iif != 0) {
-					rthp = &rth->u.rt_next;
+					rthp = &rth->u.dst.rt_next;
 					continue;
 				}
 
@@ -1416,7 +1416,7 @@ unsigned short ip_rt_frag_needed(struct 
 
 		rcu_read_lock();
 		for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
-		     rth = rcu_dereference(rth->u.rt_next)) {
+		     rth = rcu_dereference(rth->u.dst.rt_next)) {
 			if (rth->fl.fl4_dst == daddr &&
 			    rth->fl.fl4_src == skeys[i] &&
 			    rth->rt_dst  == daddr &&
@@ -2099,7 +2099,7 @@ int ip_route_input(struct sk_buff *skb, 
 
 	rcu_read_lock();
 	for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
-	     rth = rcu_dereference(rth->u.rt_next)) {
+	     rth = rcu_dereference(rth->u.dst.rt_next)) {
 		if (rth->fl.fl4_dst == daddr &&
 		    rth->fl.fl4_src == saddr &&
 		    rth->fl.iif == iif &&
@@ -2563,7 +2563,7 @@ int __ip_route_output_key(struct rtable 
 
 	rcu_read_lock_bh();
 	for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
-		rth = rcu_dereference(rth->u.rt_next)) {
+		rth = rcu_dereference(rth->u.dst.rt_next)) {
 		if (rth->fl.fl4_dst == flp->fl4_dst &&
 		    rth->fl.fl4_src == flp->fl4_src &&
 		    rth->fl.iif == 0 &&
@@ -2824,7 +2824,7 @@ int ip_rt_dump(struct sk_buff *skb,  str
 			s_idx = 0;
 		rcu_read_lock_bh();
 		for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
-		     rt = rcu_dereference(rt->u.rt_next), idx++) {
+		     rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
 			if (idx < s_idx)
 				continue;
 			skb->dst = dst_clone(&rt->u.dst);

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/5] NET :  Convert ipv6 route to use the new dst_entry 'next' pointer
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
  2007-02-08 21:35     ` [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer Eric Dumazet
@ 2007-02-08 21:36     ` Eric Dumazet
  2007-02-08 21:39     ` [PATCH 4/5] NET : Convert decnet " Eric Dumazet
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Eric Dumazet @ 2007-02-08 21:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

This patch removes the next pointer from 'struct rt6_info.u' union, and 
renames u.next to u.dst.rt6_next.

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


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

--- linux-2.6.20/include/net/ip6_fib.h	2007-02-08 21:20:31.000000000 +0100
+++ linux-2.6.20-ed/include/net/ip6_fib.h	2007-02-08 21:20:31.000000000 +0100
@@ -83,7 +83,6 @@ struct rt6_info
 {
 	union {
 		struct dst_entry	dst;
-		struct rt6_info		*next;
 	} u;
 
 	struct inet6_dev		*rt6i_idev;
--- linux-2.6.20/net/ipv6/route.c	2007-02-08 21:22:58.000000000 +0100
+++ linux-2.6.20-ed/net/ipv6/route.c	2007-02-08 21:22:58.000000000 +0100
@@ -243,7 +243,7 @@ static __inline__ struct rt6_info *rt6_d
 	struct rt6_info *sprt;
 
 	if (oif) {
-		for (sprt = rt; sprt; sprt = sprt->u.next) {
+		for (sprt = rt; sprt; sprt = sprt->u.dst.rt6_next) {
 			struct net_device *dev = sprt->rt6i_dev;
 			if (dev->ifindex == oif)
 				return sprt;
@@ -367,7 +367,7 @@ static struct rt6_info *rt6_select(struc
 
 	for (rt = rt0, metric = rt0->rt6i_metric;
 	     rt && rt->rt6i_metric == metric && (!last || rt != rt0);
-	     rt = rt->u.next) {
+	     rt = rt->u.dst.rt6_next) {
 		int m;
 
 		if (rt6_check_expired(rt))
@@ -395,9 +395,9 @@ static struct rt6_info *rt6_select(struc
 		/* no entries matched; do round-robin */
 		static DEFINE_SPINLOCK(lock);
 		spin_lock(&lock);
-		*head = rt0->u.next;
-		rt0->u.next = last->u.next;
-		last->u.next = rt0;
+		*head = rt0->u.dst.rt6_next;
+		rt0->u.dst.rt6_next = last->u.dst.rt6_next;
+		last->u.dst.rt6_next = rt0;
 		spin_unlock(&lock);
 	}
 
@@ -1269,7 +1269,7 @@ static int ip6_route_del(struct fib6_con
 			 &cfg->fc_src, cfg->fc_src_len);
 	
 	if (fn) {
-		for (rt = fn->leaf; rt; rt = rt->u.next) {
+		for (rt = fn->leaf; rt; rt = rt->u.dst.rt6_next) {
 			if (cfg->fc_ifindex &&
 			    (rt->rt6i_dev == NULL ||
 			     rt->rt6i_dev->ifindex != cfg->fc_ifindex))
@@ -1320,7 +1320,7 @@ static struct rt6_info *__ip6_route_redi
 	read_lock_bh(&table->tb6_lock);
 	fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
 restart:
-	for (rt = fn->leaf; rt; rt = rt->u.next) {
+	for (rt = fn->leaf; rt; rt = rt->u.dst.rt6_next) {
 		/*
 		 * Current route is on-link; redirect is always invalid.
 		 *
@@ -1581,7 +1581,7 @@ static struct rt6_info *rt6_get_route_in
 	if (!fn)
 		goto out;
 
-	for (rt = fn->leaf; rt; rt = rt->u.next) {
+	for (rt = fn->leaf; rt; rt = rt->u.dst.rt6_next) {
 		if (rt->rt6i_dev->ifindex != ifindex)
 			continue;
 		if ((rt->rt6i_flags & (RTF_ROUTEINFO|RTF_GATEWAY)) != (RTF_ROUTEINFO|RTF_GATEWAY))
@@ -1632,7 +1632,7 @@ struct rt6_info *rt6_get_dflt_router(str
 		return NULL;
 
 	write_lock_bh(&table->tb6_lock);
-	for (rt = table->tb6_root.leaf; rt; rt=rt->u.next) {
+	for (rt = table->tb6_root.leaf; rt; rt=rt->u.dst.rt6_next) {
 		if (dev == rt->rt6i_dev &&
 		    ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) &&
 		    ipv6_addr_equal(&rt->rt6i_gateway, addr))
@@ -1675,7 +1675,7 @@ void rt6_purge_dflt_routers(void)
 
 restart:
 	read_lock_bh(&table->tb6_lock);
-	for (rt = table->tb6_root.leaf; rt; rt = rt->u.next) {
+	for (rt = table->tb6_root.leaf; rt; rt = rt->u.dst.rt6_next) {
 		if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) {
 			dst_hold(&rt->u.dst);
 			read_unlock_bh(&table->tb6_lock);
--- linux-2.6.20/net/ipv6/ip6_fib.c	2007-02-08 21:26:36.000000000 +0100
+++ linux-2.6.20-ed/net/ipv6/ip6_fib.c	2007-02-08 21:26:36.000000000 +0100
@@ -298,7 +298,7 @@ static int fib6_dump_node(struct fib6_wa
 	int res;
 	struct rt6_info *rt;
 
-	for (rt = w->leaf; rt; rt = rt->u.next) {
+	for (rt = w->leaf; rt; rt = rt->u.dst.rt6_next) {
 		res = rt6_dump_route(rt, w->args);
 		if (res < 0) {
 			/* Frame is full, suspend walking */
@@ -624,11 +624,11 @@ static int fib6_add_rt2node(struct fib6_
 	    fn->leaf == &ip6_null_entry &&
 	    !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ){
 		fn->leaf = rt;
-		rt->u.next = NULL;
+		rt->u.dst.rt6_next = NULL;
 		goto out;
 	}
 
-	for (iter = fn->leaf; iter; iter=iter->u.next) {
+	for (iter = fn->leaf; iter; iter=iter->u.dst.rt6_next) {
 		/*
 		 *	Search for duplicates
 		 */
@@ -656,7 +656,7 @@ static int fib6_add_rt2node(struct fib6_
 		if (iter->rt6i_metric > rt->rt6i_metric)
 			break;
 
-		ins = &iter->u.next;
+		ins = &iter->u.dst.rt6_next;
 	}
 
 	/*
@@ -664,7 +664,7 @@ static int fib6_add_rt2node(struct fib6_
 	 */
 
 out:
-	rt->u.next = iter;
+	rt->u.dst.rt6_next = iter;
 	*ins = rt;
 	rt->rt6i_node = fn;
 	atomic_inc(&rt->rt6i_ref);
@@ -1105,7 +1105,7 @@ static void fib6_del_route(struct fib6_n
 	RT6_TRACE("fib6_del_route\n");
 
 	/* Unlink it */
-	*rtp = rt->u.next;
+	*rtp = rt->u.dst.rt6_next;
 	rt->rt6i_node = NULL;
 	rt6_stats.fib_rt_entries--;
 	rt6_stats.fib_discarded_routes++;
@@ -1115,14 +1115,14 @@ static void fib6_del_route(struct fib6_n
 	FOR_WALKERS(w) {
 		if (w->state == FWS_C && w->leaf == rt) {
 			RT6_TRACE("walker %p adjusted by delroute\n", w);
-			w->leaf = rt->u.next;
+			w->leaf = rt->u.dst.rt6_next;
 			if (w->leaf == NULL)
 				w->state = FWS_U;
 		}
 	}
 	read_unlock(&fib6_walker_lock);
 
-	rt->u.next = NULL;
+	rt->u.dst.rt6_next = NULL;
 
 	if (fn->leaf == NULL && fn->fn_flags&RTN_TL_ROOT)
 		fn->leaf = &ip6_null_entry;
@@ -1190,7 +1190,7 @@ int fib6_del(struct rt6_info *rt, struct
 	 *	Walk the leaf entries looking for ourself
 	 */
 
-	for (rtp = &fn->leaf; *rtp; rtp = &(*rtp)->u.next) {
+	for (rtp = &fn->leaf; *rtp; rtp = &(*rtp)->u.dst.rt6_next) {
 		if (*rtp == rt) {
 			fib6_del_route(fn, rtp, info);
 			return 0;
@@ -1317,7 +1317,7 @@ static int fib6_clean_node(struct fib6_w
 	struct rt6_info *rt;
 	struct fib6_cleaner_t *c = (struct fib6_cleaner_t*)w;
 
-	for (rt = w->leaf; rt; rt = rt->u.next) {
+	for (rt = w->leaf; rt; rt = rt->u.dst.rt6_next) {
 		res = c->func(rt, c->arg);
 		if (res < 0) {
 			w->leaf = rt;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/5] NET : Convert decnet route to use the new dst_entry 'next' pointer
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
  2007-02-08 21:35     ` [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer Eric Dumazet
  2007-02-08 21:36     ` [PATCH 3/5] NET : Convert ipv6 " Eric Dumazet
@ 2007-02-08 21:39     ` Eric Dumazet
  2007-02-08 21:44       ` [PATCH 4/5 resend] " Eric Dumazet
  2007-02-08 21:41     ` [PATCH 5/5] NET : Reorder fields of struct dst_entry Eric Dumazet
  2007-02-08 23:00     ` [PATCH] NET : cleanup sock_from_file() David Miller
  4 siblings, 1 reply; 13+ messages in thread
From: Eric Dumazet @ 2007-02-08 21:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

This patch removes the next pointer from 'struct rt6_info.u' union, and 
renames u.next to u.dst.rt6_next.

It also moves 'struct flowi' right after 'struct dst_entry' to prepare speedup 
lookups.

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 5/5] NET : Reorder fields of struct dst_entry
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
                       ` (2 preceding siblings ...)
  2007-02-08 21:39     ` [PATCH 4/5] NET : Convert decnet " Eric Dumazet
@ 2007-02-08 21:41     ` Eric Dumazet
  2007-02-08 23:00     ` [PATCH] NET : cleanup sock_from_file() David Miller
  4 siblings, 0 replies; 13+ messages in thread
From: Eric Dumazet @ 2007-02-08 21:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

This last patch (but not least :) ) finally moves the next pointer at the end 
of struct dst_entry. This permits to perform route cache lookups with a 
minimal cost of one cache line per entry, instead of two.

Both 32bits and 64bits platforms benefit from this new layout.

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



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

--- linux-2.6.20/include/net/dst.h.inter	2007-02-08 21:43:21.000000000 +0100
+++ linux-2.6.20-ed/include/net/dst.h	2007-02-08 21:43:21.000000000 +0100
@@ -37,14 +37,7 @@ struct sk_buff;
 
 struct dst_entry
 {
-	union {
-		struct dst_entry *next;
-		struct rtable    *rt_next;
-		struct rt6_info   *rt6_next;
-		struct dn_route  *dn_next;
-	};
-	atomic_t		__refcnt;	/* client references	*/
-	int			__use;
+	struct rcu_head		rcu_head;
 	struct dst_entry	*child;
 	struct net_device       *dev;
 	short			error;
@@ -55,7 +48,6 @@ struct dst_entry
 #define DST_NOPOLICY		4
 #define DST_NOHASH		8
 #define DST_BALANCED            0x10
-	unsigned long		lastuse;
 	unsigned long		expires;
 
 	unsigned short		header_len;	/* more space at head required */
@@ -80,8 +72,16 @@ struct dst_entry
 #endif
 
 	struct  dst_ops	        *ops;
-	struct rcu_head		rcu_head;
 		
+	unsigned long		lastuse;
+	atomic_t		__refcnt;	/* client references	*/
+	int			__use;
+	union {
+		struct dst_entry *next;
+		struct rtable    *rt_next;
+		struct rt6_info   *rt6_next;
+		struct dn_route  *dn_next;
+	};
 	char			info[0];
 };
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/5 resend] NET : Convert decnet route to use the new dst_entry 'next' pointer
  2007-02-08 21:39     ` [PATCH 4/5] NET : Convert decnet " Eric Dumazet
@ 2007-02-08 21:44       ` Eric Dumazet
  0 siblings, 0 replies; 13+ messages in thread
From: Eric Dumazet @ 2007-02-08 21:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

This patch removes the next pointer from 'struct rt6_info.u' union, and 
renames u.next to u.dst.rt6_next.

It also moves 'struct flowi' right after 'struct dst_entry' to prepare speedup 
lookups.

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


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

--- linux-2.6.20/include/net/dn_route.h.orig	2007-02-08 21:36:15.000000000 +0100
+++ linux-2.6.20-ed/include/net/dn_route.h	2007-02-08 21:36:15.000000000 +0100
@@ -68,9 +68,10 @@ extern void dn_rt_cache_flush(int delay)
 struct dn_route {
 	union {
 		struct dst_entry dst;
-		struct dn_route *rt_next;
 	} u;
 
+	struct flowi fl;
+
 	__le16 rt_saddr;
 	__le16 rt_daddr;
 	__le16 rt_gateway;
@@ -80,8 +81,6 @@ struct dn_route {
 
 	unsigned rt_flags;
 	unsigned rt_type;
-
-	struct flowi fl;
 };
 
 extern void dn_route_init(void);
--- linux-2.6.20/net/decnet/dn_route.c.orig	2007-02-08 21:39:03.000000000 +0100
+++ linux-2.6.20-ed/net/decnet/dn_route.c	2007-02-08 21:39:03.000000000 +0100
@@ -167,11 +167,11 @@ static void dn_dst_check_expire(unsigned
 		while((rt=*rtp) != NULL) {
 			if (atomic_read(&rt->u.dst.__refcnt) ||
 					(now - rt->u.dst.lastuse) < expire) {
-				rtp = &rt->u.rt_next;
+				rtp = &rt->u.dst.dn_next;
 				continue;
 			}
-			*rtp = rt->u.rt_next;
-			rt->u.rt_next = NULL;
+			*rtp = rt->u.dst.dn_next;
+			rt->u.dst.dn_next = NULL;
 			dnrt_free(rt);
 		}
 		spin_unlock(&dn_rt_hash_table[i].lock);
@@ -198,11 +198,11 @@ static int dn_dst_gc(void)
 		while((rt=*rtp) != NULL) {
 			if (atomic_read(&rt->u.dst.__refcnt) ||
 					(now - rt->u.dst.lastuse) < expire) {
-				rtp = &rt->u.rt_next;
+				rtp = &rt->u.dst.dn_next;
 				continue;
 			}
-			*rtp = rt->u.rt_next;
-			rt->u.rt_next = NULL;
+			*rtp = rt->u.dst.dn_next;
+			rt->u.dst.dn_next = NULL;
 			dnrt_drop(rt);
 			break;
 		}
@@ -286,8 +286,8 @@ static int dn_insert_route(struct dn_rou
 	while((rth = *rthp) != NULL) {
 		if (compare_keys(&rth->fl, &rt->fl)) {
 			/* Put it first */
-			*rthp = rth->u.rt_next;
-			rcu_assign_pointer(rth->u.rt_next,
+			*rthp = rth->u.dst.dn_next;
+			rcu_assign_pointer(rth->u.dst.dn_next,
 					   dn_rt_hash_table[hash].chain);
 			rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth);
 
@@ -300,10 +300,10 @@ static int dn_insert_route(struct dn_rou
 			*rp = rth;
 			return 0;
 		}
-		rthp = &rth->u.rt_next;
+		rthp = &rth->u.dst.dn_next;
 	}
 
-	rcu_assign_pointer(rt->u.rt_next, dn_rt_hash_table[hash].chain);
+	rcu_assign_pointer(rt->u.dst.dn_next, dn_rt_hash_table[hash].chain);
 	rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt);
 	
 	dst_hold(&rt->u.dst);
@@ -326,8 +326,8 @@ void dn_run_flush(unsigned long dummy)
 			goto nothing_to_declare;
 
 		for(; rt; rt=next) {
-			next = rt->u.rt_next;
-			rt->u.rt_next = NULL;
+			next = rt->u.dst.dn_next;
+			rt->u.dst.dn_next = NULL;
 			dst_free((struct dst_entry *)rt);
 		}
 
@@ -1169,7 +1169,7 @@ static int __dn_route_output_key(struct 
 	if (!(flags & MSG_TRYHARD)) {
 		rcu_read_lock_bh();
 		for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt;
-			rt = rcu_dereference(rt->u.rt_next)) {
+			rt = rcu_dereference(rt->u.dst.dn_next)) {
 			if ((flp->fld_dst == rt->fl.fld_dst) &&
 			    (flp->fld_src == rt->fl.fld_src) &&
 			    (flp->mark == rt->fl.mark) &&
@@ -1443,7 +1443,7 @@ int dn_route_input(struct sk_buff *skb)
 
 	rcu_read_lock();
 	for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt != NULL;
-	    rt = rcu_dereference(rt->u.rt_next)) {
+	    rt = rcu_dereference(rt->u.dst.dn_next)) {
 		if ((rt->fl.fld_src == cb->src) &&
 	 	    (rt->fl.fld_dst == cb->dst) &&
 		    (rt->fl.oif == 0) &&
@@ -1627,7 +1627,7 @@ int dn_cache_dump(struct sk_buff *skb, s
 		rcu_read_lock_bh();
 		for(rt = rcu_dereference(dn_rt_hash_table[h].chain), idx = 0;
 			rt;
-			rt = rcu_dereference(rt->u.rt_next), idx++) {
+			rt = rcu_dereference(rt->u.dst.dn_next), idx++) {
 			if (idx < s_idx)
 				continue;
 			skb->dst = dst_clone(&rt->u.dst);
@@ -1673,7 +1673,7 @@ static struct dn_route *dn_rt_cache_get_
 {
 	struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private);
 
-	rt = rt->u.rt_next;
+	rt = rt->u.dst.dn_next;
 	while(!rt) {
 		rcu_read_unlock_bh();
 		if (--s->bucket < 0)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
  2007-02-02 12:05 [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
  2007-02-06 22:41 ` David Miller
@ 2007-02-08 22:00 ` David Miller
  2007-02-09 19:15   ` Frank Pavlic
  1 sibling, 1 reply; 13+ messages in thread
From: David Miller @ 2007-02-08 22:00 UTC (permalink / raw)
  To: fpavlic; +Cc: netdev

From: Frank Pavlic <fpavlic@de.ibm.com>
Date: Fri, 2 Feb 2007 13:05:28 +0100

> The patch set consists of following patches:
> 
> [1/7] [S390]: Rewrite of the IUCV base code, part 1
> [2/7] [S390]: Rewrite of the IUCV base code, part 2
> [3/7] [S390]: Adapt monreader driver to new IUCV API
> [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> [5/7] [S390]: Adapt netiucv driver to new IUCV API
> [6/7] [S390]: Adapt special message interface to new IUCV API
> [7/7] [S390]: Add AF_IUCV socket support

I've applied all of this, although some of the driver
conversions (notable, patches #5 and #6) didn't apply
cleanly so I applied them by hand.

Watch out for any fallout from this when Linus pulls
these changes in.

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] NET : cleanup sock_from_file()
  2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
                       ` (3 preceding siblings ...)
  2007-02-08 21:41     ` [PATCH 5/5] NET : Reorder fields of struct dst_entry Eric Dumazet
@ 2007-02-08 23:00     ` David Miller
  4 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2007-02-08 23:00 UTC (permalink / raw)
  To: dada1; +Cc: netdev

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Wed, 07 Feb 2007 00:03:25 +0100

> I believe dead code from sock_from_file() can be cleaned up.
> 
> All sockets are now built using sock_attach_fd(), that puts the 'sock' pointer 
> into file->private_data and &socket_file_ops into file->f_op
> 
> I could not find a place where file->private_data could be set to NULL, 
> keeping opened the file.
> 
> So to get 'sock' from a 'file' pointer, either :
> 
> - This is a socket file (f_op == &socket_file_ops), and we can directly get 
> 'sock' from private_data.
> - This is not a socket, we return -ENOTSOCK and dont even try to find a socket 
> via dentry/inode :)
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Looks good to me, applied, thanks Eric.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
  2007-02-08 22:00 ` David Miller
@ 2007-02-09 19:15   ` Frank Pavlic
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Pavlic @ 2007-02-09 19:15 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Thu, Feb 08, 2007 at 02:00:22PM -0800, David Miller wrote:
> From: Frank Pavlic <fpavlic@de.ibm.com>
> Date: Fri, 2 Feb 2007 13:05:28 +0100
>  
> > The patch set consists of following patches:
> > 
> > [1/7] [S390]: Rewrite of the IUCV base code, part 1
> > [2/7] [S390]: Rewrite of the IUCV base code, part 2
> > [3/7] [S390]: Adapt monreader driver to new IUCV API
> > [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> > [5/7] [S390]: Adapt netiucv driver to new IUCV API
> > [6/7] [S390]: Adapt special message interface to new IUCV API
> > [7/7] [S390]: Add AF_IUCV socket support
>  
> I've applied all of this, although some of the driver
> conversions (notable, patches #5 and #6) didn't apply
> cleanly so I applied them by hand.
Thanks for this , I figured that out today by myself and started
to make a new set of patches. You saved me a lot of time and work 
once again ;-)

>  
> Watch out for any fallout from this when Linus pulls
> these changes in.
> 
> Thanks.

I'll do so ...



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-02-09 19:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-02 12:05 [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
2007-02-06 22:41 ` David Miller
2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
2007-02-08 21:35     ` [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer Eric Dumazet
2007-02-08 21:36     ` [PATCH 3/5] NET : Convert ipv6 " Eric Dumazet
2007-02-08 21:39     ` [PATCH 4/5] NET : Convert decnet " Eric Dumazet
2007-02-08 21:44       ` [PATCH 4/5 resend] " Eric Dumazet
2007-02-08 21:41     ` [PATCH 5/5] NET : Reorder fields of struct dst_entry Eric Dumazet
2007-02-08 23:00     ` [PATCH] NET : cleanup sock_from_file() David Miller
2007-02-07 10:31   ` [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
2007-02-07 11:36   ` Frank Pavlic
2007-02-08 22:00 ` David Miller
2007-02-09 19:15   ` Frank Pavlic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.