Re: [PATCH] net: Saner thash_entries default with much memory

2007-10-29 Thread David Miller
From: Andi Kleen <[EMAIL PROTECTED]>
Date: Fri, 26 Oct 2007 17:34:17 +0200

> On Fri, Oct 26, 2007 at 05:21:31PM +0200, Jean Delvare wrote:
> > I propose 2 millions of entries as the arbitrary high limit. This
> 
> It's probably still far too large.

I agree.  Perhaps a better number is something on the order of
(512 * 1024) so I think I'll check in a variant of Jean's patch
with just the limit decreased like that.

Using just some back of the envelope calculations, on UP 64-bit
systems each socket uses about 2424 bytes minimum of memory (this is
the sum of tcp_sock, inode, dentry, socket, and file on sparc64 UP).
This is an underestimate because it does not even consider things like
allocator overhead.

Next, machines that service that many sockets typically have them
mostly with full transmit queues talking to a very slow receiver at
the other end.  So let's estimate that on average each socket consumes
about 64K of retransmit queue data.

I think this is an extremely conservative estimate beause it doesn't
even consider overhead coming from struct sk_buff and related state.

So for (512 * 1024) of established sockets we consume roughly 35GB of
memory, this is '((2424 + (64 * 1024)) * (512 * 1024))'.

So to me (512 * 1024) is a very reasonable limit and (with lockdep
and spinlock debugging disabled) this makes the EHASH table consume
8MB on UP 64-bit and ~12MB on SMP 64-bit systems.

Thanks.
-
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] rpc_rdma: we need to cast u64 to unsigned long long for printing

2007-10-29 Thread David Miller
From: Stephen Rothwell <[EMAIL PROTECTED]>
Date: Tue, 30 Oct 2007 16:12:40 +1100

> as some architectures have unsigned long for u64.
> 
> net/sunrpc/xprtrdma/rpc_rdma.c: In function 'rpcrdma_create_chunks':
> net/sunrpc/xprtrdma/rpc_rdma.c:222: warning: format '%llx' expects type 'long 
> long unsigned int', but argument 4 has type 'u64'
> net/sunrpc/xprtrdma/rpc_rdma.c:234: warning: format '%llx' expects type 'long 
> long unsigned int', but argument 5 has type 'u64'
> net/sunrpc/xprtrdma/rpc_rdma.c: In function 'rpcrdma_count_chunks':
> net/sunrpc/xprtrdma/rpc_rdma.c:577: warning: format '%llx' expects type 'long 
> long unsigned int', but argument 4 has type 'u64
> 
> Noticed on PowerPC pseries_defconfig build.
> 
> Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>

I've applied this, thanks Stephen.
-
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] pegasos_eth.c: Fix compile error over MV643XX_ defines

2007-10-29 Thread Luis R. Rodriguez
On 10/29/07, Dale Farnsworth <[EMAIL PROTECTED]> wrote:
> On Mon, Oct 29, 2007 at 05:27:29PM -0400, Luis R. Rodriguez wrote:
> > This commit made an incorrect assumption:
> > --
> > Author: Lennert Buytenhek <[EMAIL PROTECTED]>
> >  Date:   Fri Oct 19 04:10:10 2007 +0200
> >
> > mv643xx_eth: Move ethernet register definitions into private header
> >
> > Move the mv643xx's ethernet-related register definitions from
> > include/linux/mv643xx.h into drivers/net/mv643xx_eth.h, since
> > they aren't of any use outside the ethernet driver.
> >
> > Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
> > Acked-by: Tzachi Perelstein <[EMAIL PROTECTED]>
> > Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
> > --
> >
> > arch/powerpc/platforms/chrp/pegasos_eth.c made use of a 3 defines there.
> >
> > [EMAIL PROTECTED]:~/devel/wireless-2.6$ git-describe
> >
> > v2.6.24-rc1-138-g0119130
> >
> > This patch fixes this by internalizing 3 defines onto pegasos which are
> > simply no longer available elsewhere. Without this your compile will fail
>
> That compile failure was fixed in commit
> 30e69bf4cce16d4c2dcfd629a60fcd8e1aba9fee by Al Viro.
>
> However, as I examine that commit, I see that it defines offsets from
> the eth block in the chip, rather than the full chip registeri block
> as the Pegasos 2 code expects.  So, I think it fixes the compile
> failure, but leaves the Pegasos 2 broken.
>
> Luis, do you have Pegasos 2 hardware?  Can you (or anyone) verify that
> the following patch is needed for the Pegasos 2?

Nope, sorry.

  Luis
-
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: [RFC 1/2] [IPV6] ADDRCONF: Preparation for configurable address selection policy with ifindex.

2007-10-29 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Tue, 30 Oct 2007 14:52:37 +0900 (JST)

> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

What is the substance of this change?  Please add a description of
this to the changelog entry as currently the description is far too
brief and vague.

Even saying simply that the change allows the interface index
to be passed into the address selection routines would be
a great improvement.

Thank you.
-
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: [RFC 2/2] [IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.

2007-10-29 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Tue, 30 Oct 2007 14:52:54 +0900 (JST)

> diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
> new file mode 100644
> index 000..66978a5
> --- /dev/null
> +++ b/include/linux/if_addrlabel.h
> @@ -0,0 +1,55 @@
> +/*
> + * ifaddrlabel.h - netlink interface for address labels
> + *
> + * Copyright (C)2007 USAGI/WIDE Project,  All Rights Reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:

Please, this is just a very primitive header file definiting a
simplistic struct and a few enumerations.  Can't you just GPL it with
just the USAGI/WIDE copyright line, instead of using this complicated
license text?

If it important for the USAGI Project to take credit for this work,
they will receive it fully in the copyright line and the changelog
entry.

Thank you.
-
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


[RFC 2/2] [IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.

2007-10-29 Thread YOSHIFUJI Hideaki / 吉藤英明
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 include/linux/if_addrlabel.h |   55 
 include/linux/rtnetlink.h|7 +
 include/net/addrconf.h   |8 +
 net/ipv6/Makefile|1 +
 net/ipv6/addrconf.c  |   40 +---
 net/ipv6/addrlabel.c |  566 ++
 6 files changed, 646 insertions(+), 31 deletions(-)

diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
new file mode 100644
index 000..66978a5
--- /dev/null
+++ b/include/linux/if_addrlabel.h
@@ -0,0 +1,55 @@
+/*
+ * ifaddrlabel.h - netlink interface for address labels
+ *
+ * Copyright (C)2007 USAGI/WIDE Project,  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LINUX_IF_ADDRLABEL_H
+#define __LINUX_IF_ADDRLABEL_H
+
+struct ifaddrlblmsg
+{
+   __u8ifal_family;/* Address family */
+   __u8__ifal_reserved;/* Reserved */
+   __u8ifal_prefixlen; /* Prefix length */
+   __u8ifal_flags; /* Flags */
+   __u32   ifal_index; /* Link index */
+   __u32   ifal_seq;   /* sequence number */
+};
+
+enum
+{
+   IFAL_ADDRESS = 1,
+   IFAL_LABEL = 2,
+   __IFAL_MAX
+};
+
+#define IFAL_MAX   (__IFAL_MAX - 1)
+
+#endif
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 5bf6182..9a8bf01 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -100,6 +100,13 @@ enum {
RTM_NEWNDUSEROPT = 68,
 #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
 
+   RTM_NEWADDRLABEL = 72,
+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
+   RTM_DELADDRLABEL,
+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
+   RTM_GETADDRLABEL,
+#define RTM_GETADDRLABEL RTM_GETADDRLABEL
+
__RTM_MAX,
 #define RTM_MAX(((__RTM_MAX + 3) & ~3) - 1)
 };
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 33b593e..bccc2fe 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -84,6 +84,14 @@ extern void  addrconf_leave_solict(struct 
inet6_dev *idev,
struct in6_addr *addr);
 
 /*
+ * IPv6 Address Label subsystem (addrlabel.c)
+ */
+extern int ipv6_addr_label_init(void);
+extern voidipv6_addr_label_rtnl_register(void);
+extern u32 ipv6_addr_label(const struct in6_addr *addr,
+   int type, int ifindex);
+
+/*
  * multicast prototypes (mcast.c)
  */
 extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 87c23a7..5ffa980 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -5,6 +5,7 @@
 obj-$(CONFIG_IPV6) += ipv6.o
 
 ipv6-objs :=   af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \
+   addrlabel.o \
route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o udplite.o \
raw.o protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \
exthdrs.o sysctl_net_ipv6.o datagram.o \
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8b408b7..5b6553f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -876,36 +876,6 @@ static inline int ipv6_saddr_preferred(int type)
return 0;
 }
 
-/* static matching label */
-static inline int ipv6_addr_label(const struct in6_addr *addr, int type,

[RFC 1/2] [IPV6] ADDRCONF: Preparation for configurable address selection policy with ifindex.

2007-10-29 Thread YOSHIFUJI Hideaki / 吉藤英明
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/ipv6/addrconf.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 348bd8d..8b408b7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -877,7 +877,8 @@ static inline int ipv6_saddr_preferred(int type)
 }
 
 /* static matching label */
-static inline int ipv6_saddr_label(const struct in6_addr *addr, int type)
+static inline int ipv6_addr_label(const struct in6_addr *addr, int type,
+ int ifindex)
 {
  /*
   *prefix (longest match)  label
@@ -912,7 +913,8 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
struct inet6_ifaddr *ifa_result = NULL;
int daddr_type = __ipv6_addr_type(daddr);
int daddr_scope = __ipv6_addr_src_scope(daddr_type);
-   u32 daddr_label = ipv6_saddr_label(daddr, daddr_type);
+   int daddr_ifindex = daddr_dev ? daddr_dev->ifindex : 0;
+   u32 daddr_label = ipv6_addr_label(daddr, daddr_type, daddr_ifindex);
struct net_device *dev;
 
memset(&hiscore, 0, sizeof(hiscore));
@@ -1085,11 +1087,15 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
 
/* Rule 6: Prefer matching label */
if (hiscore.rule < 6) {
-   if (ipv6_saddr_label(&ifa_result->addr, 
hiscore.addr_type) == daddr_label)
+   if (ipv6_addr_label(&ifa_result->addr,
+   hiscore.addr_type,
+   
ifa_result->idev->dev->ifindex) == daddr_label)
hiscore.attrs |= IPV6_SADDR_SCORE_LABEL;
hiscore.rule++;
}
-   if (ipv6_saddr_label(&ifa->addr, score.addr_type) == 
daddr_label) {
+   if (ipv6_addr_label(&ifa->addr,
+   score.addr_type,
+   ifa->idev->dev->ifindex) == 
daddr_label) {
score.attrs |= IPV6_SADDR_SCORE_LABEL;
if (!(hiscore.attrs & IPV6_SADDR_SCORE_LABEL)) {
score.rule = 6;
-- 
1.4.4.4

-
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


[RFC 0/2] [IPV6] ADDRCONF: IPv6 configurable Default Address Selection support (TAKE 2)

2007-10-29 Thread YOSHIFUJI Hideaki / 吉藤英明
This is the 2nd RFC for supporting configurable IPv6 Default Address Selection
policy (RFC3484) based on 2.6.24-rc1.
This is intended for 2.6.25.

Major changes:
- Use rtnetlink instead of ioctl/procfs.
- Use RCU.

Git tree is available at the branch named 2.6.24-rc1-addrlabel-20071030 at
git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev.git

iproute2 is available at the branch named addrlabel-20071030 at
git://git.linux-ipv6.org/gitroot/yoshfuji/iproute2-dev.git

-- 
YOSHIFUJI Hideaki @ USAGI Project  <[EMAIL PROTECTED]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
-
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 1/2] [CRYPTO] tcrypt: Move sg_init_table out of timing loops

2007-10-29 Thread Jens Axboe
On Tue, Oct 30 2007, Herbert Xu wrote:
> On Mon, Oct 29, 2007 at 09:16:27PM +0100, Jens Axboe wrote:
> > On Fri, Oct 26 2007, Herbert Xu wrote:
> > > [CRYPTO] tcrypt: Move sg_init_table out of timing loops
> > > 
> > > This patch moves the sg_init_table out of the timing loops for hash
> > > algorithms so that it doesn't impact on the speed test results.
> > 
> > Wouldn't it be better to just make sg_init_one() call sg_init_table?
> 
> This looks fine to me although I think it's orthogonal to the
> patch you were quoting :)

How so? The reason you changed it to sg_init_table() + sg_set_buf() is
exactly because sg_init_one() didn't properly init the entry (as they
name promised).

-- 
Jens Axboe

-
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: [0/11] Merge bundle creation and other misc fixes/clean-ups

2007-10-29 Thread Herbert Xu
On Mon, Oct 29, 2007 at 10:06:35PM -0700, David Miller wrote:
>
> I did a review of these patches and these look fine.

Thanks!

> Please resubmit this and the 3-patch input interfamily
> fix set when I open up the net-2.6.25 tree.
> 
> I'll probably open up net-2.6.25 approximately one week
> from now.

Sure.  And I hope there will be a few more patches by then :)

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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] rpc_rdma: we need to cast u64 to unsigned long long for printing

2007-10-29 Thread Stephen Rothwell
as some architectures have unsigned long for u64.

net/sunrpc/xprtrdma/rpc_rdma.c: In function 'rpcrdma_create_chunks':
net/sunrpc/xprtrdma/rpc_rdma.c:222: warning: format '%llx' expects type 'long 
long unsigned int', but argument 4 has type 'u64'
net/sunrpc/xprtrdma/rpc_rdma.c:234: warning: format '%llx' expects type 'long 
long unsigned int', but argument 5 has type 'u64'
net/sunrpc/xprtrdma/rpc_rdma.c: In function 'rpcrdma_count_chunks':
net/sunrpc/xprtrdma/rpc_rdma.c:577: warning: format '%llx' expects type 'long 
long unsigned int', but argument 4 has type 'u64

Noticed on PowerPC pseries_defconfig build.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 net/sunrpc/xprtrdma/rpc_rdma.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]

diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index f877b88..9e11ce7 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -221,8 +221,8 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf 
*target,
seg->mr_base);
dprintk("RPC:   %s: read chunk "
"elem [EMAIL PROTECTED]:0x%x pos %d (%s)\n", 
__func__,
-   seg->mr_len, seg->mr_base, seg->mr_rkey, pos,
-   n < nsegs ? "more" : "last");
+   seg->mr_len, (unsigned long long)seg->mr_base,
+   seg->mr_rkey, pos, n < nsegs ? "more" : "last");
cur_rchunk++;
r_xprt->rx_stats.read_chunk_count++;
} else {/* write/reply */
@@ -234,8 +234,8 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf 
*target,
dprintk("RPC:   %s: %s chunk "
"elem [EMAIL PROTECTED]:0x%x (%s)\n", __func__,
(type == rpcrdma_replych) ? "reply" : "write",
-   seg->mr_len, seg->mr_base, seg->mr_rkey,
-   n < nsegs ? "more" : "last");
+   seg->mr_len, (unsigned long long)seg->mr_base,
+   seg->mr_rkey, n < nsegs ? "more" : "last");
cur_wchunk++;
if (type == rpcrdma_replych)
r_xprt->rx_stats.reply_chunk_count++;
@@ -577,7 +577,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int 
wrchunk, __be32 **ipt
dprintk("RPC:   %s: chunk [EMAIL PROTECTED]:0x%x\n",
__func__,
ntohl(seg->rs_length),
-   off,
+   (unsigned long long)off,
ntohl(seg->rs_handle));
}
total_len += ntohl(seg->rs_length);
-- 
1.5.3.4

-
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] net: avoid race between netpoll and network fast path

2007-10-29 Thread Matt Mackall
On Mon, Oct 29, 2007 at 09:26:11PM -0700, David Miller wrote:
> From: Tina Yang <[EMAIL PROTECTED]>
> Date: Tue, 16 Oct 2007 22:46:30 -0700
> 
> > The precise race is
> > 1) net_rx_action get the dev from poll_list
> > 2) at the same time, netpoll poll_napi() get a hold of the poll lock
> >and calls ->poll(), remove dev from the poll list
> > 3) after it finishes, net_rx_action get the poll lock, and calls
> >->poll() the second time, and panic when trying to remove (again)
> >the dev from the poll list.
> 
> This is trivial to fix.
> 
> I'll check the following into 2.6.14 and backport it to
> the -stable trees.
> 
> [NET]: Fix race between poll_napi() and net_rx_action()
> 
> netpoll_poll_lock() synchronizes the ->poll() invocation
> code paths, but once we have the lock we have to make
> sure that NAPI_STATE_SCHED is still set.  Otherwise we
> get:
> 
>   cpu 0   cpu 1
> 
>   net_rx_action() poll_napi()
>   netpoll_poll_lock() ... spin on ->poll_lock
>   ->poll()
> netif_rx_complete
>   netpoll_poll_unlock()   acquire ->poll_lock()
>   ->poll()
>netif_rx_complete()
>CRASH
> 
> Based upon a bug report from Tina Yang.
> 
> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

Thanks, Dave.

-- 
Mathematics is the supreme nostalgia of our time.
-
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: [0/11] Merge bundle creation and other misc fixes/clean-ups

2007-10-29 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]>
Date: Wed, 24 Oct 2007 00:02:17 +0800

> This series of patches fixes the bug where the bundle creation
> code treats IPv6 routes as IPv4 or vice versa.
> 
> I think this is suitable for 2.6.25.
> 
> They do fix bugs but I don't think any of them are serious enough
> for inclusion in 2.6.24.

I did a review of these patches and these look fine.

Please resubmit this and the 3-patch input interfamily
fix set when I open up the net-2.6.25 tree.

I'll probably open up net-2.6.25 approximately one week
from now.
-
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] [IPv4] SNMP: Refer correct memory location to display ICMP out-going statistics

2007-10-29 Thread David Miller
From: Mitsuru Chinen <[EMAIL PROTECTED]>
Date: Fri, 26 Oct 2007 10:59:28 +0900

> While displaying ICMP out-going statistics as Out counters in
> /proc/net/snmp, the memory location for ICMP in-coming statistics
> was referred by mistake.
> 
> Acked-by: David L Stevens <[EMAIL PROTECTED]> 
> Signed-off-by: Mitsuru Chinen <[EMAIL PROTECTED]>

Patch applied, thank you!
-
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: MD5 signature pool race bug?

2007-10-29 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Thu, 25 Oct 2007 11:36:12 -0700

> Looking at this bug report:
>   http://bugzilla.kernel.org/show_bug.cgi?id=9173
 ...
> It looks like there may be a race between the tricky allocate per-cpu pool
> and free-per-cpu pool logic.  IMHO the pool management code is more complex
> than it needs to be and may be the source of the bug. Couldn't the signature
> just use normal kmalloc/kfree and slab cache?

This bug was fixed by the patch below, please close this
bug.

Thanks!

commit 2c4f6219aca5939b57596278ea8b014275d4917b
Author: David S. Miller <[EMAIL PROTECTED]>
Date:   Tue Feb 20 23:51:47 2007 -0800

[TCP]: Fix MD5 signature pool locking.

The locking calls assumed that these code paths were only
invoked in software interrupt context, but that isn't true.

Therefore we need to use spin_{lock,unlock}_bh() throughout.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ac6516c..74c4d10 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2266,12 +2266,12 @@ void tcp_free_md5sig_pool(void)
 {
struct tcp_md5sig_pool **pool = NULL;
 
-   spin_lock(&tcp_md5sig_pool_lock);
+   spin_lock_bh(&tcp_md5sig_pool_lock);
if (--tcp_md5sig_users == 0) {
pool = tcp_md5sig_pool;
tcp_md5sig_pool = NULL;
}
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
if (pool)
__tcp_free_md5sig_pool(pool);
 }
@@ -2314,36 +2314,36 @@ struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void)
int alloc = 0;
 
 retry:
-   spin_lock(&tcp_md5sig_pool_lock);
+   spin_lock_bh(&tcp_md5sig_pool_lock);
pool = tcp_md5sig_pool;
if (tcp_md5sig_users++ == 0) {
alloc = 1;
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
} else if (!pool) {
tcp_md5sig_users--;
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
cpu_relax();
goto retry;
} else
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
 
if (alloc) {
/* we cannot hold spinlock here because this may sleep. */
struct tcp_md5sig_pool **p = __tcp_alloc_md5sig_pool();
-   spin_lock(&tcp_md5sig_pool_lock);
+   spin_lock_bh(&tcp_md5sig_pool_lock);
if (!p) {
tcp_md5sig_users--;
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
return NULL;
}
pool = tcp_md5sig_pool;
if (pool) {
/* oops, it has already been assigned. */
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
__tcp_free_md5sig_pool(p);
} else {
tcp_md5sig_pool = pool = p;
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
}
}
return pool;
@@ -2354,11 +2354,11 @@ EXPORT_SYMBOL(tcp_alloc_md5sig_pool);
 struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu)
 {
struct tcp_md5sig_pool **p;
-   spin_lock(&tcp_md5sig_pool_lock);
+   spin_lock_bh(&tcp_md5sig_pool_lock);
p = tcp_md5sig_pool;
if (p)
tcp_md5sig_users++;
-   spin_unlock(&tcp_md5sig_pool_lock);
+   spin_unlock_bh(&tcp_md5sig_pool_lock);
return (p ? *per_cpu_ptr(p, cpu) : 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: BUG in sys_socketpair

2007-10-29 Thread David Miller
From: Chuck Ebbert <[EMAIL PROTECTED]>
Date: Thu, 25 Oct 2007 14:44:52 -0400

> On 10/25/2007 10:11 AM, Rich Paul wrote:
> > In 2.6.23, there seems to be a minor bug in sys_socketpair.  When the
> > calls to sock_alloc_fd fail, it aborts the routine, but it returns the
> > variable err, which is not set in this case.
> > 
> > The result is a silent failure if you have too many files open and call
> > socketpair.
> > 
> > Here is a simple UNTESTED patch (not even compiled) which should resolve the
> > issue.
> > 
> > 
> > --- net/socket.c.orig   2007-10-25 10:03:56.0 -0400
> > +++ net/socket.c2007-10-25 10:04:00.0 -0400
> Should be "err = fd1" (spaces), otherwise looks good.
> 
> Original did:
> 
>   err = sock_map_fd(sock1);
>   if (err < 0)
>   goto out_release_both;
>   fd1 = err;

Thanks everyone, I'll commit the following both to 2.6.x GIT
and -stable.

>From 42f3fc7e989554e9952bdf28af137e4e4570f067 Mon Sep 17 00:00:00 2001
From: David S. Miller <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 21:54:02 -0700
Subject: [PATCH] [NET]: Fix error reporting in sys_socketpair().

If either of the two sock_alloc_fd() calls fail, we
forget to update 'err' and thus we'll erroneously
return zero in these cases.

Based upon a report and patch from Rich Paul, and
commentary from Chuck Ebbert.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/socket.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 540013e..5d879fd 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1250,11 +1250,14 @@ asmlinkage long sys_socketpair(int family, int type, 
int protocol,
goto out_release_both;
 
fd1 = sock_alloc_fd(&newfile1);
-   if (unlikely(fd1 < 0))
+   if (unlikely(fd1 < 0)) {
+   err = fd1;
goto out_release_both;
+   }
 
fd2 = sock_alloc_fd(&newfile2);
if (unlikely(fd2 < 0)) {
+   err = fd2;
put_filp(newfile1);
put_unused_fd(fd1);
goto out_release_both;
-- 
1.5.2.5

-
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 5/5] introduce udp_rmem and udp_wmem

2007-10-29 Thread Bill Fink
On Mon, 29 Oct 2007, Hideo AOKI wrote:

> This patch added /proc/sys/net/udp_rmem and /proc/sys/net/udp_rmem.
> Each UDP packet is drooped when the number of pages for socket buffer
> is beyond the limit and the socket already consumes minimum buffer.

I think you meant /proc/sys/net/ipv4/udp_{r,w}mem above.

Patch not in-lined making replying more difficult.

Cutting and pasting:

> diff -pruN 
> linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt 
> linux-2.6.24-rc1-mem003-ipv4-dev-p5/Documentation/networking/ip-sysctl.txt
> --- 
> linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt
> 2007-10-26 20:35:52.0 -0400
> +++ 
> linux-2.6.24-rc1-mem003-ipv4-dev-p5/Documentation/networking/ip-sysctl.txt
> 2007-10-29 09:44:05.0 -0400
> @@ -452,6 +452,18 @@ udp_mem - INTEGER
>   Number of pages allowed for queueing by all UDP sockets.
>   Default is calculated at boot time from amount of available memory.
>  
> +udp_rmem - INTEGER
> + Minimal size of receive buffer used by UDP sockets. Each UDP socket
> + is able to use the size for receiving data, even if total pages of UDP
> + sockets exceed udp_mem. The unit is byte.
> + Default: 4096
> +
> +udp_wmem - INTEGER
> + Minimal size of send buffer used by UDP sockets. Each UDP socket is
> + able to use the size for sending data, even if total pages of UDP
> + sockets exceed udp_mem. The unit is byte.
> + Default: 4096
> +
>  CIPSOv4 Variables:
>  
>  cipso_cache_enable - BOOLEAN

I think either the above should be renamed to udp_{r,w}mem_min, or
they should be changed to a 3-tuple like tcp_{r,w}mem, and the code
refactored accordingly (but then what to do about
/proc/sys/net/core/{r,w}mem_max).

-Bill
-
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 2/2] NFS: handle IPv6 addresses in nfs ctl

2007-10-29 Thread Neil Brown
On Monday October 22, [EMAIL PROTECTED] wrote:
> Here is a second missing part of the IPv6 support in NFS server code 
> concerning knfd syscall interface.
> It updates write_getfd and write_getfd to accept IPv6 addresses.

Sorry for not replying to this earlier - I saw the Oct 12 post and
thought about it but didn't actually reply before getting distracted
:-(

I think this patch is unnecessary and hence not wanted.
The getfs / getfs calls should be considered legacy calls.
Adding functionality to them is not appropriate.

IPv6 addresses should be handled only via the
   /proc/net/rpc/auth.unix.ip 
interface.

Thanks,
NeilBrown
-
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] net: avoid race between netpoll and network fast path

2007-10-29 Thread David Miller
From: Tina Yang <[EMAIL PROTECTED]>
Date: Tue, 16 Oct 2007 22:46:30 -0700

>   The precise race is
>   1) net_rx_action get the dev from poll_list
>   2) at the same time, netpoll poll_napi() get a hold of the poll lock
>  and calls ->poll(), remove dev from the poll list
>   3) after it finishes, net_rx_action get the poll lock, and calls
>  ->poll() the second time, and panic when trying to remove (again)
>  the dev from the poll list.

This is trivial to fix.

I'll check the following into 2.6.14 and backport it to
the -stable trees.

[NET]: Fix race between poll_napi() and net_rx_action()

netpoll_poll_lock() synchronizes the ->poll() invocation
code paths, but once we have the lock we have to make
sure that NAPI_STATE_SCHED is still set.  Otherwise we
get:

cpu 0   cpu 1

net_rx_action() poll_napi()
netpoll_poll_lock() ... spin on ->poll_lock
->poll()
  netif_rx_complete
netpoll_poll_unlock()   acquire ->poll_lock()
->poll()
 netif_rx_complete()
 CRASH

Based upon a bug report from Tina Yang.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

diff --git a/net/core/dev.c b/net/core/dev.c
index 853c8b5..02e7d83 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2172,7 +2172,15 @@ static void net_rx_action(struct softirq_action *h)
 
weight = n->weight;
 
-   work = n->poll(n, weight);
+   /* This NAPI_STATE_SCHED test is for avoiding a race
+* with netpoll's poll_napi().  Only the entity which
+* obtains the lock and sees NAPI_STATE_SCHED set will
+* actually make the ->poll() call.  Therefore we avoid
+* accidently calling ->poll() when NAPI is not scheduled.
+*/
+   work = 0;
+   if (test_bit(NAPI_STATE_SCHED, &n->state))
+   work = n->poll(n, weight);
 
WARN_ON_ONCE(work > weight);
 
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index bf8d18f..c499b5c 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -116,6 +116,29 @@ static __sum16 checksum_udp(struct sk_buff *skb, struct 
udphdr *uh,
  * network adapter, forcing superfluous retries and possibly timeouts.
  * Thus, we set our budget to greater than 1.
  */
+static int poll_one_napi(struct netpoll_info *npinfo,
+struct napi_struct *napi, int budget)
+{
+   int work;
+
+   /* net_rx_action's ->poll() invocations and our's are
+* synchronized by this test which is only made while
+* holding the napi->poll_lock.
+*/
+   if (!test_bit(NAPI_STATE_SCHED, &napi->state))
+   return budget;
+
+   npinfo->rx_flags |= NETPOLL_RX_DROP;
+   atomic_inc(&trapped);
+
+   work = napi->poll(napi, budget);
+
+   atomic_dec(&trapped);
+   npinfo->rx_flags &= ~NETPOLL_RX_DROP;
+
+   return budget - work;
+}
+
 static void poll_napi(struct netpoll *np)
 {
struct netpoll_info *npinfo = np->dev->npinfo;
@@ -123,17 +146,13 @@ static void poll_napi(struct netpoll *np)
int budget = 16;
 
list_for_each_entry(napi, &np->dev->napi_list, dev_list) {
-   if (test_bit(NAPI_STATE_SCHED, &napi->state) &&
-   napi->poll_owner != smp_processor_id() &&
+   if (napi->poll_owner != smp_processor_id() &&
spin_trylock(&napi->poll_lock)) {
-   npinfo->rx_flags |= NETPOLL_RX_DROP;
-   atomic_inc(&trapped);
-
-   napi->poll(napi, budget);
-
-   atomic_dec(&trapped);
-   npinfo->rx_flags &= ~NETPOLL_RX_DROP;
+   budget = poll_one_napi(npinfo, napi, budget);
spin_unlock(&napi->poll_lock);
+
+   if (!budget)
+   break;
}
}
 }

-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread Brian Haley

David Miller wrote:

From: David Miller <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 15:25:59 -0700 (PDT)


Can you guys please just state upfront what virtualization
issue is made more difficult by features you want to remove?


Sorry, I mentioned "virtualization" because that's been the
largest majority of the cases being presented lately.

I suspect in your case it's some multicast or SCTP thing :-)


It's actually neither in this case :)

We have customers migrating from BSD stacks to Linux.  They notice all 
the differences in the sockets API, sometimes even find bugs, and we fix 
them and send patches upstream.  They also do stupid things like 
duplicate address configurations on two interfaces in different subnets.


IPv6 was the curious one for us here since it falls into an RFC gray 
area - addresses are assigned to interfaces, not hosts (RFC 4291), but 
they should be tested for uniqueness before being assigned (RFC 4862). 
This address didn't pass the uniqueness test, although it did pass DAD 
because the links were different.  We couldn't find another OS for a 
host or router (including IOS) that allows this, hence the question.


Thanks, and sorry if it's just another waste of your time to explain it.

-Brian
-
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: drivers/net/sunhme.c patch

2007-10-29 Thread David Miller
From: Tom Southerland <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 19:53:52 -0600

> This patch provides a unique mac address for all interfaces
> for the Sun QFE card (non-sparc).  It takes the base mac from
> the first interface and increments the mac address for the
> other interfaces.
> 
> It still preserves the 'macaddr' parameter so if desired, it
> can still be used.
> 
> Before patching:
> 
> eth0  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth2  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth3  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> 
> After patching:
> 
> eth0  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
> eth2  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
> eth3  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Unfortunately, although I understand what you're trying to do,
this change is not correct.

We obtain properly the local-mac-address property stored in
the PCI ROM of each interface, and if you look at the code
we look the MACs up by interface index.

So we are (or should be) obtaining the per-interface MAC
address programmed into the onboard firmware.

Perhaps in get_hme_mac_nonsparc(), is_quattro_p() is evaluating
false and therefore we mistakedly always use index 0?

Could you please check this?  That's probably what the problem
is.
-
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


drivers/net/sunhme.c patch

2007-10-29 Thread Tom Southerland

This patch provides a unique mac address for all interfaces
for the Sun QFE card (non-sparc).  It takes the base mac from
the first interface and increments the mac address for the
other interfaces.

It still preserves the 'macaddr' parameter so if desired, it
can still be used.

Before patching:

eth0  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth2  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth3  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB

After patching:

eth0  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
eth2  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
eth3  Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Cheers,

Tom



--- linux-2.6.23.1/drivers/net/sunhme.c.orig2007-10-29 07:58:25.0 
-0600
+++ linux-2.6.23.1/drivers/net/sunhme.c 2007-10-29 08:53:03.0 -0600
@@ -3083,6 +3083,11 @@ static int __devinit happy_meal_pci_prob
}
 #else
get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]);
+if(macaddr[5] == 0){
+ for (i = 0; i < 6; i++)
+   macaddr[i] = dev->dev_addr[i];
+ macaddr[5]++;
+}
 #endif
}


-
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


Fwd: Bug with tun0 and VLAN

2007-10-29 Thread Bruno Clermont
Hi,

I previously contacted tun driver maintainer about a bug I found and
he suggested me to forward this to you.
so, look like there is a bug in the kernel when the VLAN code is
dealing with an interface like the tun interface.

see forwarded my original mail and Max reply.

thanks!

-- Forwarded message --
From: Max Krasnyansky <[EMAIL PROTECTED]>
Date: Oct 29, 2007 8:29 PM
Subject: Re: Bug with tun0 and VLAN
To: Bruno Clermont <[EMAIL PROTECTED]>

Hi Bruno,

> Hi,
>
> I'm writing to you, because you seem to be the maintainer of the tun driver.
>
> I hit a bug lately. I was testing this scenario:
>
> [Server1][eth0]---(Internet)--[eth0][Server2]
>
> I want to be able to route traffic for many VLAN into a single tunnel
> instead of invoking 1 openvpn process per VLAN. so, I tried to add VLAN
> to tun interface.
>
> I create an OpenVPN tunnel between Server1 and 2, this part work. the
> tun0 is going up. I use heavily openvpn and I'm sure of me on this part.
> I made sure openvpn did not set any IP on the tunnel.
>
> So, I added the vlan to the tun interface on both server:
>
> ifconfig tun0 up
> vconfig add tun0 1
> vconfig add tun1 2
>
> on server1:
> ifconfig tun0.1 10.0.0.1  netmask 255.255.255.0
>  up
> ifconfig tun0.1 10.0.1.1  netmask 255.255.255.0
>  up
>
> on server2:
> ifconfig tun0.1 10.0.0.2  netmask 255.255.255.0
>  up
> ifconfig tun0.1 10.0.1.2  netmask 255.255.255.0
>  up
>
> Trying to ping the other end of the tun/vlan make the kernel panic on
> the host that try to ping.
> I tried on Ubuntu Feisty and Gutsy (2.6.22) and they both crash.
>
> I tried it severals times on different host and it seem that combining
> VLAN and tun interface crash the kernel.
> it's easy to reproduce.
>
> Is it a tun driver issue? VLAN code issue? some other part of the
> kernel? I don't know.
>
> your my first attempt of communication for this issue... If it's not
> supported, at least the kernel should not panic!

Actually TUN is a point to point device, it does not have Ethernet MAC
headers. In other words VLANs would never work over TUN.
I agree though that it should not crash. So it's better to report this to
netdev mailing list. Basically VLAN code should outright refuse to attach
to TUN devices.

Max
-
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 1/2] [CRYPTO] tcrypt: Move sg_init_table out of timing loops

2007-10-29 Thread Herbert Xu
On Mon, Oct 29, 2007 at 09:16:27PM +0100, Jens Axboe wrote:
> On Fri, Oct 26 2007, Herbert Xu wrote:
> > [CRYPTO] tcrypt: Move sg_init_table out of timing loops
> > 
> > This patch moves the sg_init_table out of the timing loops for hash
> > algorithms so that it doesn't impact on the speed test results.
> 
> Wouldn't it be better to just make sg_init_one() call sg_init_table?

This looks fine to me although I think it's orthogonal to the
patch you were quoting :)

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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] inet: race in wait for connect.

2007-10-29 Thread Stephen Hemminger
On Mon, 29 Oct 2007 15:38:42 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: Stephen Hemminger <[EMAIL PROTECTED]>
> Date: Mon, 29 Oct 2007 14:37:14 -0700
> 
> > On Mon, 29 Oct 2007 19:29:06 -0200
> > "Arnaldo Carvalho de Melo" <[EMAIL PROTECTED]> wrote:
> > 
> > > Em Mon, Oct 29, 2007 at 01:52:22PM -0700, Stephen Hemminger escreveu:
> > > > Fix possible race while waiting for connections in accept. I don't
> > > > know of a test case that could reproduce this directly.
> > > > 
> > > > The state of the socket should be checked before checking the queue.
> > > > If the socket has left the TCP_LISTEN state, then the accept queue
> > > > is no longer valid.
> > > 
> > > Well if it left from LISTEN to CLOSED inet_csk_listen_stop must have
> > > been called, and that calls reqsk_queue_yank_acceptq, that sets it to
> > > NULL, reqsk_queue_empty(&icsk->icsk_accept_queue) returns true and we
> > > get to if (sk->sk_state != TCP_LISTEN), returning -EINVAL as with your
> > > patch.  So I can't see a race, just one branch less in one case :-)
> > > 
> > > - Arnaldo
> > 
> > Yeah, your right. The listen queue is garbage at this point but the
> > accept queue is always empty.
> 
> Is there some failing test case you are aware of which led
> you to this piece of code or did you happen to notice it
> while scanning around?

While instrumenting the snot out of accept logic for looking at alternatives
to the MT-accept vs. close issue.

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
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] pegasos_eth.c: Fix compile error over MV643XX_ defines

2007-10-29 Thread Lennert Buytenhek
On Mon, Oct 29, 2007 at 05:27:29PM -0400, Luis R. Rodriguez wrote:

> This commit made an incorrect assumption:
> --
> Author: Lennert Buytenhek <[EMAIL PROTECTED]>
>  Date:   Fri Oct 19 04:10:10 2007 +0200
> 
> mv643xx_eth: Move ethernet register definitions into private header
> 
> Move the mv643xx's ethernet-related register definitions from
> include/linux/mv643xx.h into drivers/net/mv643xx_eth.h, since
> they aren't of any use outside the ethernet driver.
> 
> Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
> Acked-by: Tzachi Perelstein <[EMAIL PROTECTED]>
> Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
> --
> 
> arch/powerpc/platforms/chrp/pegasos_eth.c made use of a 3 defines there.
> 
> [EMAIL PROTECTED]:~/devel/wireless-2.6$ git-describe 
> 
> v2.6.24-rc1-138-g0119130
> 
> This patch fixes this by internalizing 3 defines onto pegasos which are
> simply no longer available elsewhere. Without this your compile will fail
> whenever you enable 'Common Hardware Reference Platform (CHRP) based 
> machines',
>
> [...]
> 
> diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c 
> b/arch/powerpc/platforms/chrp/pegasos_eth.c
> index 5bcc58d..1fc9e8c 100644
> --- a/arch/powerpc/platforms/chrp/pegasos_eth.c
> +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
> @@ -24,6 +24,9 @@
>  #define PEGASOS2_SRAM_BASE_ETH0  (PEGASOS2_SRAM_BASE)
>  #define PEGASOS2_SRAM_BASE_ETH1  
> (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
>  
> +#define PEGASOS2_ETH_BAR_4   0x2220
> +#define PEGASOS2_ETH_SIZE_REG_4  0x2224
> +#define PEGASOS2_ETH_BASE_ADDR_ENABLE_REG0x2290
>  
>  #define PEGASOS2_SRAM_RXRING_SIZE(PEGASOS2_SRAM_SIZE/4)
>  #define PEGASOS2_SRAM_TXRING_SIZE(PEGASOS2_SRAM_SIZE/4)
> @@ -147,13 +150,13 @@ static int Enable_SRAM(void)
>  
>   ALong = 0x02;
>   ALong |= PEGASOS2_SRAM_BASE & 0x;
> - MV_WRITE(MV643XX_ETH_BAR_4, ALong);
> + MV_WRITE(PEGASOS2_ETH_BAR_4, ALong);
>  
> - MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0x);
> + MV_WRITE(PEGASOS2_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0x);
>  
> - MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
> + MV_READ(PEGASOS2_ETH_BASE_ADDR_ENABLE_REG, ALong);
>   ALong &= ~(1 << 4);
> - MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
> + MV_WRITE(PEGASOS2_ETH_BASE_ADDR_ENABLE_REG, ALong);
>  
>  #ifdef BE_VERBOSE
>   printk("Pegasos II/Marvell MV64361: register unmapped\n");

Al Viro sent a patch for this breakage a couple of days ago:

http://marc.info/?l=linux-kernel&m=119351541706811&w=2

(FWIW, I think that code outside of mv643xx_eth.c should not be poking
into the mv643xx's registers directly.  Ideally, this info should just
be passed by pegasos_eth into mv643xx_eth via platform data, and then
mv643xx_eth can write the relevant hardware registers.)
-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread David Miller
From: David Miller <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 15:25:59 -0700 (PDT)

> Can you guys please just state upfront what virtualization
> issue is made more difficult by features you want to remove?

Sorry, I mentioned "virtualization" because that's been the
largest majority of the cases being presented lately.

I suspect in your case it's some multicast or SCTP thing :-)
-
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: drivers/net/sunhme.c patch

2007-10-29 Thread David Miller
From: Jan Engelhardt <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 23:12:25 +0100 (CET)

> The question was more like: if I put in a QFE (that was acquired together
> with a SUN E250) into x86, would I get duplicate MACs? (Would be strange -
> I would have supposed the OF on the card is independent.)

You are not supposed to.  Each HME instance should get a unique
MAC.

Normally OF would propagate this information around to the independant
device nodes, and we should try to preserve this behavior for non-OF
systems.
-
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] inet: race in wait for connect.

2007-10-29 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 14:37:14 -0700

> On Mon, 29 Oct 2007 19:29:06 -0200
> "Arnaldo Carvalho de Melo" <[EMAIL PROTECTED]> wrote:
> 
> > Em Mon, Oct 29, 2007 at 01:52:22PM -0700, Stephen Hemminger escreveu:
> > > Fix possible race while waiting for connections in accept. I don't
> > > know of a test case that could reproduce this directly.
> > > 
> > > The state of the socket should be checked before checking the queue.
> > > If the socket has left the TCP_LISTEN state, then the accept queue
> > > is no longer valid.
> > 
> > Well if it left from LISTEN to CLOSED inet_csk_listen_stop must have
> > been called, and that calls reqsk_queue_yank_acceptq, that sets it to
> > NULL, reqsk_queue_empty(&icsk->icsk_accept_queue) returns true and we
> > get to if (sk->sk_state != TCP_LISTEN), returning -EINVAL as with your
> > patch.  So I can't see a race, just one branch less in one case :-)
> > 
> > - Arnaldo
> 
> Yeah, your right. The listen queue is garbage at this point but the
> accept queue is always empty.

Is there some failing test case you are aware of which led
you to this piece of code or did you happen to notice it
while scanning around?
-
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] pegasos_eth.c: Fix compile error over MV643XX_ defines

2007-10-29 Thread Dale Farnsworth
On Mon, Oct 29, 2007 at 05:27:29PM -0400, Luis R. Rodriguez wrote:
> This commit made an incorrect assumption:
> --
> Author: Lennert Buytenhek <[EMAIL PROTECTED]>
>  Date:   Fri Oct 19 04:10:10 2007 +0200
> 
> mv643xx_eth: Move ethernet register definitions into private header
> 
> Move the mv643xx's ethernet-related register definitions from
> include/linux/mv643xx.h into drivers/net/mv643xx_eth.h, since
> they aren't of any use outside the ethernet driver.
> 
> Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
> Acked-by: Tzachi Perelstein <[EMAIL PROTECTED]>
> Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
> --
> 
> arch/powerpc/platforms/chrp/pegasos_eth.c made use of a 3 defines there.
> 
> [EMAIL PROTECTED]:~/devel/wireless-2.6$ git-describe 
> 
> v2.6.24-rc1-138-g0119130
> 
> This patch fixes this by internalizing 3 defines onto pegasos which are
> simply no longer available elsewhere. Without this your compile will fail

That compile failure was fixed in commit
30e69bf4cce16d4c2dcfd629a60fcd8e1aba9fee by Al Viro.

However, as I examine that commit, I see that it defines offsets from
the eth block in the chip, rather than the full chip registeri block
as the Pegasos 2 code expects.  So, I think it fixes the compile
failure, but leaves the Pegasos 2 broken.

Luis, do you have Pegasos 2 hardware?  Can you (or anyone) verify that
the following patch is needed for the Pegasos 2?

Thanks,
-Dale

-

mv643xx_eth: Fix MV643XX_ETH offsets used by Pegasos 2

In the mv643xx_eth driver, we now use offsets from the ethernet
register block within the chip, but the pegasos 2 platform still
needs offsets from the full chip's register base address.

Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
---
 include/linux/mv643xx_eth.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 8df230a..30e11aa 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -8,9 +8,9 @@
 #define MV643XX_ETH_NAME   "mv643xx_eth"
 #define MV643XX_ETH_SHARED_REGS0x2000
 #define MV643XX_ETH_SHARED_REGS_SIZE   0x2000
-#define MV643XX_ETH_BAR_4  0x220
-#define MV643XX_ETH_SIZE_REG_4 0x224
-#define MV643XX_ETH_BASE_ADDR_ENABLE_REG   0x0290
+#define MV643XX_ETH_BAR_4  0x2220
+#define MV643XX_ETH_SIZE_REG_4 0x2224
+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG   0x2290
 
 struct mv643xx_eth_platform_data {
int port_number;
-
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: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread David Miller
From: Ingo Molnar <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 22:17:46 +0100

> 
> hm, this seems to have popped up in the last few days, never had it 
> before:
> 
>   sysfs: duplicate filename 'eth0' can not be created
>   WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

I checked in a change from Stephen Hemminger last week which
should keep this case from emitting warning messages.

commit c8d90dca3211966ba5189e0f3d4bccd558d9ae08
Author: Stephen Hemminger <[EMAIL PROTECTED]>
Date:   Fri Oct 26 03:53:42 2007 -0700

[NET] dev_change_name: ignore changes to same name

Prevent error/backtrace from dev_rename() when changing
name of network device to the same name. This is a common
situation with udev and other scripts that bind addr to device.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

diff --git a/net/core/dev.c b/net/core/dev.c
index f1647d7..ddfef3b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -883,6 +883,9 @@ int dev_change_name(struct net_device *dev, char *newname)
if (!dev_valid_name(newname))
return -EINVAL;
 
+   if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+   return 0;
+
memcpy(oldname, dev->name, IFNAMSIZ);
 
if (strchr(newname, '%')) {
-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread David Miller
From: Vlad Yasevich <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 14:03:37 -0400

> So, I am looking for technical reasons why this is permitted.

I am looking for a technical reason why you find a need
to discover this feature and want the remove it :-)

Can you guys please just state upfront what virtualization
issue is made more difficult by features you want to remove?

That will make things go a lot more smoothly, thanks.
-
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: drivers/net/sunhme.c patch

2007-10-29 Thread Jan Engelhardt

On Oct 29 2007 15:10, David Miller wrote:
>> On Oct 29 2007 08:54, Tom Southerland wrote:
>> >
>> > This patch provides a unique mac address for all interfaces
>> > for the Sun QFE card (non-sparc).  It takes the base mac from
>> > the first interface and increments the mac address for the
>> > other interfaces.
>> 
>> Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?
>
>To answer the question, yes it is just a normal PCI device, they put 4
>HME chips behind a PCI bridge.  However, the OpenFirmware on the cards
>usually creates device node properties for these PCI devices for the
>local ethernet addresses.  That's what he's trying to duplicate here.
>
The question was more like: if I put in a QFE (that was acquired together
with a SUN E250) into x86, would I get duplicate MACs? (Would be strange -
I would have supposed the OF on the card is independent.)

-
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: drivers/net/sunhme.c patch

2007-10-29 Thread David Miller
From: Jan Engelhardt <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 16:11:18 +0100 (CET)

> 
> On Oct 29 2007 08:54, Tom Southerland wrote:
> >
> > This patch provides a unique mac address for all interfaces
> > for the Sun QFE card (non-sparc).  It takes the base mac from
> > the first interface and increments the mac address for the
> > other interfaces.
> 
> Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

This is exactly why I wish this patch had been posted to
netdev@vger.kernel.org, now we have a dialogue going and even if I add
netdev to the CC: now, you can't follow it completely as a netdev
subscriber without going to the lkml archives.

To answer the question, yes it is just a normal PCI device, they put 4
HME chips behind a PCI bridge.  However, the OpenFirmware on the cards
usually creates device node properties for these PCI devices for the
local ethernet addresses.  That's what he's trying to duplicate 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


[PATCH][RFC] Add support for the RDC R6040 Fast Ethernet controller

2007-10-29 Thread Florian Fainelli
This patch adds support for the RDC R6040 MAC we can find in the RDC R-321x 
System-on-chips.
This driver really needs improvements especially on the NAPI part which 
probably does not
fully use the new NAPI structure.
You will need the RDC PCI identifiers if you want to test this driver which are 
the following ones :

RDC_PCI_VENDOR_ID = 0x17f3
RDC_PCI_DEVICE_ID_RDC_R6040 = 0x6040

Thank you very much in advance for your comments.

Signed-off-by: Sten Wang <[EMAIL PROTECTED]>
Signed-off-by: Daniel Gimpelevich <[EMAIL PROTECTED]>
Signed-off-by: Florian Fainelli <[EMAIL PROTECTED]>
---
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index ce34b53..c8a5eef 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1643,6 +1643,24 @@ config 8139_OLD_RX_RESET
  experience problems, you can enable this option to restore the
  old RX-reset behavior.  If unsure, say N.
 
+config R6040
+   tristate "RDC R6040 Fast Ethernet Adapter support (EXPERIMENTAL)"
+   depends on NET_PCI && PCI && EXPERIMENTAL
+   select MII
+   help
+ This is a driver for the R6040 Fast Ethernet MACs found in the
+ the RDC R-321x System-on-chips.
+
+ To compile this driver as a module, choose M here: the module
+ will be called r6040. This is recommended.
+
+config R6040_NAPI
+   bool "NAPI support for R6040"
+   depends on R6040
+   default y
+   help
+ Enable the NAPI polling for the R6040 driver.
+
 config SIS900
tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
depends on NET_PCI && PCI
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 22f78cb..5fb95ca 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -76,6 +76,7 @@ obj-$(CONFIG_VIA_RHINE) += via-rhine.o
 obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
 obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
 obj-$(CONFIG_RIONET) += rionet.o
+obj-$(CONFIG_R6040) += r6040.o
 
 #
 # end link order section
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
new file mode 100644
index 000..ada1b7f
--- /dev/null
+++ b/drivers/net/r6040.c
@@ -0,0 +1,970 @@
+/*
+ * RDC R6040 Fast Ethernet MAC support
+ *
+ * Copyright (C) 2004 Sten Wang <[EMAIL PROTECTED]>
+ * Copyright (C) 2007 Daniel Gimpelevich <[EMAIL PROTECTED]>
+ * Florian Fainelli <[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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Changelog :
+ * --  
+ * 10-07-2007  Clean up the driver using checkpatch
+ * 08-24-2006  Support at linux 2.6.10 above
+ * 03-24-2006  Support NAPI
+ * 03-21-2006  change spin_lock_irqsave(lp->lock, flags)
+ * to spin_lock_irqsave(&lp->lock, flags)
+ * in set_multicast_list
+ * 03-15-2006  Modify the set_multicast_list ,due to when re-plug the 
ethernet,
+ * it will forget the previous setting
+ * 07-12-2005  modify the set_multicast_list
+ * 03-28-2005  modify some error mac register offset in
+ * function set_multicast_list
+ * 03-27-2005  Add the internal state machine reset
+ * If multicast address more than 4, enter PROM mode
+ * Changed rdc to r6040
+ * 12-22-2004  Sten Init MAC MBCR register=0x012A
+ * PHY_CAP = 0x01E1
+ *
+ * Need to Do LIst:
+ * 1. If multicast address more than 4, use the multicast address hash
+*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DRV_NAME   "r6040"
+#define DRV_VERSION"0.14"
+#define DRV_RELDATE"29Oct2007"
+
+/* PHY CHIP Address */
+#define PHY1_ADDR  1   /* For MAC1 */
+#define PHY2_ADDR  2   /* For MAC2 */
+#define PHY_MODE   0x3100  /* PHY CHIP Register 0 */
+#define PHY_CAP0x01E1  /* PHY CHIP Register 4 */
+
+/* Time in jiffies before concluding the transmitter is hung. */
+#define TX_TIMEOUT (6000 * HZ / 1000)
+#define TIMER_WU

Re: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread Rick Jones

Jeff Garzik wrote:

Ingo Molnar wrote:

hm, this seems to have popped up in the last few days, never had it 
before:


  sysfs: duplicate filename 'eth0' can not be created
  WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

  Call Trace:
   [] sysfs_add_one+0x54/0xbd
   [] sysfs_create_link+0xc6/0x11d
   [] device_rename+0x175/0x1d6
   [] dev_change_name+0x118/0x211
   [] dev_ioctl+0x4fa/0x5f8
   [] netlink_insert+0x13c/0x14b
   [] do_page_fault+0x3eb/0x73f
   [] sock_ioctl+0x1f2/0x200
   [] do_ioctl+0x21/0x6b
   [] vfs_ioctl+0x243/0x25c
   [] sys_ioctl+0x51/0x71
   [] system_call+0x7e/0x83

   net eth0: device_rename: sysfs_create_symlink failed (-17)

32-bit bzImage kernel - config attached. (The 64-bit kernel even lost 
connectivity due to this and ifcfg-eth0 got renamed to ifcfg-eth0.bak 
by kudzu.)


detected order of the interfaces is:

  forcedeth :00:0a.0: ifname eth0, PHY OUI 0x5043 @1
  eth1: RealTek RTL8139 at 0xc21f2000

and that's the ordering in /etc/sysconfig/network-scripts as well.



Does your setup do anything like try to rename the interfaces?

I cannot think of anything that changed recently in this area in net, 
off the top of my head.


Ingo -

You are not alone.  I see very similar stuff when I boot a system with a large 
number of interfaces.  At first it was almost every interface generating the 
messages or ones like them, but now with a patch applied (might have come via Jeff?)


hpcpc103:~/linux-2.6.24-rc1# more dev_change_name.patch
--- a/net/core/dev.c2007-10-24 06:01:31.0 -0700
+++ b/net/core/dev.c2007-10-24 06:41:18.0 -0700
@@ -885,6 +885,9 @@ int dev_change_name(struct net_device *d
if (!dev_valid_name(newname))
return -EINVAL;

+   if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+   return 0;
+
memcpy(oldname, dev->name, IFNAMSIZ);

if (strchr(newname, '%')) {

I see far fewer of them:

GSI 60 (level, low) -> CPU 6 (0x0c00) vector 70
sysfs: duplicate filename 'eth6_rename' can not be created
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
Call Trace:
 [] show_stack+0x40/0xa0
sp=e00159abfb90 bsp=e00159ab8f48
 [] dump_stack+0x30/0x60
sp=e00159abfd60 bsp=e00159ab8f30
 [] sysfs_add_one+0xb0/0x240
sp=e00159abfd60 bsp=e00159ab8f00
 [] sysfs_create_link+0x200/0x300
sp=e00159abfd60 bsp=e00159ab8ed0
 [] device_rename+0x2d0/0x380
sp=e00159abfd80 bsp=e00159ab8e78
 [] dev_change_name+0x2b0/0x4a0
sp=e00159abfd80 bsp=e00159ab8e30
 [] dev_ifsioc+0x500/0x6c0
sp=e00159abfd90 bsp=e00159ab8e00
 [] dev_ioctl+0xe60/0x1160
sp=e00159abfda0 bsp=e00159ab8da0
 [] sock_ioctl+0x610/0x660
sp=e00159abfe10 bsp=e00159ab8d68
 [] do_ioctl+0x90/0x180
sp=e00159abfe10 bsp=e00159ab8d28
 [] vfs_ioctl+0x860/0x8c0
sp=e00159abfe10 bsp=e00159ab8ce0
 [] sys_ioctl+0xa0/0x120
sp=e00159abfe20 bsp=e00159ab8c60
 [] ia64_ret_from_syscall+0x0/0x20
sp=e00159abfe30 bsp=e00159ab8c60
 [] __start_ivt_text+0x00010620/0x400
sp=e00159ac bsp=e00159ab8c60
:
net eth6_rename: device_rename: sysfs_create_symlink failed (-17)
sysfs: duplicate filename 'eth6' can not be created
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

...
net eth6: device_rename: sysfs_create_symlink failed (-17)
udev: renamed network interface eth7 to eth6
sysfs: duplicate filename 'eth7' can not be created
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

...

sp=e00159ac bsp=e00159ab8c60
net eth7: device_rename: sysfs_create_symlink failed (-17)
udev: renamed network interface eth6_rename to eth7
ACPI: PCI Interrupt :14:01.0[A] -> GSI 60 (level, low) -> IRQ 70


Interestingly (?) when I look at my eth7 interface via ethtool I see:

hpcpc103:~/linux-2.6.24-rc1# ethtool -i eth7
driver: Neterion
version: 2.0.26.5
firmware-version:
bus-info: :0f:01.0

but if I look for it in /proc/interrupts I don't see it:

hpcpc103:~/linux-2.6.24-rc1# cat /proc/interrupts | grep eth7
hpcpc103:~/linux-2.6.24-rc1#

and if I look at all of /proc/interrupts:

hpcpc103:~# cat /proc/interrupts
   CPU0   CPU1   CPU2   CPU3   CPU4   CPU5 
CPU6   CPU7
 28: 12 12 12 12 12 12 
12 12  LSAPIC  cpe_poll
 29:  0  0  0  0  0  0 
 0  0  LSAPIC  cmc_poll
 31:  0  0  0  0  0  0 
 0  0  

Re: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread Ingo Molnar

* Stephen Hemminger <[EMAIL PROTECTED]> wrote:

> Already fixed post 2.6.24-rc1
> 
> commit c8d90dca3211966ba5189e0f3d4bccd558d9ae08
> Author: Stephen Hemminger <[EMAIL PROTECTED]>
> Date:   Fri Oct 26 03:53:42 2007 -0700
> 
> [NET] dev_change_name: ignore changes to same name

ah, nice - that explains it. I just booted with very latest -git and the 
warning is gone.

Ingo
-
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: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread Stephen Hemminger
On Mon, 29 Oct 2007 22:17:46 +0100
Ingo Molnar <[EMAIL PROTECTED]> wrote:

> 
> hm, this seems to have popped up in the last few days, never had it 
> before:
> 
>   sysfs: duplicate filename 'eth0' can not be created
>   WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
> 
>   Call Trace:
>[] sysfs_add_one+0x54/0xbd
>[] sysfs_create_link+0xc6/0x11d
>[] device_rename+0x175/0x1d6
>[] dev_change_name+0x118/0x211
>[] dev_ioctl+0x4fa/0x5f8
>[] netlink_insert+0x13c/0x14b
>[] do_page_fault+0x3eb/0x73f
>[] sock_ioctl+0x1f2/0x200
>[] do_ioctl+0x21/0x6b
>[] vfs_ioctl+0x243/0x25c
>[] sys_ioctl+0x51/0x71
>[] system_call+0x7e/0x83
> 
>net eth0: device_rename: sysfs_create_symlink failed (-17)
> 
> 32-bit bzImage kernel - config attached. (The 64-bit kernel even lost 
> connectivity due to this and ifcfg-eth0 got renamed to ifcfg-eth0.bak by 
> kudzu.)
> 
> detected order of the interfaces is:
> 
>   forcedeth :00:0a.0: ifname eth0, PHY OUI 0x5043 @1
>   eth1: RealTek RTL8139 at 0xc21f2000
> 
> and that's the ordering in /etc/sysconfig/network-scripts as well.
> 
>   Ingo


Already fixed post 2.6.24-rc1

commit c8d90dca3211966ba5189e0f3d4bccd558d9ae08
Author: Stephen Hemminger <[EMAIL PROTECTED]>
Date:   Fri Oct 26 03:53:42 2007 -0700

[NET] dev_change_name: ignore changes to same name

Prevent error/backtrace from dev_rename() when changing
name of network device to the same name. This is a common
situation with udev and other scripts that bind addr to device.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
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] inet: race in wait for connect.

2007-10-29 Thread Stephen Hemminger
On Mon, 29 Oct 2007 19:29:06 -0200
"Arnaldo Carvalho de Melo" <[EMAIL PROTECTED]> wrote:

> Em Mon, Oct 29, 2007 at 01:52:22PM -0700, Stephen Hemminger escreveu:
> > Fix possible race while waiting for connections in accept. I don't
> > know of a test case that could reproduce this directly.
> > 
> > The state of the socket should be checked before checking the queue.
> > If the socket has left the TCP_LISTEN state, then the accept queue
> > is no longer valid.
> 
> Well if it left from LISTEN to CLOSED inet_csk_listen_stop must have
> been called, and that calls reqsk_queue_yank_acceptq, that sets it to
> NULL, reqsk_queue_empty(&icsk->icsk_accept_queue) returns true and we
> get to if (sk->sk_state != TCP_LISTEN), returning -EINVAL as with your
> patch.  So I can't see a race, just one branch less in one case :-)
> 
> - Arnaldo

Yeah, your right. The listen queue is garbage at this point but the
accept queue is always empty.


-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
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: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread Jeff Garzik

Ingo Molnar wrote:
hm, this seems to have popped up in the last few days, never had it 
before:


  sysfs: duplicate filename 'eth0' can not be created
  WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

  Call Trace:
   [] sysfs_add_one+0x54/0xbd
   [] sysfs_create_link+0xc6/0x11d
   [] device_rename+0x175/0x1d6
   [] dev_change_name+0x118/0x211
   [] dev_ioctl+0x4fa/0x5f8
   [] netlink_insert+0x13c/0x14b
   [] do_page_fault+0x3eb/0x73f
   [] sock_ioctl+0x1f2/0x200
   [] do_ioctl+0x21/0x6b
   [] vfs_ioctl+0x243/0x25c
   [] sys_ioctl+0x51/0x71
   [] system_call+0x7e/0x83

   net eth0: device_rename: sysfs_create_symlink failed (-17)

32-bit bzImage kernel - config attached. (The 64-bit kernel even lost 
connectivity due to this and ifcfg-eth0 got renamed to ifcfg-eth0.bak by 
kudzu.)


detected order of the interfaces is:

  forcedeth :00:0a.0: ifname eth0, PHY OUI 0x5043 @1
  eth1: RealTek RTL8139 at 0xc21f2000

and that's the ordering in /etc/sysconfig/network-scripts as well.


Does your setup do anything like try to rename the interfaces?

I cannot think of anything that changed recently in this area in net, 
off the top of my head.


Jeff



-
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] inet: race in wait for connect.

2007-10-29 Thread Arnaldo Carvalho de Melo
Em Mon, Oct 29, 2007 at 01:52:22PM -0700, Stephen Hemminger escreveu:
> Fix possible race while waiting for connections in accept. I don't
> know of a test case that could reproduce this directly.
> 
> The state of the socket should be checked before checking the queue.
> If the socket has left the TCP_LISTEN state, then the accept queue
> is no longer valid.

Well if it left from LISTEN to CLOSED inet_csk_listen_stop must have
been called, and that calls reqsk_queue_yank_acceptq, that sets it to
NULL, reqsk_queue_empty(&icsk->icsk_accept_queue) returns true and we
get to if (sk->sk_state != TCP_LISTEN), returning -EINVAL as with your
patch.  So I can't see a race, just one branch less in one case :-)

- Arnaldo
 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
> 
> --- a/net/ipv4/inet_connection_sock.c 2007-10-26 11:54:41.0 -0700
> +++ b/net/ipv4/inet_connection_sock.c 2007-10-29 08:34:03.0 -0700
> @@ -203,12 +203,12 @@ static int inet_csk_wait_for_connect(str
>   if (reqsk_queue_empty(&icsk->icsk_accept_queue))
>   timeo = schedule_timeout(timeo);
>   lock_sock(sk);
> - err = 0;
> - if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
> - break;
>   err = -EINVAL;
>   if (sk->sk_state != TCP_LISTEN)
>   break;
> + err = 0;
> + if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
> + break;
>   err = sock_intr_errno(timeo);
>   if (signal_pending(current))
>   break;
-
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/5] memory accounting

2007-10-29 Thread Hideo AOKI

This patch adds UDP memory usage accounting in IPv4.

--
Hideo Aoki
Hitachi Computer Products (America) Inc.

Signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]>
Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]>

 af_inet.c   |   30 +-
 ip_output.c |   25 ++---
 udp.c   |9 +
 3 files changed, 60 insertions(+), 4 deletions(-)

diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/af_inet.c linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/af_inet.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/af_inet.c	2007-10-24 11:34:34.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/af_inet.c	2007-10-24 19:10:27.0 -0400
@@ -126,13 +126,41 @@ extern void ip_mc_drop_socket(struct soc
 static struct list_head inetsw[SOCK_MAX];
 static DEFINE_SPINLOCK(inetsw_lock);
 
+/**
+ *	__skb_queue_purge_and_sub_memory_allocated
+ *		- empty a list and subtruct memory allocation counter
+ *	@sk:   sk
+ *	@list: list to empty
+ *	Delete all buffers on an &sk_buff list and subtruct the
+ *	truesize of the sk_buff for memory accounting. Each buffer
+ *	is removed from the list and one reference dropped. This
+ *	function does not take the list lock and the caller must
+ *	hold the relevant locks to use it.
+ */
+static inline void __skb_queue_purge_and_sub_memory_allocated(struct sock *sk,
+	struct sk_buff_head *list)
+{
+	struct sk_buff *skb;
+	int purged_skb_size = 0;
+	while ((skb = __skb_dequeue(list)) != NULL) {
+		purged_skb_size += sk_datagram_pages(skb->truesize);
+		kfree_skb(skb);
+	}
+	atomic_sub(purged_skb_size, sk->sk_prot->memory_allocated);
+}
+
 /* New destruction routine */
 
 void inet_sock_destruct(struct sock *sk)
 {
 	struct inet_sock *inet = inet_sk(sk);
 
-	__skb_queue_purge(&sk->sk_receive_queue);
+	if (sk->sk_prot->memory_allocated && sk->sk_type != SOCK_STREAM)
+		__skb_queue_purge_and_sub_memory_allocated(sk,
+&sk->sk_receive_queue);
+	else
+		__skb_queue_purge(&sk->sk_receive_queue);
+
 	__skb_queue_purge(&sk->sk_error_queue);
 
 	if (sk->sk_type == SOCK_STREAM && sk->sk_state != TCP_CLOSE) {
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/ip_output.c linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/ip_output.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/ip_output.c	2007-10-24 11:46:43.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/ip_output.c	2007-10-24 12:31:47.0 -0400
@@ -743,6 +743,8 @@ static inline int ip_ufo_append_data(str
 		/* specify the length of each IP datagram fragment*/
 		skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
 		skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
+		atomic_add(sk_datagram_pages(skb->truesize),
+			   sk->sk_prot->memory_allocated);
 		__skb_queue_tail(&sk->sk_write_queue, skb);
 
 		return 0;
@@ -924,6 +926,9 @@ alloc_new_skb:
 			}
 			if (skb == NULL)
 goto error;
+			if (sk->sk_prot->memory_allocated)
+atomic_add(sk_datagram_pages(skb->truesize),
+	   sk->sk_prot->memory_allocated);
 
 			/*
 			 *	Fill in the control structures
@@ -1023,6 +1028,8 @@ alloc_new_skb:
 frag = &skb_shinfo(skb)->frags[i];
 skb->truesize += PAGE_SIZE;
 atomic_add(PAGE_SIZE, &sk->sk_wmem_alloc);
+if (sk->sk_prot->memory_allocated)
+	atomic_inc(sk->sk_prot->memory_allocated);
 			} else {
 err = -EMSGSIZE;
 goto error;
@@ -1123,7 +1130,9 @@ ssize_t	ip_append_page(struct sock *sk, 
 			if (unlikely(!skb)) {
 err = -ENOBUFS;
 goto error;
-			}
+			} else if (sk->sk_prot->memory_allocated)
+atomic_add(sk_datagram_pages(skb->truesize),
+	   sk->sk_prot->memory_allocated);
 
 			/*
 			 *	Fill in the control structures
@@ -1202,13 +1211,14 @@ int ip_push_pending_frames(struct sock *
 	struct iphdr *iph;
 	__be16 df = 0;
 	__u8 ttl;
-	int err = 0;
+	int err = 0, send_page_size;
 
 	if ((skb = __skb_dequeue(&sk->sk_write_queue)) == NULL)
 		goto out;
 	tail_skb = &(skb_shinfo(skb)->frag_list);
 
 	/* move skb->data to ip header from ext header */
+	send_page_size = sk_datagram_pages(skb->truesize);
 	if (skb->data < skb_network_header(skb))
 		__skb_pull(skb, skb_network_offset(skb));
 	while ((tmp_skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
@@ -1218,6 +1228,7 @@ int ip_push_pending_frames(struct sock *
 		skb->len += tmp_skb->len;
 		skb->data_len += tmp_skb->len;
 		skb->truesize += tmp_skb->truesize;
+		send_page_size += sk_datagram_pages(tmp_skb->truesize);
 		__sock_put(tmp_skb->sk);
 		tmp_skb->destructor = NULL;
 		tmp_skb->sk = NULL;
@@ -1273,6 +1284,8 @@ int ip_push_pending_frames(struct sock *
 	/* Netfilter gets whole the not fragmented skb. */
 	err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL,
 		  skb->dst->dev, dst_output);
+	if (sk->sk_prot->memory_allocated)
+		atomic_sub(send_page_size, sk->sk_prot->memory_allocated);
 	if (err) {
 		if (err > 0)
 			err = inet->recverr ? net_xmit_errno(err) : 0;
@@ -1302,9 +1315,15 @@ void ip_flush_pending_frames(struct sock
 {
 	struct inet_sock *inet = inet_

[PATCH 5/5] introduce udp_rmem and udp_wmem

2007-10-29 Thread Hideo AOKI

This patch added /proc/sys/net/udp_rmem and /proc/sys/net/udp_rmem.
Each UDP packet is drooped when the number of pages for socket buffer
is beyond the limit and the socket already consumes minimum buffer.

--
Hideo Aoki
Hitachi Computer Products (America) Inc.

Cc: Satoshi Oshima <[EMAIL PROTECTED]>
Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]>

 Documentation/networking/ip-sysctl.txt |   12 
 include/net/udp.h  |4 
 net/ipv4/ip_output.c   |4 +++-
 net/ipv4/sysctl_net_ipv4.c |   20 
 net/ipv4/udp.c |   13 +++--
 5 files changed, 50 insertions(+), 3 deletions(-)

diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt linux-2.6.24-rc1-mem003-ipv4-dev-p5/Documentation/networking/ip-sysctl.txt
--- linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt	2007-10-26 20:35:52.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p5/Documentation/networking/ip-sysctl.txt	2007-10-29 09:44:05.0 -0400
@@ -452,6 +452,18 @@ udp_mem - INTEGER
 	Number of pages allowed for queueing by all UDP sockets.
 	Default is calculated at boot time from amount of available memory.
 
+udp_rmem - INTEGER
+	Minimal size of receive buffer used by UDP sockets. Each UDP socket
+	is able to use the size for receiving data, even if total pages of UDP
+	sockets exceed udp_mem. The unit is byte.
+	Default: 4096
+
+udp_wmem - INTEGER
+	Minimal size of send buffer used by UDP sockets. Each UDP socket is
+	able to use the size for sending data, even if total pages of UDP
+	sockets exceed udp_mem. The unit is byte.
+	Default: 4096
+
 CIPSOv4 Variables:
 
 cipso_cache_enable - BOOLEAN
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p4/include/net/udp.h linux-2.6.24-rc1-mem003-ipv4-dev-p5/include/net/udp.h
--- linux-2.6.24-rc1-mem003-ipv4-dev-p4/include/net/udp.h	2007-10-26 20:35:52.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p5/include/net/udp.h	2007-10-29 09:44:05.0 -0400
@@ -66,7 +66,11 @@ extern rwlock_t udp_hash_lock;
 extern struct proto udp_prot;
 
 extern atomic_t udp_memory_allocated;
+
+/* sysctl variables for udp */
 extern int sysctl_udp_mem;
+extern int sysctl_udp_rmem;
+extern int sysctl_udp_wmem;
 
 struct sk_buff;
 
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/ip_output.c linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/ip_output.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/ip_output.c	2007-10-29 09:36:32.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/ip_output.c	2007-10-29 09:44:05.0 -0400
@@ -705,7 +705,9 @@ static inline int __ip_check_max_skb_pag
 	switch(sk->sk_protocol) {
 	case IPPROTO_UDP:
 		if (atomic_read(sk->sk_prot->memory_allocated) + size
-		> sk->sk_prot->sysctl_mem[0])
+		> sk->sk_prot->sysctl_mem[0] &&
+		atomic_read(&sk->sk_wmem_alloc) + size
+		> sk->sk_prot->sysctl_wmem[0])
 			return -ENOBUFS;
 		/* Fall through */	
 	default:
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/sysctl_net_ipv4.c linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/sysctl_net_ipv4.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/sysctl_net_ipv4.c	2007-10-26 20:35:52.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/sysctl_net_ipv4.c	2007-10-29 09:44:05.0 -0400
@@ -896,6 +896,26 @@ ctl_table ipv4_table[] = {
 		.strategy	= &sysctl_intvec,
 		.extra1		= &zero
 	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "udp_rmem",
+		.data		= &sysctl_udp_rmem,
+		.maxlen		= sizeof(sysctl_udp_rmem),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_minmax,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero
+	},
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "udp_wmem",
+		.data		= &sysctl_udp_wmem,
+		.maxlen		= sizeof(sysctl_udp_wmem),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_minmax,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero
+	},
 	{ .ctl_name = 0 }
 };
 
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/udp.c linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/udp.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/udp.c	2007-10-26 20:35:52.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p5/net/ipv4/udp.c	2007-10-29 09:44:05.0 -0400
@@ -117,6 +117,8 @@ DEFINE_RWLOCK(udp_hash_lock);
 
 atomic_t udp_memory_allocated;
 int sysctl_udp_mem __read_mostly;
+int sysctl_udp_rmem __read_mostly;
+int sysctl_udp_wmem __read_mostly;
 
 static inline int __udp_lib_lport_inuse(__u16 num,
 	const struct hlist_head udptable[])
@@ -1026,8 +1028,10 @@ int udp_queue_rcv_skb(struct sock * sk, 
 	}
 
 	if ((atomic_read(sk->sk_prot->memory_allocated)
-		   + sk_datagram_pages(skb->truesize))
-		> sk->sk_prot->sysctl_mem[0]) {
+	 + sk_datagram_pages(skb->truesize))
+	> sk->sk_prot->sysctl_mem[0] &&
+	atomic_read(&sk->sk_rmem_alloc) + skb->truesize 
+	> sk->sk_prot->sysctl_rmem[0]) {
 		UDP_INC_STATS_BH(UDP_MIB_RCVBUFERRORS, up->pcfla

[PATCH 2/5] accounting unit and variable

2007-10-29 Thread Hideo AOKI

This patch introduces global variable for UDP memory accounting.
The unit is page.

--
Hideo Aoki
Hitachi Computer Products (America) Inc.

Signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]>
Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]>

 include/net/sock.h |7 +++
 include/net/udp.h  |2 ++
 net/ipv4/proc.c|3 ++-
 net/ipv4/udp.c |2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p1/include/net/sock.h linux-2.6.24-rc1-mem003-ipv4-dev-p2/include/net/sock.h
--- linux-2.6.24-rc1-mem003-ipv4-dev-p1/include/net/sock.h	2007-10-24 11:34:32.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p2/include/net/sock.h	2007-10-24 11:47:51.0 -0400
@@ -727,6 +727,13 @@ static inline int sk_stream_wmem_schedul
 	   sk_stream_mem_schedule(sk, size, 0);
 }
 
+#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE)
+
+static inline int sk_datagram_pages(int amt)
+{
+	return DIV_ROUND_UP(amt, SK_DATAGRAM_MEM_QUANTUM);
+}
+
 /* Used by processes to "lock" a socket state, so that
  * interrupts and bottom half handlers won't change it
  * from under us. It essentially blocks any incoming
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p1/include/net/udp.h linux-2.6.24-rc1-mem003-ipv4-dev-p2/include/net/udp.h
--- linux-2.6.24-rc1-mem003-ipv4-dev-p1/include/net/udp.h	2007-10-10 11:49:42.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p2/include/net/udp.h	2007-10-24 11:47:51.0 -0400
@@ -65,6 +65,8 @@ extern rwlock_t udp_hash_lock;
 
 extern struct proto udp_prot;
 
+extern atomic_t udp_memory_allocated;
+
 struct sk_buff;
 
 /*
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/proc.c linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/proc.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/proc.c	2007-10-24 11:34:34.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/proc.c	2007-10-24 11:47:51.0 -0400
@@ -67,7 +67,8 @@ static int sockstat_seq_show(struct seq_
 		   fold_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count),
 		   tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated),
 		   atomic_read(&tcp_memory_allocated));
-	seq_printf(seq, "UDP: inuse %d\n", fold_prot_inuse(&udp_prot));
+	seq_printf(seq, "UDP: inuse %d mem %d\n", fold_prot_inuse(&udp_prot),
+		   atomic_read(&udp_memory_allocated));
 	seq_printf(seq, "UDPLITE: inuse %d\n", fold_prot_inuse(&udplite_prot));
 	seq_printf(seq, "RAW: inuse %d\n", fold_prot_inuse(&raw_prot));
 	seq_printf(seq,  "FRAG: inuse %d memory %d\n",
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/udp.c linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/udp.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/udp.c	2007-10-24 11:34:35.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p2/net/ipv4/udp.c	2007-10-24 12:27:37.0 -0400
@@ -114,6 +114,8 @@ DEFINE_SNMP_STAT(struct udp_mib, udp_sta
 struct hlist_head udp_hash[UDP_HTABLE_SIZE];
 DEFINE_RWLOCK(udp_hash_lock);
 
+atomic_t udp_memory_allocated;
+
 static inline int __udp_lib_lport_inuse(__u16 num,
 	const struct hlist_head udptable[])
 {


[PATCH 4/5] memory limitation by using udp_mem

2007-10-29 Thread Hideo AOKI

This patch introduces memory limitation for UDP.

--
Hideo Aoki
Hitachi Computer Products (America) Inc.

Signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]>
Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]>

 Documentation/networking/ip-sysctl.txt |6 
 include/net/udp.h  |3 ++
 net/ipv4/af_inet.c |3 ++
 net/ipv4/ip_output.c   |   47 ++---
 net/ipv4/sysctl_net_ipv4.c |   11 +++
 net/ipv4/udp.c |   24 
 6 files changed, 91 insertions(+), 3 deletions(-)

diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p3/Documentation/networking/ip-sysctl.txt linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt
--- linux-2.6.24-rc1-mem003-ipv4-dev-p3/Documentation/networking/ip-sysctl.txt	2007-10-24 11:33:58.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p4/Documentation/networking/ip-sysctl.txt	2007-10-26 20:35:52.0 -0400
@@ -446,6 +446,12 @@ tcp_dma_copybreak - INTEGER
 	and CONFIG_NET_DMA is enabled.
 	Default: 4096
 
+UDP variables:
+
+udp_mem - INTEGER
+	Number of pages allowed for queueing by all UDP sockets.
+	Default is calculated at boot time from amount of available memory.
+
 CIPSOv4 Variables:
 
 cipso_cache_enable - BOOLEAN
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p3/include/net/udp.h linux-2.6.24-rc1-mem003-ipv4-dev-p4/include/net/udp.h
--- linux-2.6.24-rc1-mem003-ipv4-dev-p3/include/net/udp.h	2007-10-24 11:47:51.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p4/include/net/udp.h	2007-10-26 20:35:52.0 -0400
@@ -66,6 +66,7 @@ extern rwlock_t udp_hash_lock;
 extern struct proto udp_prot;
 
 extern atomic_t udp_memory_allocated;
+extern int sysctl_udp_mem;
 
 struct sk_buff;
 
@@ -175,4 +176,6 @@ extern void udp_proc_unregister(struct u
 extern int  udp4_proc_init(void);
 extern void udp4_proc_exit(void);
 #endif
+
+extern void udp_init(void);
 #endif	/* _UDP_H */
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/af_inet.c linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/af_inet.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/af_inet.c	2007-10-24 19:10:27.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/af_inet.c	2007-10-26 20:35:52.0 -0400
@@ -1446,6 +1446,9 @@ static int __init inet_init(void)
 	/* Setup TCP slab cache for open requests. */
 	tcp_init();
 
+	/* Setup UDP memory threshold */
+	udp_init();
+
 	/* Add UDP-Lite (RFC 3828) */
 	udplite4_register();
 
diff -pruN linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/ip_output.c linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/ip_output.c
--- linux-2.6.24-rc1-mem003-ipv4-dev-p3/net/ipv4/ip_output.c	2007-10-24 12:31:47.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p4/net/ipv4/ip_output.c	2007-10-29 09:36:32.0 -0400
@@ -75,6 +75,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -699,6 +700,20 @@ csum_page(struct page *page, int offset,
 	return csum;
 }
 
+static inline int __ip_check_max_skb_pages(struct sock *sk, int size)
+{
+	switch(sk->sk_protocol) {
+	case IPPROTO_UDP:
+		if (atomic_read(sk->sk_prot->memory_allocated) + size
+		> sk->sk_prot->sysctl_mem[0])
+			return -ENOBUFS;
+		/* Fall through */	
+	default:
+		break;
+	}
+	return 0;
+}
+
 static inline int ip_ufo_append_data(struct sock *sk,
 			int getfrag(void *from, char *to, int offset, int len,
 			   int odd, struct sk_buff *skb),
@@ -707,16 +722,20 @@ static inline int ip_ufo_append_data(str
 {
 	struct sk_buff *skb;
 	int err;
+	int size = 0;
 
 	/* There is support for UDP fragmentation offload by network
 	 * device, so create one single skb packet containing complete
 	 * udp datagram
 	 */
 	if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) {
-		skb = sock_alloc_send_skb(sk,
-			hh_len + fragheaderlen + transhdrlen + 20,
-			(flags & MSG_DONTWAIT), &err);
+		size = hh_len + fragheaderlen + transhdrlen + 20;
+		err = __ip_check_max_skb_pages(sk, sk_datagram_pages(size));
+		if (err)
+			return err;
 
+		skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT),
+	  &err);
 		if (skb == NULL)
 			return err;
 
@@ -737,6 +756,10 @@ static inline int ip_ufo_append_data(str
 		sk->sk_sndmsg_off = 0;
 	}
 
+	err = __ip_check_max_skb_pages(sk, sk_datagram_pages(size + length - 
+			 transhdrlen));
+	if (err)
+		goto fail;
 	err = skb_append_datato_frags(sk,skb, getfrag, from,
 			   (length - transhdrlen));
 	if (!err) {
@@ -752,6 +775,7 @@ static inline int ip_ufo_append_data(str
 	/* There is not enough support do UFO ,
 	 * so follow normal path
 	 */
+fail:
 	kfree_skb(skb);
 	return err;
 }
@@ -910,6 +934,12 @@ alloc_new_skb:
 			if (datalen == length + fraggap)
 alloclen += rt->u.dst.trailer_len;
 
+			err = __ip_check_max_skb_pages(sk,
+sk_datagram_pages(SKB_DATA_ALIGN(alloclen + hh_len + 15)
++ sizeof(struct sk_buff)));
+			if (err)
+goto error;
+
 			if (transhdrlen) {
 

[PATCH] pegasos_eth.c: Fix compile error over MV643XX_ defines

2007-10-29 Thread Luis R. Rodriguez
This commit made an incorrect assumption:
--
Author: Lennert Buytenhek <[EMAIL PROTECTED]>
 Date:   Fri Oct 19 04:10:10 2007 +0200

mv643xx_eth: Move ethernet register definitions into private header

Move the mv643xx's ethernet-related register definitions from
include/linux/mv643xx.h into drivers/net/mv643xx_eth.h, since
they aren't of any use outside the ethernet driver.

Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
Acked-by: Tzachi Perelstein <[EMAIL PROTECTED]>
Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
--

arch/powerpc/platforms/chrp/pegasos_eth.c made use of a 3 defines there.

[EMAIL PROTECTED]:~/devel/wireless-2.6$ git-describe 

v2.6.24-rc1-138-g0119130

This patch fixes this by internalizing 3 defines onto pegasos which are
simply no longer available elsewhere. Without this your compile will fail
whenever you enable 'Common Hardware Reference Platform (CHRP) based machines',
(CONFIG_PPC_CHRP) as the Makefile for chrp adds it always:

obj-y   += setup.o time.o pegasos_eth.o pci.o

If these defines are platform specific then they should later just be added 
back to include/linux/mv643xx.h.

Compile error:

  CC  arch/powerpc/platforms/chrp/pegasos_eth.o
arch/powerpc/platforms/chrp/pegasos_eth.c: In function 'Enable_SRAM':
arch/powerpc/platforms/chrp/pegasos_eth.c:150: error: 'MV643XX_ETH_BAR_4' 
undeclared (first use in this function)
arch/powerpc/platforms/chrp/pegasos_eth.c:150: error: (Each undeclared 
identifier is reported only once
arch/powerpc/platforms/chrp/pegasos_eth.c:150: error: for each function it 
appears in.)
arch/powerpc/platforms/chrp/pegasos_eth.c:152: error: 
'MV643XX_ETH_SIZE_REG_4' undeclared (first use in this function)
arch/powerpc/platforms/chrp/pegasos_eth.c:154: error: 
'MV643XX_ETH_BASE_ADDR_ENABLE_REG' undeclared (first use in this function)
make[2]: *** [arch/powerpc/platforms/chrp/pegasos_eth.o] Error 1
make[1]: *** [arch/powerpc/platforms/chrp] Error 2
make: *** [arch/powerpc/platforms] Error 2

Signed-off-by: Luis R. Rodriguez <[EMAIL PROTECTED]>
---

 arch/powerpc/platforms/chrp/pegasos_eth.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c 
b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 5bcc58d..1fc9e8c 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -24,6 +24,9 @@
 #define PEGASOS2_SRAM_BASE_ETH0(PEGASOS2_SRAM_BASE)
 #define PEGASOS2_SRAM_BASE_ETH1
(PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
 
+#define PEGASOS2_ETH_BAR_4 0x2220
+#define PEGASOS2_ETH_SIZE_REG_40x2224
+#define PEGASOS2_ETH_BASE_ADDR_ENABLE_REG  0x2290
 
 #define PEGASOS2_SRAM_RXRING_SIZE  (PEGASOS2_SRAM_SIZE/4)
 #define PEGASOS2_SRAM_TXRING_SIZE  (PEGASOS2_SRAM_SIZE/4)
@@ -147,13 +150,13 @@ static int Enable_SRAM(void)
 
ALong = 0x02;
ALong |= PEGASOS2_SRAM_BASE & 0x;
-   MV_WRITE(MV643XX_ETH_BAR_4, ALong);
+   MV_WRITE(PEGASOS2_ETH_BAR_4, ALong);
 
-   MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0x);
+   MV_WRITE(PEGASOS2_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0x);
 
-   MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
+   MV_READ(PEGASOS2_ETH_BASE_ADDR_ENABLE_REG, ALong);
ALong &= ~(1 << 4);
-   MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
+   MV_WRITE(PEGASOS2_ETH_BASE_ADDR_ENABLE_REG, ALong);
 
 #ifdef BE_VERBOSE
printk("Pegasos II/Marvell MV64361: register unmapped\n");
-
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/5] fix send buffer check

2007-10-29 Thread Hideo AOKI

This patch introduces sndbuf size check before memory allocation for
send buffer.

--
Hideo Aoki
Hitachi Computer Products (America) Inc.

Signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]>
Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]>

 ip_output.c |5 +
 1 file changed, 5 insertions(+)

diff -pruN linux-2.6.24-rc1/net/ipv4/ip_output.c linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/ip_output.c
--- linux-2.6.24-rc1/net/ipv4/ip_output.c	2007-10-24 11:34:34.0 -0400
+++ linux-2.6.24-rc1-mem003-ipv4-dev-p1/net/ipv4/ip_output.c	2007-10-24 11:46:43.0 -0400
@@ -1004,6 +1004,11 @@ alloc_new_skb:
 	frag = &skb_shinfo(skb)->frags[i];
 }
 			} else if (i < MAX_SKB_FRAGS) {
+if (atomic_read(&sk->sk_wmem_alloc) + PAGE_SIZE
+> 2 * sk->sk_sndbuf) {
+	err = -ENOBUFS;
+	goto error;
+}
 if (copy > PAGE_SIZE)
 	copy = PAGE_SIZE;
 page = alloc_pages(sk->sk_allocation, 0);


[PATCH 0/5] UDP memory accounting and limitation (take 6)

2007-10-29 Thread Hideo AOKI

Hello,

This is the latest patch set of UDP memory accounting and limitation.

The number of pages for socket buffer is limited up to
/proc/sys/net/ipv4/udp_mem. I removed the minimal limit number
to use the feature from the former patch set (take5). And udp_init()
is introduced to calculate default value.

In addition, I added /proc/sys/net/ipv4/udp_rmem and
/proc/sys/net/ipv4/udp_wmem to be able to allocate minimum buffer to
each socket.

As a result, UDP packet is drooped when the number of pages for
socket buffer is beyond the limit and the socket already consumes
minimum buffer.

Detailed change log is below.

Changelog take 5 -> take 6:

 * removed minimal limit of /proc/sys/net/udp_mem
 * added udp_init() for default value calculation of parameters
 * added /proc/sys/net/udp_rmem and /proc/sys/net/udp_rmem
 * added limitation code to ip_ufo_append_data()
 * improved accounting for receiving packet
 * fixed typos
 * rebased to 2.6.24-rc1


Changelog take 4 -> take 5:

 * removing unnessesary EXPORT_SYMBOLs
 * adding minimal limit of /proc/sys/net/udp_mem
 * bugfix of UDP limit affecting protocol other than UDP
 * introducing __ip_check_max_skb_pages()
 * using CTL_UNNUMBERED
 * adding udp_mem usage to Documentation/networking/ip_sysctl.txt


Best regards,
Hideo Aoki

--
Hitachi Computer Products (America) Inc.
-
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


[bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

2007-10-29 Thread Ingo Molnar

hm, this seems to have popped up in the last few days, never had it 
before:

  sysfs: duplicate filename 'eth0' can not be created
  WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

  Call Trace:
   [] sysfs_add_one+0x54/0xbd
   [] sysfs_create_link+0xc6/0x11d
   [] device_rename+0x175/0x1d6
   [] dev_change_name+0x118/0x211
   [] dev_ioctl+0x4fa/0x5f8
   [] netlink_insert+0x13c/0x14b
   [] do_page_fault+0x3eb/0x73f
   [] sock_ioctl+0x1f2/0x200
   [] do_ioctl+0x21/0x6b
   [] vfs_ioctl+0x243/0x25c
   [] sys_ioctl+0x51/0x71
   [] system_call+0x7e/0x83

   net eth0: device_rename: sysfs_create_symlink failed (-17)

32-bit bzImage kernel - config attached. (The 64-bit kernel even lost 
connectivity due to this and ifcfg-eth0 got renamed to ifcfg-eth0.bak by 
kudzu.)

detected order of the interfaces is:

  forcedeth :00:0a.0: ifname eth0, PHY OUI 0x5043 @1
  eth1: RealTek RTL8139 at 0xc21f2000

and that's the ordering in /etc/sysconfig/network-scripts as well.

Ingo
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24-rc1
# Mon Oct 29 22:02:23 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_ZONE_DMA32=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_X86_CMPXCHG=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_DMI=y
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
# CONFIG_BOOTPARAM_SUPPORT is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
# CONFIG_BSD_PROCESS_ACCT_V3 is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# CONFIG_TASK_XACCT is not set
# CONFIG_USER_NS is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_TREE=y
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=20
# CONFIG_CGROUPS is not set
# CONFIG_FAIR_GROUP_SCHED is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_KMOD=y
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_X86_PC=y
# CONFIG_X86_VSMP is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_L1_CACHE_BYTES=128
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_INTERNODE_CACHE_BYTES=128
CONFIG_X86_TSC=y
CONFIG_X86_GOOD_APIC=y
CONFIG_MICROCODE=m
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
CONFIG_X86_HT=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_MTRR=y
CONFIG_SMP=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_BKL=y
CONFIG_NUMA=y
CONFIG_K8_NUMA=y
CONFIG_NODES_SHIFT=6
CONFIG_X86_64_ACPI_NUMA=y
# CONFIG_NUMA_EMU is not set
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_NEED_MULTIPLE_NODES=y
CONFIG_HAVE_MEMORY_PRESENT=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_VMEMMAP=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_MIGRATION=y
CONFIG

dn_route.c momentarily exiting RCU read-side critical section

2007-10-29 Thread Paul E. McKenney
Hello!

net/decnet/dn_route.c in dn_rt_cache_get_next() is as follows:

static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct 
dn_route *rt)
{
struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private);

rt = rt->u.dst.dn_next;
while(!rt) {
rcu_read_unlock_bh();
if (--s->bucket < 0)
break;

...  But what happens if seq->private is freed up right here?
...  Or what prevents this from happening?

rcu_read_lock_bh();
rt = dn_rt_hash_table[s->bucket].chain;
}
return rt;
}

Similar code is in rt_cache_get_next().

So, what am I missing here?

Thanx, Paul
-
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] nf_nat_h323.c unneeded rcu_dereference() calls

2007-10-29 Thread Paul E. McKenney
Hello!

While reviewing rcu_dereference() uses, I came across a number of cases
where I couldn't see how the rcu_dereference() helped.  One class of
cases is where the variable is never subsequently dereferenced, so that
patches like the following one would be appropriate.

So, what am I missing here?

Signed-off-by: Paul E. McKenney <[EMAIL PROTECTED]>
---

 nf_nat_h323.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff -urpNa -X dontdiff linux-2.6.23/net/ipv4/netfilter/nf_nat_h323.c 
linux-2.6.23-rcufix/net/ipv4/netfilter/nf_nat_h323.c
--- linux-2.6.23/net/ipv4/netfilter/nf_nat_h323.c   2007-10-09 
13:31:38.0 -0700
+++ linux-2.6.23-rcufix/net/ipv4/netfilter/nf_nat_h323.c2007-10-29 
14:00:13.0 -0700
@@ -546,15 +546,15 @@ static int nat_callforwarding(struct sk_
 //
 static int __init init(void)
 {
-   BUG_ON(rcu_dereference(set_h245_addr_hook) != NULL);
-   BUG_ON(rcu_dereference(set_h225_addr_hook) != NULL);
-   BUG_ON(rcu_dereference(set_sig_addr_hook) != NULL);
-   BUG_ON(rcu_dereference(set_ras_addr_hook) != NULL);
-   BUG_ON(rcu_dereference(nat_rtp_rtcp_hook) != NULL);
-   BUG_ON(rcu_dereference(nat_t120_hook) != NULL);
-   BUG_ON(rcu_dereference(nat_h245_hook) != NULL);
-   BUG_ON(rcu_dereference(nat_callforwarding_hook) != NULL);
-   BUG_ON(rcu_dereference(nat_q931_hook) != NULL);
+   BUG_ON(set_h245_addr_hook != NULL);
+   BUG_ON(set_h225_addr_hook != NULL);
+   BUG_ON(set_sig_addr_hook != NULL);
+   BUG_ON(set_ras_addr_hook != NULL);
+   BUG_ON(nat_rtp_rtcp_hook != NULL);
+   BUG_ON(nat_t120_hook != NULL);
+   BUG_ON(nat_h245_hook != NULL);
+   BUG_ON(nat_callforwarding_hook != NULL);
+   BUG_ON(nat_q931_hook != NULL);
 
rcu_assign_pointer(set_h245_addr_hook, set_h245_addr);
rcu_assign_pointer(set_h225_addr_hook, set_h225_addr);
-
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: [PATCH] [IPv4] SNMP: Refer correct memory location to display ICMP out-going statistics

2007-10-29 Thread David Stevens
Dave,
I didn't see a response for this one... in case it fell through 
the
cracks. Just want to make sure my bone-headed error doesn't hang
around too long. :-)

+-DLS

- Forwarded by David Stevens/Beaverton/IBM on 10/29/2007 01:51 PM 
-

Mitsuru Chinen <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
10/25/2007 06:59 PM

To
netdev@vger.kernel.org
cc
David Stevens/Beaverton/[EMAIL PROTECTED]
Subject
[PATCH] [IPv4] SNMP: Refer correct memory location to display ICMP 
out-going statistics






While displaying ICMP out-going statistics as Out counters in
/proc/net/snmp, the memory location for ICMP in-coming statistics
was referred by mistake.

Acked-by: David L Stevens <[EMAIL PROTECTED]> 
Signed-off-by: Mitsuru Chinen <[EMAIL PROTECTED]>
---
 net/ipv4/proc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index fd16cb8..b7f7f8a 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -312,7 +312,7 @@ static void icmp_put(struct seq_file *seq)
 for (i=0; icmpmibmap[i].name != NULL; i++)
 seq_printf(seq, " %lu",
 snmp_fold_field((void **) 
icmpmsg_statistics,
- icmpmibmap[i].index));
+ icmpmibmap[i].index | 0x100));
 }
 
 /*
-- 
1.5.3.4

-
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

-
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] inet: race in wait for connect.

2007-10-29 Thread Stephen Hemminger
Fix possible race while waiting for connections in accept. I don't
know of a test case that could reproduce this directly.

The state of the socket should be checked before checking the queue.
If the socket has left the TCP_LISTEN state, then the accept queue
is no longer valid.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- a/net/ipv4/inet_connection_sock.c   2007-10-26 11:54:41.0 -0700
+++ b/net/ipv4/inet_connection_sock.c   2007-10-29 08:34:03.0 -0700
@@ -203,12 +203,12 @@ static int inet_csk_wait_for_connect(str
if (reqsk_queue_empty(&icsk->icsk_accept_queue))
timeo = schedule_timeout(timeo);
lock_sock(sk);
-   err = 0;
-   if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
-   break;
err = -EINVAL;
if (sk->sk_state != TCP_LISTEN)
break;
+   err = 0;
+   if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
+   break;
err = sock_intr_errno(timeo);
if (signal_pending(current))
break;
-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread David Stevens
> For v6, there are plenty of operational reasons to not allow this.  You 
really
> turn unicast into anycast when you do this and there are special rules 
to
> be followed.

I don't see it that way. The only "problem" I can think of offhand
is that you can't use a multi-interface address to identify an interface
(for example, for multicasting) and get predictable results (it'll pick
the first one it finds with that address, in no particular order). But
you can still use interface indexes, which are unique.
Anycast is used for multiple distinct hosts, which isn't an issue
on the same host. It's already true, as you pointed out, that you can
receive a packet for any local address on any interface, so allowing
multiple instances means you still match it as local. Which interface
you match it on usually isn't relevant, and when it is are exactly the
cases where using duplicates might be appropriate.
I can see where it might be useful if you have policy
restrictions on some interfaces and want the particular address
to be both in and out of a set. But, I agree, it's generally more
trouble (for an administrator), but then administrators don't have
to assign the same address to multiple interfaces. 

+-DLS

-
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 1/2] [CRYPTO] tcrypt: Move sg_init_table out of timing loops

2007-10-29 Thread Jens Axboe
On Fri, Oct 26 2007, Herbert Xu wrote:
> [CRYPTO] tcrypt: Move sg_init_table out of timing loops
> 
> This patch moves the sg_init_table out of the timing loops for hash
> algorithms so that it doesn't impact on the speed test results.

Wouldn't it be better to just make sg_init_one() call sg_init_table?

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4571231..ccc55a6 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -202,28 +202,6 @@ static inline void __sg_mark_end(struct scatterlist *sg)
 }
 
 /**
- * sg_init_one - Initialize a single entry sg list
- * @sg: SG entry
- * @buf:Virtual address for IO
- * @buflen: IO length
- *
- * Notes:
- *   This should not be used on a single entry that is part of a larger
- *   table. Use sg_init_table() for that.
- *
- **/
-static inline void sg_init_one(struct scatterlist *sg, const void *buf,
-  unsigned int buflen)
-{
-   memset(sg, 0, sizeof(*sg));
-#ifdef CONFIG_DEBUG_SG
-   sg->sg_magic = SG_MAGIC;
-#endif
-   sg_mark_end(sg, 1);
-   sg_set_buf(sg, buf, buflen);
-}
-
-/**
  * sg_init_table - Initialize SG table
  * @sgl:  The SG table
  * @nents:Number of entries in table
@@ -247,6 +225,24 @@ static inline void sg_init_table(struct scatterlist *sgl, 
unsigned int nents)
 }
 
 /**
+ * sg_init_one - Initialize a single entry sg list
+ * @sg: SG entry
+ * @buf:Virtual address for IO
+ * @buflen: IO length
+ *
+ * Notes:
+ *   This should not be used on a single entry that is part of a larger
+ *   table. Use sg_init_table() for that.
+ *
+ **/
+static inline void sg_init_one(struct scatterlist *sg, const void *buf,
+  unsigned int buflen)
+{
+   sg_init_table(sg, 1);
+   sg_set_buf(sg, buf, buflen);
+}
+
+/**
  * sg_phys - Return physical address of an sg entry
  * @sg: SG entry
  *

-- 
Jens Axboe

-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread Vlad Yasevich
David Stevens wrote:
> [EMAIL PROTECTED] wrote on 10/29/2007 11:03:37 AM:
> 
>> So, I am looking for technical reasons why this is permitted.
> 
> Vlad,
> Is there a technical reason to disallow it? Rather than
> anticipate all the possible uses for a machine, it's, of course,
> generally better to restrict only the things you know can't
> work, and allow everything else.
> 
> +-DLS

For v4, not really, but it really confuses some people (and thus causes
me headaches ;-)

For v6, there are plenty of operational reasons to not allow this.  You really
turn unicast into anycast when you do this and there are special rules to
be followed.

-vlad
-
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 2/2] netdrvr/ibmlana: move away from legacy MCA API

2007-10-29 Thread Jeff Garzik

Jan Engelhardt wrote:

On Oct 29 2007 15:33, Jeff Garzik wrote:

+#if 0 /* info available elsewhere, but this is kept for reference */


It is available in the git history, yes, is it still needed for reference?


it's there to see if anyone complains at its removal :)



+static short ibmlana_adapter_ids[] __initdata = {
+   IBM_LANA_ID,
+   0x
+};
+
+static char *ibmlana_adapter_names[] __initdata = {
+   "IBM LAN Adapter/A",
+   NULL
+};


Can this be const?


Not with the initdata marker, no.

Jeff



-
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 2/2] netdrvr/ibmlana: move away from legacy MCA API

2007-10-29 Thread Jan Engelhardt

On Oct 29 2007 15:33, Jeff Garzik wrote:
> 
>+#if 0 /* info available elsewhere, but this is kept for reference */

It is available in the git history, yes, is it still needed for reference?

>+static short ibmlana_adapter_ids[] __initdata = {
>+  IBM_LANA_ID,
>+  0x
>+};
>+
>+static char *ibmlana_adapter_names[] __initdata = {
>+  "IBM LAN Adapter/A",
>+  NULL
>+};

Can this be const?

-
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: Configuring the same IP on multiple addresses

2007-10-29 Thread David Stevens
[EMAIL PROTECTED] wrote on 10/29/2007 11:03:37 AM:

> So, I am looking for technical reasons why this is permitted.

Vlad,
Is there a technical reason to disallow it? Rather than
anticipate all the possible uses for a machine, it's, of course,
generally better to restrict only the things you know can't
work, and allow everything else.

+-DLS

-
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/2] netdrvr/ibmlana: modularization cleanup

2007-10-29 Thread Jeff Garzik
* move alloc_netdev() call, register_netdev() call, and associated failure
  cleanup into ibmlana_probe()

* move per-net_device cleanup into ibmlana_remove_one()

Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ibmlana.c |  109 +
 1 files changed, 64 insertions(+), 45 deletions(-)

diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 91d83ac..006d0d7 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -890,11 +890,14 @@ static void ibmlana_set_multicast_list(struct net_device 
*dev)
  * hardware check
  *  */
 
+static int ibmlana_irq;
+static int ibmlana_io;
 static int startslot;  /* counts through slots when probing multiple 
devices */
 
-static int ibmlana_probe(struct net_device *dev)
+static int ibmlana_probe(struct net_device **dev_out)
 {
-   int slot, z;
+   struct net_device *dev;
+   int slot, z, rc;
int base = 0, irq = 0, iobase = 0, memlen = 0;
ibmlana_priv *priv;
ibmlana_medium medium;
@@ -904,6 +907,13 @@ static int ibmlana_probe(struct net_device *dev)
if (MCA_bus == 0)
return -ENODEV;
 
+   dev = alloc_etherdev(sizeof(ibmlana_priv));
+   if (!dev)
+   return -ENOMEM;
+
+   dev->irq = ibmlana_irq;
+   dev->base_addr = ibmlana_io;
+
base = dev->mem_start;
irq = dev->irq;
 
@@ -924,8 +934,10 @@ static int ibmlana_probe(struct net_device *dev)
}
 
/* nothing found ? */
-   if (slot == -1)
-   return (base != 0 || irq != 0) ? -ENXIO : -ENODEV;
+   if (slot == -1) {
+   rc = (base != 0 || irq != 0) ? -ENXIO : -ENODEV;
+   goto err_out;
+   }
 
/* announce success */
printk(KERN_INFO "%s: IBM LAN Adapter/A found in slot %d\n", dev->name, 
slot + 1);
@@ -934,7 +946,8 @@ static int ibmlana_probe(struct net_device *dev)
if (!request_region(iobase, IBM_LANA_IORANGE, DRV_NAME)) {
printk(KERN_ERR "%s: cannot allocate I/O range at %#x!\n", 
DRV_NAME, iobase);
startslot = slot + 1;
-   return -EBUSY;
+   rc = -EBUSY;
+   goto err_out;
}
 
priv = netdev_priv(dev);
@@ -955,8 +968,8 @@ static int ibmlana_probe(struct net_device *dev)
if (!priv->base) {
printk(KERN_ERR "%s: cannot remap memory!\n", DRV_NAME);
startslot = slot + 1;
-   release_region(iobase, IBM_LANA_IORANGE);
-   return -EBUSY;
+   rc = -EBUSY;
+   goto err_out_reg;
}
 
/* make procfs entries */
@@ -996,73 +1009,79 @@ static int ibmlana_probe(struct net_device *dev)
 
startslot = slot + 1;
 
+   rc = register_netdev(dev);
+   if (rc)
+   goto err_out_claimed;
+
+   *dev_out = dev;
return 0;
+
+err_out_claimed:
+   mca_mark_as_unused(priv->slot);
+   mca_set_adapter_name(priv->slot, "");
+   mca_set_adapter_procfn(priv->slot, NULL, NULL);
+   iounmap(priv->base);
+err_out_reg:
+   release_region(iobase, IBM_LANA_IORANGE);
+err_out:
+   free_netdev(dev);
+   return rc;
+}
+
+static void ibmlana_remove_one(struct net_device *_dev)
+{
+   struct net_device *dev = _dev;
+   ibmlana_priv *priv = netdev_priv(dev);
+
+   unregister_netdev(dev);
+   /*DeinitBoard(dev); */
+   release_region(dev->base_addr, IBM_LANA_IORANGE);
+   mca_mark_as_unused(priv->slot);
+   mca_set_adapter_name(priv->slot, "");
+   mca_set_adapter_procfn(priv->slot, NULL, NULL);
+   iounmap(priv->base);
+   free_netdev(dev);
 }
 
 /* 
  * modularization support
  *  */
 
-#ifdef MODULE
-
 #define DEVMAX 5
 
 static struct net_device *moddevs[DEVMAX];
-static int irq;
-static int io;
 
-module_param(irq, int, 0);
-module_param(io, int, 0);
+module_param_named(irq, ibmlana_irq, int, 0);
+module_param_named(io, ibmlana_io, int, 0);
 MODULE_PARM_DESC(irq, "IBM LAN/A IRQ number");
 MODULE_PARM_DESC(io, "IBM LAN/A I/O base address");
 MODULE_LICENSE("GPL");
 
-int init_module(void)
+static int __init ibmlana_init_module(void)
 {
int z;
 
startslot = 0;
for (z = 0; z < DEVMAX; z++) {
-   struct net_device *dev = alloc_etherdev(sizeof(ibmlana_priv));
-   if (!dev)
-   break;
-   dev->irq = irq;
-   dev->base_addr = io;
-   if (ibmlana_probe(dev)) {
-   free_netdev(dev);
-   break;
-   }
-   if (register_netdev(dev)) {
-   ibmlana_priv *priv = netdev_priv(dev);
-   release_region(dev->base_add

[PATCH 2/2] netdrvr/ibmlana: move away from legacy MCA API

2007-10-29 Thread Jeff Garzik
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ibmlana.c |  119 +
 1 files changed, 51 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 006d0d7..188c0a9 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -83,7 +83,7 @@ History:
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -161,13 +161,13 @@ static void PrTime(void)
 
 /* deduce resources out of POS registers */
 
-static void getaddrs(int slot, int *base, int *memlen, int *iobase,
-int *irq, ibmlana_medium * medium)
+static void getaddrs(struct mca_device *mdev, int *base, int *memlen,
+int *iobase, int *irq, ibmlana_medium *medium)
 {
u_char pos0, pos1;
 
-   pos0 = mca_read_stored_pos(slot, 2);
-   pos1 = mca_read_stored_pos(slot, 3);
+   pos0 = mca_device_read_stored_pos(mdev, 2);
+   pos1 = mca_device_read_stored_pos(mdev, 3);
 
*base = 0xc + ((pos1 & 0xf0) << 9);
*memlen = (pos1 & 0x01) ? 0x8000 : 0x4000;
@@ -744,6 +744,7 @@ static irqreturn_t irq_handler(int irq, void *device)
 
 /* MCA info */
 
+#if 0 /* info available elsewhere, but this is kept for reference */
 static int ibmlana_getinfo(char *buf, int slot, void *d)
 {
int len = 0, i;
@@ -771,6 +772,7 @@ static int ibmlana_getinfo(char *buf, int slot, void *d)
 
return len;
 }
+#endif
 
 /* open driver.  Means also initialization and start of LANCE */
 
@@ -894,19 +896,26 @@ static int ibmlana_irq;
 static int ibmlana_io;
 static int startslot;  /* counts through slots when probing multiple 
devices */
 
-static int ibmlana_probe(struct net_device **dev_out)
+static short ibmlana_adapter_ids[] __initdata = {
+   IBM_LANA_ID,
+   0x
+};
+
+static char *ibmlana_adapter_names[] __initdata = {
+   "IBM LAN Adapter/A",
+   NULL
+};
+
+static int ibmlana_init_one(struct device *kdev)
 {
+   struct mca_device *mdev = to_mca_device(kdev);
struct net_device *dev;
-   int slot, z, rc;
+   int slot = mdev->slot, z, rc;
int base = 0, irq = 0, iobase = 0, memlen = 0;
ibmlana_priv *priv;
ibmlana_medium medium;
DECLARE_MAC_BUF(mac);
 
-   /* can't work without an MCA bus ;-) */
-   if (MCA_bus == 0)
-   return -ENODEV;
-
dev = alloc_etherdev(sizeof(ibmlana_priv));
if (!dev)
return -ENOMEM;
@@ -917,25 +926,16 @@ static int ibmlana_probe(struct net_device **dev_out)
base = dev->mem_start;
irq = dev->irq;
 
-   for (slot = startslot; (slot = mca_find_adapter(IBM_LANA_ID, slot)) != 
-1; slot++) {
-   /* deduce card addresses */
-   getaddrs(slot, &base, &memlen, &iobase, &irq, &medium);
-
-   /* slot already in use ? */
-   if (mca_is_adapter_used(slot))
-   continue;
-   /* were we looking for something different ? */
-   if (dev->irq && dev->irq != irq)
-   continue;
-   if (dev->mem_start && dev->mem_start != base)
-   continue;
-   /* found something that matches */
-   break;
-   }
+   /* deduce card addresses */
+   getaddrs(mdev, &base, &memlen, &iobase, &irq, &medium);
 
-   /* nothing found ? */
-   if (slot == -1) {
-   rc = (base != 0 || irq != 0) ? -ENXIO : -ENODEV;
+   /* were we looking for something different ? */
+   if (dev->irq && dev->irq != irq) {
+   rc = -ENODEV;
+   goto err_out;
+   }
+   if (dev->mem_start && dev->mem_start != base) {
+   rc = -ENODEV;
goto err_out;
}
 
@@ -952,11 +952,10 @@ static int ibmlana_probe(struct net_device **dev_out)
 
priv = netdev_priv(dev);
priv->slot = slot;
-   priv->realirq = irq;
+   priv->realirq = mca_device_transform_irq(mdev, irq);
priv->medium = medium;
spin_lock_init(&priv->lock);
 
-
/* set base + irq for this device (irq not allocated so far) */
 
dev->irq = 0;
@@ -972,18 +971,14 @@ static int ibmlana_probe(struct net_device **dev_out)
goto err_out_reg;
}
 
-   /* make procfs entries */
-   mca_set_adapter_name(slot, "IBM LAN Adapter/A");
-   mca_set_adapter_procfn(slot, (MCA_ProcFn) ibmlana_getinfo, dev);
-
-   mca_mark_as_used(slot);
+   mca_device_set_name(mdev, ibmlana_adapter_names[mdev->index]);
+   mca_device_set_claim(mdev, 1);
 
/* set methods */
 
dev->open = ibmlana_open;
dev->stop = ibmlana_close;
dev->hard_start_xmit = ibmlana_tx;
-   dev->do_ioctl = NULL;
dev->set_multicast_list = ibmlana_set_multicast_list;
dev->flags |= IFF_MULTICAST;
 
@@ -1013,13 +1008,11 @@ static int ibmlana_probe(stru

Re: [PATCH 2/2] NFS: handle IPv6 addresses in nfs ctl

2007-10-29 Thread Brian Haley

Hi Aurelien,

This is a combination of your two patches into one, cleaned-up with all 
my complaints.  I also added an ipv6_addr_set_v4mapped() inline after 
someone else here convinced me it gets rid of a lot of cruft from the 
code.  The DCCP, etc. code can be cleaned-up later if this gets accepted.


I have only compile-tested this, hoping you can test the functionality.

-Brian


Add IPv6 support to NFS server ip_map caching code and knfsd syscall 
interface - write_getfs() and write_getfd() will now accept IPv6 addresses.


Signed-off-by: Brian Haley <[EMAIL PROTECTED]>
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 66d0aeb..c47ba77 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define NFSDDBG_FACILITY	NFSDDBG_EXPORT
 
@@ -1556,6 +1557,7 @@ exp_addclient(struct nfsctl_client *ncp)
 {
 	struct auth_domain	*dom;
 	int			i, err;
+	struct in6_addr		in6;
 
 	/* First, consistency check. */
 	err = -EINVAL;
@@ -1574,9 +1576,10 @@ exp_addclient(struct nfsctl_client *ncp)
 		goto out_unlock;
 
 	/* Insert client into hashtable. */
-	for (i = 0; i < ncp->cl_naddr; i++)
-		auth_unix_add_addr(ncp->cl_addrlist[i], dom);
-
+	for (i = 0; i < ncp->cl_naddr; i++) {
+		ipv6_addr_set_v4mapped(ncp->cl_addrlist[i].s_addr, &in6);
+		auth_unix_add_addr(&in6, dom);
+	}
 	auth_unix_forget_old(dom);
 	auth_domain_put(dom);
 
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 77dc989..5cb5f0d 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 
 /*
  *	We have a single directory with 9 nodes in it.
@@ -219,24 +220,37 @@ static ssize_t write_getfs(struct file *file, char *buf, size_t size)
 {
 	struct nfsctl_fsparm *data;
 	struct sockaddr_in *sin;
+	struct sockaddr_in6 *sin6;
 	struct auth_domain *clp;
 	int err = 0;
 	struct knfsd_fh *res;
+	struct in6_addr in6;
 
 	if (size < sizeof(*data))
 		return -EINVAL;
 	data = (struct nfsctl_fsparm*)buf;
 	err = -EPROTONOSUPPORT;
-	if (data->gd_addr.sa_family != AF_INET)
+	switch (data->gd_addr.sa_family) {
+	case AF_INET:
+		sin = (struct sockaddr_in *)&data->gd_addr;
+		ipv6_addr_set_v4mapped(sin->sin_addr.s_addr, &in6);
+		break;
+	case AF_INET6:
+		sin6 = (struct sockaddr_in6 *)&data->gd_addr;
+		ipv6_addr_copy(&in6, &sin6->sin6_addr); 
+		break;
+	default:
 		goto out;
-	sin = (struct sockaddr_in *)&data->gd_addr;
+	}
+
 	if (data->gd_maxlen > NFS3_FHSIZE)
 		data->gd_maxlen = NFS3_FHSIZE;
 
 	res = (struct knfsd_fh*)buf;
 
 	exp_readlock();
-	if (!(clp = auth_unix_lookup(sin->sin_addr)))
+
+	if (!(clp = auth_unix_lookup(&in6)))
 		err = -EPERM;
 	else {
 		err = exp_rootfh(clp, data->gd_path, res, data->gd_maxlen);
@@ -253,25 +267,41 @@ static ssize_t write_getfd(struct file *file, char *buf, size_t size)
 {
 	struct nfsctl_fdparm *data;
 	struct sockaddr_in *sin;
+	struct sockaddr_in6 *sin6;
 	struct auth_domain *clp;
 	int err = 0;
 	struct knfsd_fh fh;
 	char *res;
+	struct in6_addr in6;
 
 	if (size < sizeof(*data))
 		return -EINVAL;
 	data = (struct nfsctl_fdparm*)buf;
 	err = -EPROTONOSUPPORT;
-	if (data->gd_addr.sa_family != AF_INET)
+	if (data->gd_addr.sa_family != AF_INET &&
+	data->gd_addr.sa_family != AF_INET6)
 		goto out;
 	err = -EINVAL;
 	if (data->gd_version < 2 || data->gd_version > NFSSVC_MAXVERS)
 		goto out;
 
 	res = buf;
-	sin = (struct sockaddr_in *)&data->gd_addr;
 	exp_readlock();
-	if (!(clp = auth_unix_lookup(sin->sin_addr)))
+
+	switch (data->gd_addr.sa_family) {
+	case AF_INET:
+		sin = (struct sockaddr_in *)&data->gd_addr;
+		ipv6_addr_set_v4mapped(sin->sin_addr.s_addr, &in6);
+		break;
+	case AF_INET6:
+		sin6 = (struct sockaddr_in6 *)&data->gd_addr;
+		ipv6_addr_copy(&in6, &sin6->sin6_addr);
+		break;
+	default:
+		goto out;
+	}
+
+	if (!(clp = auth_unix_lookup(&in6)))
 		err = -EPERM;
 	else {
 		err = exp_rootfh(clp, data->gd_path, &fh, NFS_FHSIZE);
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 22e1ef8..64ecb93 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define SVC_CRED_NGROUPS	32
 struct svc_cred {
@@ -120,10 +121,10 @@ extern void	svc_auth_unregister(rpc_authflavor_t flavor);
 
 extern struct auth_domain *unix_domain_find(char *name);
 extern void auth_domain_put(struct auth_domain *item);
-extern int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom);
+extern int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom);
 extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new);
 extern struct auth_domain *auth_domain_find(char *name);
-extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
+extern struct auth_domain *auth_unix_lookup(struct in6_addr *addr);
 extern int auth_unix_forget_old(struct auth_domain *dom);
 extern void svcauth_unix_purge(void);
 extern void svcauth_unix_info_release(void *);
d

Re: [Bugme-new] [Bug 9260] New: tipc_config.h is not installed when doing "make headers_install"

2007-10-29 Thread Andrew Morton
On Mon, 29 Oct 2007 09:10:26 -0700 (PDT)
[EMAIL PROTECTED] wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9260
> 
>Summary: tipc_config.h is not installed when doing "make
> headers_install"
>Product: Other
>Version: 2.5
>  KernelVersion: 2.6.23.1
>   Platform: All
> OS/Version: Linux
>   Tree: Mainline
> Status: NEW
>   Severity: normal
>   Priority: P1
>  Component: Configuration
> AssignedTo: [EMAIL PROTECTED]
> ReportedBy: [EMAIL PROTECTED]
> 
> 
> Most recent kernel where this bug did not occur: 2.6.15.7
> Distribution: all
> Hardware Environment: all
> Software Environment: all
> 
> Problem Description:
> When doing "make headers_install" the file tipc_config.h is not installed. It
> describes the interface to configure the TIPC module and it is needed when
> building the config utility (tipc-config). 
> Adding the following line to include/linux/Kbuild solves this:
> header-y += tipc_config.h
> 
> Steps to reproduce: make headers_install
> 
-
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


Configuring the same IP on multiple addresses

2007-10-29 Thread Vlad Yasevich
Hi All

Does anyone have a reason why Linux allows one to configure
the same IP or IPv6 address on multiple interfaces?

For IPv4, since linux implements a weak host model, assigning
duplicate addresses doesn't make any sense, since the addresses
really belong to the host and not the interface.

For IPv6, I can see allowing duplicate link-locals since that's
perfectly valid from the protocol perspective.  However, duplicate
globals are shouldn't be allows from the perspective of the address
architecture.

So, I am looking for technical reasons why this is permitted.

Thanks
-vlad
-
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] pcnet: fix sparse triviality

2007-10-29 Thread Kok, Auke
Jeff Garzik wrote:
> Auke Kok wrote:
>> Since data can never exceed u32, it can't even be larger than
>> LONG_MAX/HZ.
>>
>> Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
>> Cc: [EMAIL PROTECTED]
>> ---
>>
> Two comments:
> 
> 1) I would prefer to pick a sane limit, like "1 day".  The unit of
> 'data' is seconds, so IMO we should not allow stupid timeouts, much less
> INT_MAX ones :)  But hey, then again, maybe we should permit root to
> hang themselves with own rope...

well, in this case it's only used for the blink interval for the LED on the back
of the adapter. This is completely interruptable by the user with ^C when 
running
ethtool, so it's not going to hang anything (traffic should continue nicely).

yes INT_MAX is insanely long. moving all of this checking to the ethtool generic
code makes much more sense indeed.

> 2) [tangent] someone really should add the obvious ssleep_interruptible()

*pass* :)

Auke
-
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


kernel panic removing devices from a teql queuing discipline

2007-10-29 Thread Chuck Ebbert
https://bugzilla.redhat.com/show_bug.cgi?id=219488

Still happening in 2.6.22.9:

BUG: unable to handle kernel paging request at virtual address 66696674
 printing eip:
d098d4de
*pde = 
Oops:  [#1]
SMP 
last sysfs file: /class/net/lo/ifindex
Modules linked in: sch_teql netconsole autofs4 hidp rfcomm l2cap bluetooth 
sunrpc ipv6 dm_multipath video sbs i2c_ec button battery asus_acpi ac 
parport_pc lp parport floppy i2c_piix4 pcspkr i2c_core pcnet32 mii serio_raw 
ide_cd cdrom dm_snapshot dm_zero dm_mirror dm_mod ext3 jbd ehci_hcd ohci_hcd 
uhci_hcd
CPU:0
EIP:0060:[]Not tainted VLI
EFLAGS: 00010202   (2.6.18-1.2849.fc6 #1) 
EIP is at teql_master_xmit+0xdc/0x3aa [sch_teql]
eax: c06a82c0   ebx: cde25c80   ecx:    edx: c06ad680
esi: c12f8e00   edi: cfc73800   ebp: 66696670   esp: ca6c8bb8
ds: 007b   es: 007b   ss: 0068
Process ping (pid: 2275, ti=ca6c8000 task=cc7bd400 task.ti=ca6c8000)
Stack: cde25174  04cc ca6f0800 c12f8e00 04cc cc7f5280 ca6f0c00 
   cc7f5280 cc7f5280    c06a82c0  ca6f0800 
   c12f8e00 c12f8e00 c0823e08 c05b9606 ca6c8c20  c12f8e00 ca6f0800 
Call Trace:
 [] dev_hard_start_xmit+0x1b9/0x218
 [] __qdisc_run+0xde/0x19b
 [] dev_queue_xmit+0x147/0x265
 [] ip_output+0x1df/0x20b
 [] ip_push_pending_frames+0x301/0x3c3
 [] raw_sendmsg+0x62e/0x6f0
 [] inet_sendmsg+0x3b/0x45
 [] sock_sendmsg+0xd0/0xeb
 [] sys_sendmsg+0x192/0x1f7
 [] sys_socketcall+0x240/0x261
 [] syscall_call+0x7/0xb

The panic is in __teql_resolve (which has been inlined into teql_master_xmit) in
net/sched/sch_teql.c at this line:

if (n && n->tbl == mn->tbl &&

Specifically the dereference of n->tbl is faulting as n is not valid.

And the address looks like part of an ASCCI string...  "figt"
-
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 4/4] ixgbe: minor sparse fixes

2007-10-29 Thread Auke Kok
From: Stephen Hemminger <[EMAIL PROTECTED]>

Make strings const if possible, and fix includes so forward definitions
are seen.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/ixgbe/ixgbe.h   |2 +-
 drivers/net/ixgbe/ixgbe_82598.c |3 +--
 drivers/net/ixgbe/ixgbe_main.c  |9 +
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index c160a7d..bc51432 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -244,7 +244,7 @@ extern struct ixgbe_info ixgbe_82598EB_info;
 extern struct ixgbe_info ixgbe_82598AT_info;
 
 extern char ixgbe_driver_name[];
-extern char ixgbe_driver_version[];
+extern const char ixgbe_driver_version[];
 
 extern int ixgbe_up(struct ixgbe_adapter *adapter);
 extern void ixgbe_down(struct ixgbe_adapter *adapter);
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 00ee201..4d64673 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -30,8 +30,7 @@
 #include 
 #include 
 
-#include "ixgbe_type.h"
-#include "ixgbe_common.h"
+#include "ixgbe.h"
 #include "ixgbe_phy.h"
 
 #define IXGBE_82598_MAX_TX_QUEUES 32
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index b75f1c6..00bc525 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -45,12 +45,13 @@
 #include "ixgbe_common.h"
 
 char ixgbe_driver_name[] = "ixgbe";
-static char ixgbe_driver_string[] =
-   "Intel(R) 10 Gigabit PCI Express Network Driver";
+static const char ixgbe_driver_string[] =
+   "Intel(R) 10 Gigabit PCI Express Network Driver";
 
 #define DRV_VERSION "1.1.18"
-char ixgbe_driver_version[] = DRV_VERSION;
-static char ixgbe_copyright[] = "Copyright (c) 1999-2007 Intel Corporation.";
+const char ixgbe_driver_version[] = DRV_VERSION;
+static const char ixgbe_copyright[] =
+"Copyright (c) 1999-2007 Intel Corporation.";
 
 static const struct ixgbe_info *ixgbe_info_tbl[] = {
[board_82598AF] = &ixgbe_82598AF_info,
-
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] e1000e: fix sparse warnings

2007-10-29 Thread Auke Kok
From: Stephen Hemminger <[EMAIL PROTECTED]>

Fix sparse warnings from e1000e driver in net-2.6.24.

Added a sparse fix for module param arrays which can have int values
but only the array index needs to be unsigned. --Auke

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/ethtool.c |4 ++--
 drivers/net/e1000e/param.c   |   35 ++-
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 0666e62..6a39784 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1680,8 +1680,8 @@ static int e1000_phys_id(struct net_device *netdev, u32 
data)
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
 
-   if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
-   data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
+   if (!data)
+   data = INT_MAX;
 
if (adapter->hw.phy.type == e1000_phy_ife) {
if (!adapter->blink_timer.function) {
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
index e4e655e..3327892 100644
--- a/drivers/net/e1000e/param.c
+++ b/drivers/net/e1000e/param.c
@@ -52,10 +52,11 @@ MODULE_PARM_DESC(copybreak,
  */
 
 #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
-#define E1000_PARAM(X, desc) \
-   static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
-   static int num_##X; \
-   module_param_array_named(X, X, int, &num_##X, 0); \
+#define E1000_PARAM(X, desc)   \
+   static int __devinitdata X[E1000_MAX_NIC+1] \
+   = E1000_PARAM_INIT; \
+   static unsigned int num_##X;\
+   module_param_array_named(X, X, int, &num_##X, 0);   \
MODULE_PARM_DESC(X, desc);
 
 
@@ -124,9 +125,9 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss 
workaround");
 
 struct e1000_option {
enum { enable_option, range_option, list_option } type;
-   char *name;
-   char *err;
-   int  def;
+   const char *name;
+   const char *err;
+   int def;
union {
struct { /* range_option info */
int min;
@@ -139,8 +140,8 @@ struct e1000_option {
} arg;
 };
 
-static int __devinit e1000_validate_option(int *value,
-  struct e1000_option *opt,
+static int __devinit e1000_validate_option(unsigned int *value,
+  const struct e1000_option *opt,
   struct e1000_adapter *adapter)
 {
if (*value == OPTION_UNSET) {
@@ -213,7 +214,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
}
 
{ /* Transmit Interrupt Delay */
-   struct e1000_option opt = {
+   const struct e1000_option opt = {
.type = range_option,
.name = "Transmit Interrupt Delay",
.err  = "using default of "
@@ -232,7 +233,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
}
}
{ /* Transmit Absolute Interrupt Delay */
-   struct e1000_option opt = {
+   const struct e1000_option opt = {
.type = range_option,
.name = "Transmit Absolute Interrupt Delay",
.err  = "using default of "
@@ -277,7 +278,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
}
}
{ /* Receive Absolute Interrupt Delay */
-   struct e1000_option opt = {
+   const struct e1000_option opt = {
.type = range_option,
.name = "Receive Absolute Interrupt Delay",
.err  = "using default of "
@@ -296,7 +297,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
}
}
{ /* Interrupt Throttling Rate */
-   struct e1000_option opt = {
+   const struct e1000_option opt = {
.type = range_option,
.name = "Interrupt Throttling Rate (ints/sec)",
.err  = "using default of "
@@ -344,7 +345,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
}
}
{ /* Smart Power Down */
-   struct e1000_option opt = {
+   const struct e1000_option opt = {
.type = enable_option,
.name = "PHY Smart Power Down",
.err  = "defaulting to Disabled",
@@ -352,7 +353,7 @@ void __devinit e1000e_check_options(struct e1000_adapter 
*adapter)
};
 
if (num_S

netdev@vger.kernel.org

2007-10-29 Thread Auke Kok
From: Roel Kluin <[EMAIL PROTECTED]>

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/82571.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index cf70522..14141a5 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -283,7 +283,7 @@ static s32 e1000_get_invariants_82571(struct e1000_adapter 
*adapter)
adapter->flags &= ~FLAG_HAS_WOL;
/* quad ports only support WoL on port A */
if (adapter->flags & FLAG_IS_QUAD_PORT &&
-   (!adapter->flags & FLAG_IS_QUAD_PORT_A))
+   (!(adapter->flags & FLAG_IS_QUAD_PORT_A)))
adapter->flags &= ~FLAG_HAS_WOL;
break;
 
-
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] e1000: sparse warnings fixes

2007-10-29 Thread Auke Kok
From: Stephen Hemminger <[EMAIL PROTECTED]>

Fix sparse warnings and problems from e1000 driver.

Added a sparse fix for the module param array index
-- Auke

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h |8 
 drivers/net/e1000/e1000_ethtool.c |   29 -
 drivers/net/e1000/e1000_hw.c  |4 ++--
 drivers/net/e1000/e1000_main.c|7 ++-
 drivers/net/e1000/e1000_param.c   |   23 ---
 5 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 781ed99..3b84028 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -351,4 +351,12 @@ enum e1000_state_t {
__E1000_DOWN
 };
 
+extern char e1000_driver_name[];
+extern const char e1000_driver_version[];
+
+extern void e1000_power_up_phy(struct e1000_adapter *);
+extern void e1000_set_ethtool_ops(struct net_device *netdev);
+extern void e1000_check_options(struct e1000_adapter *adapter);
+
+
 #endif /* _E1000_H_ */
diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index 6c9a643..667f18b 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -32,9 +32,6 @@
 
 #include 
 
-extern char e1000_driver_name[];
-extern char e1000_driver_version[];
-
 extern int e1000_up(struct e1000_adapter *adapter);
 extern void e1000_down(struct e1000_adapter *adapter);
 extern void e1000_reinit_locked(struct e1000_adapter *adapter);
@@ -733,16 +730,16 @@ err_setup:
 
 #define REG_PATTERN_TEST(R, M, W)  
\
 {  
\
-   uint32_t pat, value;   \
-   uint32_t test[] =  \
+   uint32_t pat, val; \
+   const uint32_t test[] =\
{0x5A5A5A5A, 0xA5A5A5A5, 0x, 0x};  \
-   for (pat = 0; pat < ARRAY_SIZE(test); pat++) {  \
+   for (pat = 0; pat < ARRAY_SIZE(test); pat++) { \
E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \
-   value = E1000_READ_REG(&adapter->hw, R);   \
-   if (value != (test[pat] & W & M)) { 
\
+   val = E1000_READ_REG(&adapter->hw, R); \
+   if (val != (test[pat] & W & M)) {  \
DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \
"0x%08X expected 0x%08X\n",\
-   E1000_##R, value, (test[pat] & W & M));\
+   E1000_##R, val, (test[pat] & W & M));  \
*data = (adapter->hw.mac_type < e1000_82543) ? \
E1000_82542_##R : E1000_##R;   \
return 1;  \
@@ -752,12 +749,12 @@ err_setup:
 
 #define REG_SET_AND_CHECK(R, M, W) 
\
 {  
\
-   uint32_t value;\
+   uint32_t val;  \
E1000_WRITE_REG(&adapter->hw, R, W & M);   \
-   value = E1000_READ_REG(&adapter->hw, R);   \
-   if ((W & M) != (value & M)) {  \
+   val = E1000_READ_REG(&adapter->hw, R); \
+   if ((W & M) != (val & M)) {\
DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\
-   "expected 0x%08X\n", E1000_##R, (value & M), (W & M)); \
+   "expected 0x%08X\n", E1000_##R, (val & M), (W & M));   \
*data = (adapter->hw.mac_type < e1000_82543) ? \
E1000_82542_##R : E1000_##R;   \
return 1;  \
@@ -1621,8 +1618,6 @@ e1000_get_sset_count(struct net_device *netdev, int sset)
}
 }
 
-extern void e1000_power_up_phy(struct e1000_adapter *);
-
 static void
 e1000_diag_test(struct net_device *netdev,
   struct ethtool_test *eth_test, uint64_t *data)
@@ -1859,8 +1854,8 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
 {
struct e1000_adapter *adapter = netdev_priv(netdev);

[PATCH 2/4] ixgb: fix sparse warnings

2007-10-29 Thread Auke Kok
From: Stephen Hemminger <[EMAIL PROTECTED]>

Fix sparse warnings in ixgb driver for net-2.6.24.

Added a sparse fix for invalid declaration using non-constant value
in ixgb_set_multi. Added a fix for the module param array index
and allows int params in the array. --Auke

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/ixgb/ixgb.h |7 ++
 drivers/net/ixgb/ixgb_ethtool.c |7 ++
 drivers/net/ixgb/ixgb_hw.c  |4 ++--
 drivers/net/ixgb/ixgb_main.c|   11 --
 drivers/net/ixgb/ixgb_param.c   |   43 ---
 5 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 1eee889..3d2e721 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -196,4 +196,11 @@ struct ixgb_adapter {
uint32_t alloc_rx_buff_failed;
boolean_t have_msi;
 };
+
+/* Exported from other modules */
+extern void ixgb_check_options(struct ixgb_adapter *adapter);
+extern void ixgb_set_ethtool_ops(struct net_device *netdev);
+extern char ixgb_driver_name[];
+extern const char ixgb_driver_version[];
+
 #endif /* _IXGB_H_ */
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index fddd584..a267dd8 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -32,9 +32,6 @@
 
 #include 
 
-extern char ixgb_driver_name[];
-extern char ixgb_driver_version[];
-
 extern int ixgb_up(struct ixgb_adapter *adapter);
 extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog);
 extern void ixgb_reset(struct ixgb_adapter *adapter);
@@ -639,8 +636,8 @@ ixgb_phys_id(struct net_device *netdev, uint32_t data)
 {
struct ixgb_adapter *adapter = netdev_priv(netdev);
 
-   if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
-   data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
+   if (!data)
+   data = INT_MAX;
 
if(!adapter->blink_timer.function) {
init_timer(&adapter->blink_timer);
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index ecbf458..2c6367a 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -1174,7 +1174,7 @@ mac_addr_valid(uint8_t *mac_addr)
  *
  * hw - Struct containing variables accessed by shared code
  */
-boolean_t
+static boolean_t
 ixgb_link_reset(struct ixgb_hw *hw)
 {
boolean_t link_status = FALSE;
@@ -1205,7 +1205,7 @@ ixgb_link_reset(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  */
-void
+static void
 ixgb_optics_reset(struct ixgb_hw *hw)
 {
if (hw->phy_type == ixgb_phy_type_txn17401) {
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index d444de5..e564335 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -37,8 +37,8 @@ static char ixgb_driver_string[] = "Intel(R) PRO/10GbE 
Network Driver";
 #define DRIVERNAPI "-NAPI"
 #endif
 #define DRV_VERSION"1.0.126-k2"DRIVERNAPI
-char ixgb_driver_version[] = DRV_VERSION;
-static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
+const char ixgb_driver_version[] = DRV_VERSION;
+static const char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel 
Corporation.";
 
 /* ixgb_pci_tbl - PCI Device ID Table
  *
@@ -104,7 +104,6 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter 
*adapter,
 static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter);
 #endif
 static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter);
-void ixgb_set_ethtool_ops(struct net_device *netdev);
 static void ixgb_tx_timeout(struct net_device *dev);
 static void ixgb_tx_timeout_task(struct work_struct *work);
 static void ixgb_vlan_rx_register(struct net_device *netdev,
@@ -123,9 +122,6 @@ static pci_ers_result_t ixgb_io_error_detected (struct 
pci_dev *pdev,
 static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
 static void ixgb_io_resume (struct pci_dev *pdev);
 
-/* Exported from other modules */
-extern void ixgb_check_options(struct ixgb_adapter *adapter);
-
 static struct pci_error_handlers ixgb_err_handler = {
.error_detected = ixgb_io_error_detected,
.slot_reset = ixgb_io_slot_reset,
@@ -1085,7 +1081,8 @@ ixgb_set_multi(struct net_device *netdev)
rctl |= IXGB_RCTL_MPE;
IXGB_WRITE_REG(hw, RCTL, rctl);
} else {
-   uint8_t mta[netdev->mc_count * IXGB_ETH_LENGTH_OF_ADDRESS];
+   uint8_t mta[IXGB_MAX_NUM_MULTICAST_ADDRESSES *
+   IXGB_ETH_LENGTH_OF_ADDRESS];
 
IXGB_WRITE_REG(hw, RCTL, rctl);
 
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index 5d5ddab..865d14d

Re: last git: BUG: unable to handle kernel paging request at virtual address 92184900

2007-10-29 Thread Giacomo Catenazzi
Andrew Morton wrote:
> On Tue, 23 Oct 2007 21:04:20 +0200 Giacomo Catenazzi <[EMAIL PROTECTED]> 
> wrote:
> 
>> Oct 23 20:20:05 catee kernel: BUG: unable to handle kernel paging request at 
>> virtual address 92184900
> 
> Is this still happening in the latest Linus tree?
> 
> If so, please send some more oops traces so we can see if it's always 
> happening
> in the same place.

No, since few days I didn't have kernel crashes, so I think the
bug was solved.

ciao
cate
-
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: [E1000-devel] e1000 and ICH9 hardware

2007-10-29 Thread Kok, Auke
David A. Ranch wrote:
>>> e1000 is being frozen in time as "pre-PCI Express e1000's".
>>   
> Asking the question a different way, will the current e1000 driver 
> continue to get new features, performance / power / optimization tweaks, 
> etc. or is most of the primary development be moving only on the e1000e kit?

the ultimate goal is to move all the pci-express hardware support over to 
e1000e.

since the pci/pci-x generation e1000 chipsets do not have nearly the amount of
features that the pci-e silicon has, you can expect the e1000 driver to be
significantly stripped down.

We do however want to keep any feature that is supported for the pci/pci-x
hardware in e1000 active. we will not disable TSO for instance. As for other
features we will decide whatever makes best sense for the hardware. (e.g. none 
of
the 8254x chipsets support multiple queues).

All of the primary development of features will focus on e1000e.

Auke
-
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: [E1000-devel] e1000 and ICH9 hardware

2007-10-29 Thread David A. Ranch



>e1000 is being frozen in time as "pre-PCI Express e1000's".
  
Asking the question a different way, will the current e1000 driver 
continue to get new features, performance / power / optimization tweaks, 
etc. or is most of the primary development be moving only on the e1000e kit?


--David

-
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] skye/skge: sparse fix - data can't ever be bigger than LONG_MAX / HZ

2007-10-29 Thread Jeff Garzik

Stephen Hemminger wrote:

Since these all use ethtool, shouldn't the checks be put into ethtool_phys_id
rather than having the driver check?


Seems quite reasonable to me.

Jeff


-
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 v4.3] FEC - fast ethernet controller for mpc52xx

2007-10-29 Thread Grant Likely
On 10/29/07, Jeff Garzik <[EMAIL PROTECTED]> wrote:
> Domen Puncer wrote:
> >  drivers/net/Kconfig   |   24
> >  drivers/net/Makefile  |4
> >  drivers/net/fec_mpc52xx.c | 1112 
> > ++
> >  drivers/net/fec_mpc52xx.h |  313 +++
> >  drivers/net/fec_mpc52xx_phy.c |  198 +++
> >  5 files changed, 1651 insertions(+)
>
> applied to #upstream-fixes
>
> it's not strictly a fix, but I did not want to hold this back until
> 2.6.25 either

Fantastic!  Thanks Jeff.

g.


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
-
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] skye/skge: sparse fix - data can't ever be bigger than LONG_MAX / HZ

2007-10-29 Thread Stephen Hemminger
On Mon, 29 Oct 2007 06:05:14 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:

> Auke Kok wrote:
> > Trivial replacement - use INT_MAX instead here.
> > 
> > Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
> > Cc: [EMAIL PROTECTED]
> > ---
> > 
> >  drivers/net/sk98lin/skethtool.c |4 ++--
> >  drivers/net/skge.c  |8 
> >  drivers/net/sky2.c  |8 
> >  3 files changed, 10 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/sk98lin/skethtool.c 
> > b/drivers/net/sk98lin/skethtool.c
> > index 5a6da89..4549b97 100644
> > --- a/drivers/net/sk98lin/skethtool.c
> > +++ b/drivers/net/sk98lin/skethtool.c
> > @@ -430,8 +430,8 @@ static int locateDevice(struct net_device *dev, u32 
> > data)
> > DEV_NET *pNet = netdev_priv(dev);
> > SK_AC *pAC = pNet->pAC;
> >  
> > -   if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
> > -   data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
> > +   if (!data)
> > +   data = INT_MAX;
> >  
> > /* start blinking */
> > pAC->LedsOn = 0;
> > diff --git a/drivers/net/skge.c b/drivers/net/skge.c
> > index b9961dc..696a79e 100644
> > --- a/drivers/net/skge.c
> > +++ b/drivers/net/skge.c
> > @@ -783,10 +783,10 @@ static int skge_phys_id(struct net_device *dev, u32 
> > data)
> > unsigned long ms;
> > enum led_mode mode = LED_MODE_TST;
> >  
> > -   if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
> > -   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
> > -   else
> > -   ms = data * 1000;
> > +   if (!data)
> > +   data = INT_MAX;
> > +
> > +   ms = data * HZ;
> >  
> > while (ms > 0) {
> > skge_led(skge, mode);
> > diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> > index c27c7d6..1381d04 100644
> > --- a/drivers/net/sky2.c
> > +++ b/drivers/net/sky2.c
> > @@ -3336,10 +3336,10 @@ static int sky2_phys_id(struct net_device *dev, u32 
> > data)
> > int interrupted;
> > int onoff = 1;
> >  
> > -   if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))
> > -   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
> > -   else
> > -   ms = data * 1000;
> > +   if (!data)
> > +   data = INT_MAX:
> > +
> > +   ms = data * HZ;
> 
> ditto comments in previous email...

Since these all use ethtool, shouldn't the checks be put into ethtool_phys_id
rather than having the driver check?


-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
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: [2.6 patch] remove Documentation/networking/net-modules.txt

2007-10-29 Thread Pekka Pietikainen
On Wed, Oct 24, 2007 at 06:25:03PM +0200, Adrian Bunk wrote:
> According to git, the only one who touched this file during the last
> 5 years was me when removing drivers...

That's not the only obsolete thing there:
>  ncsa-telnet
>   - notes on how NCSA telnet (DOS) breaks with MTU discovery enabled.
And probably others too. Then again, the information there isn't wrong, it's
just totally useless these days :P

-- 
Pekka Pietikainen
-
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: e1000 and ICH9 hardware

2007-10-29 Thread Jeff Garzik

Daniel Drake wrote:
Are there any plans to add ICH9 support to the e1000 driver (I note 
there is a patch floating around), or is the intention that ICH9 users 
all move to e1000e?


They all should use e1000e.

Further, in 2.6.25 or so, some e1000 PCI IDs will be moved to e1000e, 
and support removed in e1000.


e1000 is being frozen in time as "pre-PCI Express e1000's".

Jeff



-
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


e1000 and ICH9 hardware

2007-10-29 Thread Daniel Drake

Hi,

Are there any plans to add ICH9 support to the e1000 driver (I note 
there is a patch floating around), or is the intention that ICH9 users 
all move to e1000e?


Just wondering which approach to take in terms of getting this hardware 
supported in Gentoo's 2.6.23 kernels.


Thanks!
Daniel
-
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: Oops in 2.6.21-rc4, 2.6.23

2007-10-29 Thread Jarek Poplawski
On Mon, Oct 29, 2007 at 01:41:47AM -0700, David Miller wrote:
> From: Jarek Poplawski <[EMAIL PROTECTED]>
> Date: Mon, 29 Oct 2007 09:42:32 +0100
> 
> > I hope you've found this by yourself by now, but:
> > 
> > 1. These are warnings only - not oopses.
> > 2. It seems this patch you've found to be responsible for this all
> > slightly changes some limits, which is not necessarily wrong; the
> > lucky thing is you can change these limits with sysctl or some
> > echos to /proc/sys/net/ipv4/tcp_mem, I presume. (Or more safely by
> > adding some memory.)
> 
> Actually, this was caused by a real bug in the SKB_WITH_OVERHEAD macro
> definition, which Herbert Xu quickly spotted and fixed.

But, since Darko has found this other patch matters for him too, maybe
there could be more than one cause to 'blame' for such differences
from 2.6.20 (maybe it's not all yet) - especially if it's all around
some limits.

> 
> Which "I hope you've found this by yourself by now".
> 

I think it's unfair! Darko got 2 weeks for thinking about this all...

Thanks,
Jarek P.
-
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] proc_fs.h redux

2007-10-29 Thread Arnaldo Carvalho de Melo
Em Sun, Oct 28, 2007 at 09:44:41AM +0100, Sam Ravnborg escreveu:
> > 
> > As a general rule, I think it better to use includes
> > than use naked forward declarations.
> 
> Quite the opposite - at least in the kernel source.
> The general rule is that a .h file shall include the
> .h files which contain declarations used by said .h files.
> But naked declarations as above is preferred over including
> a full header file.

yup
 
> We see the full header dependency thing to blow off when
> inline function are used - which is more and more the case.
> In several cases we have converted inline functions to macros
> just to simplify the nightmare of header dependencies we have.
> 
> Arnaldo have a nice script that generate a .ps file
> showing all the dependencies.
> He lately posted this URL: http://oops.ghostprotocols.net:81/acme/tcp.h.ps

Well, not "lately", it has been quite a while. But lets celebrate the
fact that there is somebody trying to fight this battle one more time
and update this tcp.h dependency tree... /me looks for hviz... and if
graphviz is installed, ok:

http://www.kernel.org/pub/linux/kernel/people/acme/hviz

hviz include/linux/tcp.h 10 | dot -Tpdf > /tmp/tcp.h.2007_11.pdf

http://oops.ghostprotocols.net:81/acme/tcp.h.2007_11.pdf

We still get to sched.h, but before it was:

linux/tcp.h -> linux/skbuff.h -> linux/mm.h -> linux/sched.h

Nowadays its:

linux/tcp.h -> linux/sock.h -> linux/netdevice.h -> linux/interrupt.h -> 
linux/sched.h

And I just removed "#include  from linux/interrupt.h,
because as far as I checked it is completely unnecessary, and the
kernel builds just fine :-)

- Arnaldo
-
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: [UDP6]: Restore sk_filter optimisation

2007-10-29 Thread Herbert Xu
On Mon, Oct 29, 2007 at 03:33:20PM +0900, Mitsuru Chinen wrote:
> Hello Herbert,
> 
> Let me ask a question about this patch.
> After this patch was applied, 2 of the protocol stack behaviors were
> changed when it receives a UDP datagram with broken checksum:
> 
>  1. udp6InDatagrams is incremented instead of udpInErrors
>  2. In userland, recvfrom() replies an error with EAGAIN.
> recvfrom() wasn't aware of such a packet before.
> 
> Are these changes intentional?

It wasn't my intention if that's what you mean :)

However, this would've happened with the old code anyway if
someone had a filter attached so this isn't new.

If it's a problem then we should just get it fixed.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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: IPVS: use proper timeout instead of fixed value

2007-10-29 Thread Andy Gospodarek
On Mon, Oct 29, 2007 at 04:05:55PM +0900, Simon Horman wrote:
> From: Andy Gospodarek <[EMAIL PROTECTED]>
> 
> Instead of using the default timeout of 3 minutes, this uses the timeout
> specific to the protocol used for the connection. The 3 minute timeout
> seems somewhat arbitrary (though I know it is used other places in the
> ipvs code) and when failing over it would be much nicer to use one of
> the configured timeout values.
> 
> Signed-off-by: Andy Gospodarek <[EMAIL PROTECTED]>
> Acked-by: Simon Horman <[EMAIL PROTECTED]>
> 

Thanks for re-visiting this, Simon!  It's too bad that the other work
never got done, but I'm glad to see this will get included.

-
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] ucc_geth: add support for netpoll

2007-10-29 Thread Anton Vorontsov
On Mon, Oct 29, 2007 at 02:12:07PM +0800, Li Yang-r58472 wrote:
[...]
> > > > +#ifdef CONFIG_NET_POLL_CONTROLLER
> > > > +/*
> > > > + * Polling 'interrupt' - used by things like netconsole to send 
> > > > +skbs
> > > > + * without having to re-enable interrupts. It's not called while
> > > > + * the interrupt routine is executing.
> > > > + */
> > > > +static void ucc_netpoll(struct net_device *dev) {
> > > > +   struct ucc_geth_private *ugeth = netdev_priv(dev);
> > > > +
> > > > +   disable_irq(ugeth->ug_info->uf_info.irq);
> > > > +   ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> > > > +   enable_irq(ugeth->ug_info->uf_info.irq);
> > > 
> > > Why not make it less complex (for a reader and gcc too :-) ?
> > 
> > Yup, I'm agree here but it's too late. Again. ;-)
> > 
> > This patch already accepted into the -mm (a week or so after 
> > the silence), so.. now I'd rather not bother Andrew with such 
> > really cosmetic changes. But if Jeff would directly apply 
> > modfied patch, I'll send it. ;-)
> 
> Oops.  The original patch happened to hit the Junk mail box. :(

That one as well? http://lkml.org/lkml/2007/10/11/128

> I think
> the patch is good to merge after the cosmetic change.  I can do it in
> next pull request to Jeff.

Ok, great. Thanks.

Here it is:

- - - -
From: Anton Vorontsov <[EMAIL PROTECTED]>
Subject: [PATCH] ucc_geth: add support for netpoll

This patch adds netpoll support for the QE UCC Gigabit Ethernet
driver. Tested using netconsole and KGDBoE.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index bec413b..94e78d8 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3678,6 +3678,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void 
*info)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   int irq = ugeth->ug_info->uf_info.irq;
+
+   disable_irq(irq);
+   ucc_geth_irq_handler(irq, dev);
+   enable_irq(irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3963,6 +3980,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
 #ifdef CONFIG_UGETH_NAPI
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
 #endif /* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   dev->poll_controller = ucc_netpoll;
+#endif
dev->stop = ucc_geth_close;
 //dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
-- 
1.5.2.2

-
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: HFSC dangerous behaviour (not a bug)

2007-10-29 Thread Denys
After thinking about that, i can say only thanks.
I like your idea, and it is better to avoid mistakes and missed traffic, then 
have a lot of complaints from users "why my shaper not working well". And 
seems i will try to switch to HFSC.

Thanks for explanation.

On Mon, 29 Oct 2007 11:55:31 +0100, Patrick McHardy wrote
> Denys wrote:
> > Hi All
> > 
> > During testing i found very strange thing. 
> > After applying even example shaper:
> > http://linux-ip.net/tc/hfsc.en/
> > -
> > [...]
> > ---
> > I had all traffic on eth0 stopped. Tried on br0 - same result. Even ARP 
> > becoming non-functional.
> > 
> > After specifying correct default class everything worked fine.
> > 
> > In HTB if you dont specify default class, traffic just pass without 
> > "shaping".
> 
> HFSC drops unclassified packets. If you don't classify ARP properly,
> things will break,
> 
> > Is it possible to keep same behaviour on both disciplines?
> > Probably just dropping all traffic not good idea, cause if user working 
on 
> > remote box by forgetting specifying default class or by mistake using 
> > incorrect class number he will loose access to the box, if same interface 
is 
> > used for tests on shaping and access.
> > In same time it is good, and can show accurate results on shaping, 
without 
> > bypassing some "forgotten" traffic.
> > But at least it must be same, IMHO, on HTB and HFSC.
> 
> This came up a couple of times already. I don't like HTB's behaviour
> since you don't notice when your classifiers are incomplete. So I'm
> against changing HFSC to behave similar. HTB OTOH can't be changed
> since users probably rely on that, not classifying ARP is a common
> mistake.
> 
> -
> 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


--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.

-
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: HFSC dangerous behaviour (not a bug)

2007-10-29 Thread Patrick McHardy

Denys wrote:
Additionally, it doesn't show rate in stats (so it is difficult to measure, 
how much is really using each class).


qdisc hfsc 1: root default 200
 Sent 1392761062 bytes 965768 pkt (dropped 52, overlimits 1620539 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0



Thats what rate estimators are for. Add something like "estimator 1 4"
to your qdisc and class creation commands to measure the rate.


-
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: HFSC dangerous behaviour (not a bug)

2007-10-29 Thread Patrick McHardy

Denys wrote:

Hi All

During testing i found very strange thing. 
After applying even example shaper:

http://linux-ip.net/tc/hfsc.en/
-
[...]
---
I had all traffic on eth0 stopped. Tried on br0 - same result. Even ARP 
becoming non-functional.


After specifying correct default class everything worked fine.

In HTB if you dont specify default class, traffic just pass without 
"shaping". 



HFSC drops unclassified packets. If you don't classify ARP properly,
things will break,


Is it possible to keep same behaviour on both disciplines?
Probably just dropping all traffic not good idea, cause if user working on 
remote box by forgetting specifying default class or by mistake using 
incorrect class number he will loose access to the box, if same interface is 
used for tests on shaping and access.
In same time it is good, and can show accurate results on shaping, without 
bypassing some "forgotten" traffic.

But at least it must be same, IMHO, on HTB and HFSC.



This came up a couple of times already. I don't like HTB's behaviour
since you don't notice when your classifiers are incomplete. So I'm
against changing HFSC to behave similar. HTB OTOH can't be changed
since users probably rely on that, not classifying ARP is a common
mistake.

-
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 2.6.24 1/1]S2io: Support for add/delete/store/restore ethernet addresses

2007-10-29 Thread Sreenivasa Honnur
Jeff,
Is this patch reviewed/applied?

-srini 

-Original Message-
From: Sreenivasa Honnur [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 19, 2007 11:23 AM
To: [EMAIL PROTECTED]; netdev@vger.kernel.org
Cc: support
Subject: [PATCH 2.6.24 1/1]S2io: Support for add/delete/store/restore
ethernet addresses

- Support to add/delete/store/restore 64 and 128 Ethernet addresses for
Xframe I and Xframe II respectively.

Signed-off-by: Sreenivasa Honnur <[EMAIL PROTECTED]>
---
diff -urpN org/drivers/net/s2io.c patch_1/drivers/net/s2io.c
--- org/drivers/net/s2io.c  2007-09-26 00:01:14.0 +0530
+++ patch_1/drivers/net/s2io.c  2007-09-26 22:42:11.0 +0530
@@ -84,7 +84,7 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
-#define DRV_VERSION "2.0.26.5"
+#define DRV_VERSION "2.0.26.6"
 
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion"; @@ -3363,6 +3363,9 @@
static void s2io_reset(struct s2io_nic *
/* Set swapper to enable I/O register access */
s2io_set_swapper(sp);
 
+   /* restore mac address entries */
+   do_s2io_restore_unicast_mc(sp);
+
/* Restore the MSIX table entries from local variables */
restore_xmsi_data(sp);
 
@@ -3421,9 +3424,6 @@ static void s2io_reset(struct s2io_nic *
writeq(val64, &bar0->pcc_err_reg);
}
 
-   /* restore the previously assigned mac address */
-   do_s2io_prog_unicast(sp->dev, (u8
*)&sp->def_mac_addr[0].mac_addr);
-
sp->device_enabled_once = FALSE;
 }
 
@@ -3896,8 +3896,17 @@ hw_init_failed:
 static int s2io_close(struct net_device *dev)  {
struct s2io_nic *sp = dev->priv;
+   struct config_param *config = &sp->config;
+   u64 tmp64;
+   int off;
 
netif_stop_queue(dev);
+   /* delete all populated mac entries */
+   for(off =1; off < config->max_mc_addr; off++) {
+   tmp64 = do_s2io_read_unicast_mc(sp,off);
+   if(tmp64 != S2IO_DISABLE_MAC_ENTRY)
+   do_s2io_delete_unicast_mc(sp, tmp64);
+   }
napi_disable(&sp->napi);
/* Reset card, kill tasklet and free Tx and Rx buffers. */
s2io_card_down(sp);
@@ -4699,8 +4708,9 @@ static void s2io_set_multicast(struct ne
struct XENA_dev_config __iomem *bar0 = sp->bar0;
u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =
0xfeffULL;
-   u64 dis_addr = 0xULL, mac_addr = 0;
+   u64 dis_addr = S2IO_DISABLE_MAC_ENTRY, mac_addr = 0;
void __iomem *add;
+   struct config_param *config = &sp->config;
 
if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {
/*  Enable all Multicast addresses */ @@ -4710,7 +4720,7
@@ static void s2io_set_multicast(struct ne
   &bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
-   RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);
+   RMAC_ADDR_CMD_MEM_OFFSET(config->max_mc_addr -
1);
writeq(val64, &bar0->rmac_addr_cmd_mem);
/* Wait till command completes */
wait_for_cmd_complete(&bar0->rmac_addr_cmd_mem,
@@ -4718,7 +4728,7 @@ static void s2io_set_multicast(struct ne
S2IO_BIT_RESET);
 
sp->m_cast_flg = 1;
-   sp->all_multi_pos = MAC_MC_ALL_MC_ADDR_OFFSET;
+   sp->all_multi_pos = config->max_mc_addr - 1;
} else if ((dev->flags & IFF_ALLMULTI) && (sp->m_cast_flg)) {
/*  Disable all Multicast addresses */
writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),
@@ -4787,7 +4797,7 @@ static void s2io_set_multicast(struct ne
/*  Update individual M_CAST address list */
if ((!sp->m_cast_flg) && dev->mc_count) {
if (dev->mc_count >
-   (MAX_ADDRS_SUPPORTED - MAC_MC_ADDR_START_OFFSET -
1)) {
+   (config->max_mc_addr - config->max_mac_addr)) {
DBG_PRINT(ERR_DBG, "%s: No more Rx filters ",
  dev->name);
DBG_PRINT(ERR_DBG, "can be added, please enable
"); @@ -4807,7 +4817,7 @@ static void s2io_set_multicast(struct ne
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
RMAC_ADDR_CMD_MEM_OFFSET
-   (MAC_MC_ADDR_START_OFFSET + i);
+   (config->mc_start_offset + i);
writeq(val64, &bar0->rmac_addr_cmd_mem);
 
/* Wait for command completes */
@@ -4839,7 +4849,7 @@ static void s2io_set_multicast(struct ne
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
RMAC_ADDR_CMD_MEM_OFFSET
-

Re: [PATCH] Fix ethernet multicast for ucc_geth.

2007-10-29 Thread Jeff Garzik

Joakim Tjernlund wrote:

From 5761a9e5924b34615c748fba2dcb977ed04c1243 Mon Sep 17 00:00:00 2001

From: Joakim Tjernlund <[EMAIL PROTECTED]>
Date: Wed, 17 Oct 2007 11:01:44 +0200
Subject: [PATCH] Fix ethernet multicast for ucc_geth.
 hw_add_addr_in_hash() already swaps byte
 order, don't do it in ucc_geth_set_multi() too.


Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   15 ++-
 1 files changed, 2 insertions(+), 13 deletions(-)


applied


-
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] Fix ethernet multicast for ucc_geth.

2007-10-29 Thread Li Yang-r58472

> > @@ -2255,19 +2253,10 @@ static void 
> ucc_geth_set_multi(struct net_device *dev)
> > if (!(dmi->dmi_addr[0] & 1))
> > continue;
> >  
> > -   /* The address in dmi_addr is LSB first,
> > -* and taddr is MSB first.  We have to
> > -* copy bytes MSB first from dmi_addr.
> > -*/
> > -   mcptr = (u8 *) dmi->dmi_addr + 5;
> > -   tdptr = (u8 *) tempaddr;
> > -   for (j = 0; j < 6; j++)
> > -   *tdptr++ = *mcptr--;
> > -
> > /* Ask CPM to run CRC and set bit in
> >  * filter mask.
> >  */
> > -   hw_add_addr_in_hash(ugeth, tempaddr);
> > +   hw_add_addr_in_hash(ugeth, 
> dmi->dmi_addr);
> 
> did the maintainer ever ACK this?

Yes, I did.  :)

- Leo
-
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] Fix ethernet multicast for ucc_geth.

2007-10-29 Thread Jeff Garzik

Joakim Tjernlund wrote:

From 5761a9e5924b34615c748fba2dcb977ed04c1243 Mon Sep 17 00:00:00 2001

From: Joakim Tjernlund <[EMAIL PROTECTED]>
Date: Wed, 17 Oct 2007 11:01:44 +0200
Subject: [PATCH] Fix ethernet multicast for ucc_geth.
 hw_add_addr_in_hash() already swaps byte
 order, don't do it in ucc_geth_set_multi() too.


Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   15 ++-
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 61f5cce..f649b1e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2214,9 +2214,7 @@ static void ucc_geth_set_multi(struct net_device *dev)
struct dev_mc_list *dmi;
struct ucc_fast *uf_regs;
struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
-   u8 tempaddr[6];
-   u8 *mcptr, *tdptr;
-   int i, j;
+   int i;
 
 	ugeth = netdev_priv(dev);
 
@@ -2255,19 +2253,10 @@ static void ucc_geth_set_multi(struct net_device *dev)

if (!(dmi->dmi_addr[0] & 1))
continue;
 
-/* The address in dmi_addr is LSB first,

-* and taddr is MSB first.  We have to
-* copy bytes MSB first from dmi_addr.
-*/
-   mcptr = (u8 *) dmi->dmi_addr + 5;
-   tdptr = (u8 *) tempaddr;
-   for (j = 0; j < 6; j++)
-   *tdptr++ = *mcptr--;
-
/* Ask CPM to run CRC and set bit in
 * filter mask.
 */
-   hw_add_addr_in_hash(ugeth, tempaddr);
+   hw_add_addr_in_hash(ugeth, dmi->dmi_addr);


did the maintainer ever ACK 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


Re: [PATCH] skye/skge: sparse fix - data can't ever be bigger than LONG_MAX / HZ

2007-10-29 Thread Jeff Garzik

Auke Kok wrote:

Trivial replacement - use INT_MAX instead here.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
---

 drivers/net/sk98lin/skethtool.c |4 ++--
 drivers/net/skge.c  |8 
 drivers/net/sky2.c  |8 
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
index 5a6da89..4549b97 100644
--- a/drivers/net/sk98lin/skethtool.c
+++ b/drivers/net/sk98lin/skethtool.c
@@ -430,8 +430,8 @@ static int locateDevice(struct net_device *dev, u32 data)
DEV_NET *pNet = netdev_priv(dev);
SK_AC *pAC = pNet->pAC;
 
-	if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))

-   data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
+   if (!data)
+   data = INT_MAX;
 
 	/* start blinking */

pAC->LedsOn = 0;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index b9961dc..696a79e 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -783,10 +783,10 @@ static int skge_phys_id(struct net_device *dev, u32 data)
unsigned long ms;
enum led_mode mode = LED_MODE_TST;
 
-	if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))

-   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
-   else
-   ms = data * 1000;
+   if (!data)
+   data = INT_MAX;
+
+   ms = data * HZ;
 
 	while (ms > 0) {

skge_led(skge, mode);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index c27c7d6..1381d04 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3336,10 +3336,10 @@ static int sky2_phys_id(struct net_device *dev, u32 
data)
int interrupted;
int onoff = 1;
 
-	if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))

-   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
-   else
-   ms = data * 1000;
+   if (!data)
+   data = INT_MAX:
+
+   ms = data * HZ;


ditto comments in previous email...

-
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] pcnet: fix sparse triviality

2007-10-29 Thread Jeff Garzik

Auke Kok wrote:

Since data can never exceed u32, it can't even be larger than LONG_MAX/HZ.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
---

 drivers/net/pcnet32.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ff92aca..3573e77 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1101,9 +1101,8 @@ static int pcnet32_phys_id(struct net_device *dev, u32 
data)
mod_timer(&lp->blink_timer, jiffies);
set_current_state(TASK_INTERRUPTIBLE);
 
-	/* AV: the limit here makes no sense whatsoever */

-   if ((!data) || (data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ)))
-   data = (u32) (MAX_SCHEDULE_TIMEOUT / HZ);
+   if (!data)
+   data = INT_MAX;
 
 	msleep_interruptible(data * 1000);

del_timer_sync(&lp->blink_timer);


Two comments:

1) I would prefer to pick a sane limit, like "1 day".  The unit of 
'data' is seconds, so IMO we should not allow stupid timeouts, much less 
INT_MAX ones :)  But hey, then again, maybe we should permit root to 
hang themselves with own rope...


2) [tangent] someone really should add the obvious ssleep_interruptible()

-
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: IPVS: use proper timeout instead of fixed value

2007-10-29 Thread David Miller
From: Simon Horman <[EMAIL PROTECTED]>
Date: Mon, 29 Oct 2007 17:59:23 +0900

> On Mon, Oct 29, 2007 at 01:35:15AM -0700, David Miller wrote:
> > From: Simon Horman <[EMAIL PROTECTED]>
> > Date: Mon, 29 Oct 2007 16:05:55 +0900 (JST)
> > 
> > > From: Andy Gospodarek <[EMAIL PROTECTED]>
> > > 
> > > Instead of using the default timeout of 3 minutes, this uses the timeout
> > > specific to the protocol used for the connection. The 3 minute timeout
> > > seems somewhat arbitrary (though I know it is used other places in the
> > > ipvs code) and when failing over it would be much nicer to use one of
> > > the configured timeout values.
> > > 
> > > Signed-off-by: Andy Gospodarek <[EMAIL PROTECTED]>
> > > Acked-by: Simon Horman <[EMAIL PROTECTED]>
> > 
> > I would apply this but it does not apply to current 2.6.x,
> > please resubmit.
> 
> I tried against net-2.6 and it seemed to work.
> Was I mistaken or should I be using a different tree?

Nope, that should be good.

Maybe I did something stupid or it got clobbered in transit somehow.

Please resend it privately to me under seperate cover and we'll sort
it out.

Thanks Simon!
-
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 v4.3] FEC - fast ethernet controller for mpc52xx

2007-10-29 Thread Jeff Garzik

Domen Puncer wrote:

On 26/10/07 07:18 -0700, Dale Farnsworth wrote:

On Fri, Oct 26, 2007 at 01:59:09PM +0200, Domen Puncer wrote:

+static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
+{
+   struct net_device *dev = dev_id;
+   struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+   spin_lock(&priv->lock);
+
+   while (bcom_buffer_done(priv->tx_dmatsk)) {
+   struct sk_buff *skb;
+   struct bcom_fec_bd *bd;
+   skb = bcom_retrieve_buffer(priv->tx_dmatsk, NULL,
+   (struct bcom_bd **)&bd);
+   /* Here (and in rx routines) would be a good place for
+* dma_unmap_single(), but bcom doesn't return bcom_bd of the
+* finished transfer, and _unmap is empty on this platfrom.
+*/

Oops, you forgot to remove the above comment.  :)


Argh!

Repost w/o the comment.
Sorry for receiving all this almost-spam.



Otherwise,
Acked-by: Dale Farnsworth <[EMAIL PROTECTED]>

Domen, thanks for all your work on this.  It's good to see it finally go in.

-Dale


--- again, use your scisors here ;-) ---


Driver for ethernet on mpc5200/mpc5200b SoCs (FEC).


Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>
Acked-by: Dale Farnsworth <[EMAIL PROTECTED]>

---
 drivers/net/Kconfig   |   24 
 drivers/net/Makefile  |4 
 drivers/net/fec_mpc52xx.c | 1112 ++

 drivers/net/fec_mpc52xx.h |  313 +++
 drivers/net/fec_mpc52xx_phy.c |  198 +++
 5 files changed, 1651 insertions(+)


applied to #upstream-fixes

it's not strictly a fix, but I did not want to hold this back until 
2.6.25 either



-
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 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry memories when vector allocation fails

2007-10-29 Thread Jeff Garzik

Sivakumar Subramani wrote:

- Fixed memory leak by freeing MSI-X local entry memories when vector allocation
fails in s2io_add_isr.
- Added two utility functions do_rem_msix_isr and do_rem_inta_isr to eliminate
code duplication.

Signed-off-by: Veena Parat <[EMAIL PROTECTED]>
Signed-off-by: Ramkrishna Vepa <[EMAIL PROTECTED]>
Signed-off-by: Santosh Rastapur <[EMAIL PROTECTED]>


Comments:

1) stats->mem_freed is redundant to general kernel debugging facilities

2) synchronize_irq() is redundant, free_irq() does same

3) "rem" isn't very clear.  few if any other kernel drivers use this to 
indicate "remove"


4) "do_" prefix is redundant

5) scripts/checkpatch.pl fails on this patch.  please clean up problems.

The main issue for this patch is #2, though presumably the other stuff 
can be cleaned on the next resubmit



-
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 00/04] pull request for 'upstream-jeff' branch

2007-10-29 Thread Jeff Garzik

Francois Romieu wrote:

Please pull from branch 'upstream-jeff' in repository

git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git 
upstream-jeff

to get the changes below.

Distance from 'master' (96fd4cd3e40e240f0c385af87f58e74da8b7099a)
-

d1417862d7355f0b395d83f2884afd614b086695
bbd82f956e0db6190b16a8a00d3ed5d979f488e8
93dd79e87bbc98ef02610d54fe72d4a1931ee15e
7fab06c0ca89d99442a4baeddf417add585e2672

Diffstat


 drivers/net/Kconfig |   13 +++--
 drivers/net/r8169.c |   12 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

Shortlog


Francois Romieu (2):
  ipg: missing Kconfig dependency
  ipg: Kconfig whitepaces/tab damages

Stephen Hemminger (2):
  r8169: napi config
  r8169: remove poll_locked logic


pulled


-
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: Please pull 'fixes-jgarzik' branch of wireless-2.6

2007-10-29 Thread Jeff Garzik

John W. Linville wrote:

Jeff,

A few fixes for 2.6.24...

Thanks,

John

---

Individual patches available here:


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-jgarzik

---

The following changes since commit c9927c2bf4f45bb85e8b502ab3fb79ad6483c244:
  Linus Torvalds (1):
Linux 2.6.24-rc1

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
fixes-jgarzik

Anton Blanchard (3):
  ipw2100/ipw2200: jiffies_round -> jiffies_round_relative
  rt2x00: jiffies_round -> jiffies_round_relative
  b43/b43legacy: jiffies_round -> jiffies_round_relative

Michael Wu (1):
  rtl8187: Allow multicast frames

Mohamed Abbas (3):
  iwl4965: fix scan problem
  iwl3945: cancel scan on rxon command
  iwl3945: fix direct scan problem

Tomas Winkler (1):
  iwlwifi: fix sending probe request in iwl 4965

mabbas (1):
  iwl4965: fix driver hang related to hardware scan

 drivers/net/wireless/b43/main.c |2 +-
 drivers/net/wireless/b43legacy/main.c   |2 +-
 drivers/net/wireless/ipw2100.c  |   11 +++--
 drivers/net/wireless/ipw2200.c  |6 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c |6 +--
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   56 +++
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   56 +++
 drivers/net/wireless/rt2x00/rt2x00lib.h |2 +-
 drivers/net/wireless/rtl8187_dev.c  |   20 +
 9 files changed, 121 insertions(+), 40 deletions(-)


pulled


-
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] ehea: add kexec support

2007-10-29 Thread Jeff Garzik

Jan-Bernd Themann wrote:

eHEA resources that are allocated via H_CALLs have a unique identifier each.
These identifiers are necessary to free the resources. A reboot notifier
is used to free all eHEA resources before the indentifiers get lost, i.e
before kexec starts a new kernel.

Signed-off-by: Jan-Bernd Themann <[EMAIL PROTECTED]>


applied to #upstream-fixes


-
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


  1   2   >