Re: [PATCH] limit rt cache size

2006-08-08 Thread David Miller
From: Andi Kleen [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 07:11:06 +0200

 The hash sizing code needs far more tweaks. iirc it can still
 allocate several GB hash tables on large memory systems (i've seen
 that once in the boot log of a 2TB system).  Even on smaller systems
 it is usually too much.

There is already a limit parameter to alloc_large_system_hash(), the
fact that the routing cache passes in zero (which causes the limit to
be 1/16 of all system memory) is just a bug. :-)

In passing this immediately this suggests a fix to alloc_large_system_hash,
in that when limit is given as 0, it should follow the same rules for
HASH_HIGHME which are applied to the scale arg.  It currently goes:

if (max == 0) {
max = ((unsigned long long)nr_all_pages  PAGE_SHIFT)  4;
do_div(max, bucketsize);
}

Whereas it should probably go:

if (max == 0) {
max = (flags  HASH_HIGHMEM) ? nr_all_pages : nr_kernel_pages;
max = (max  PAGE_SHIFT)  4;
do_div(max, bucketsize);
}

or something like that.

-
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] limit rt cache size

2006-08-08 Thread Andi Kleen

 
 Whereas it should probably go:
 
   if (max == 0) {
   max = (flags  HASH_HIGHMEM) ? nr_all_pages : nr_kernel_pages;
   max = (max  PAGE_SHIFT)  4;
   do_div(max, bucketsize);
   }
 
 or something like that.

That's still too big. Consider a 2TB machine, with all memory in LOWMEM.

Or even a smaller system. At some point it doesn't make sense
anymore to go to a larger table, even if you have the memory
and it is actually costly to have a larger table because walking
the table (netstat, route etc.) completely will take longer and longer.

It needs some additional limit. Either a maximum one or something dynamic
like CPU cache sizes (but there is currently no portable way to get that)

-Andi

-
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] limit rt cache size

2006-08-08 Thread David Miller
From: Andi Kleen [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 08:53:03 +0200

 That's still too big. Consider a 2TB machine, with all memory in LOWMEM.

Andi I agree with you, route.c should pass in a suitable limit.
I'm just suggesting a fix for a seperate problem.
-
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


remove is_setbyuser patch

2006-08-08 Thread Louis Nyffenegger

== Changelog ==

The value is_setbyuser from struct ip_options is never used and set
only one time (http://linux-net.osdl.org/index.php/TODO#IPV4).
This little patch removes it from the kernel source.

Signed-off-by: Louis Nyffenegger [EMAIL PROTECTED]

== Patch ==

--- /usr/src/linux/include/net/inet_sock.h.orig 2006-08-07
17:44:18.0 +0200
+++ /usr/src/linux/include/net/inet_sock.h  2006-08-07
17:44:49.0 +0200
@@ -28,7 +28,6 @@
/** struct ip_options - IP Options
*
* @faddr - Saved first hop address
- * @is_setbyuser - Set by setsockopt?
* @is_data - Options in __data, rather than skb
* @is_strictroute - Strict source route
* @srr_is_hit - Packet destination addr was our one
@@ -43,8 +42,7 @@ struct ip_options {
  unsigned char   srr;
  unsigned char   rr;
  unsigned char   ts;
-   unsigned char   is_setbyuser:1,
-   is_data:1,
+   unsigned char   is_data:1,
  is_strictroute:1,
  srr_is_hit:1,
  is_changed:1,



--- /usr/src/linux/net/ipv4/ip_options.c.orig   2006-08-07
17:45:12.0 +0200
+++ /usr/src/linux/net/ipv4/ip_options.c2006-08-07
17:45:23.0 +0200
@@ -507,7 +507,6 @@ static int ip_options_get_finish(struct
  opt-__data[optlen++] = IPOPT_END;
  opt-optlen = optlen;
  opt-is_data = 1;
-   opt-is_setbyuser = 1;
  if (optlen  ip_options_compile(opt, NULL)) {
  kfree(opt);
  return -EINVAL;
-
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 -rt DO NOT APPLY] Fix for tg3 networking lockup

2006-08-08 Thread Michael Chan
Theodore Tso wrote:

 Thanks, that description was very helpful.  Would you accept a patch
 with adding a comment describing this?

I will put it on my queue to add some comments for ASF.

 
 It appears that there is no way of disabling ASF; is that a true
 statement?
 

Turning off ASF is just a matter of changing some bits in NVRAM
and recalculating the checksum.  If you need the tool to do this,
I'll have someone send it to you.

Note that on some of the blade servers, I believe ASF is vital
and should not be disabled.

-
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: remove is_setbyuser patch

2006-08-08 Thread David Miller
From: Louis Nyffenegger [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 09:02:44 +0200

 == Changelog ==
 
 The value is_setbyuser from struct ip_options is never used and set
 only one time (http://linux-net.osdl.org/index.php/TODO#IPV4).
 This little patch removes it from the kernel source.
 
 Signed-off-by: Louis Nyffenegger [EMAIL PROTECTED]
 
 == Patch ==

GMAIL has corrupted your patch by changing tab characters into
spaces, among other things.

This makes your patch unusable.

Please resend the patch after configuring your email account
to not corrupt ASCII text on outgoing emails.
-
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


[take5 0/4] kevent: Generic event handling mechanism.

2006-08-08 Thread Evgeniy Polyakov

Generic event handling mechanism.

I send this patchset for comments and review, it still contains AIO and 
aio_sendfile() implementation on top of get_block() abstraction, which was
decided to postpone for a while (it is simpler right now to generate patchset 
as a whole,
when kevent will be ready for merge, I will generate patchset without AIO 
stuff).

Since number of suggested changes goes from 'several' to 'very small', I'm 
asking for 
inclusion or declining. Currently only AIO stuff requires some changes, and as 
sugested by 
Christoph Hellwig, will not supposed to be merged right now.

Should I prepare final patchset and what should it include?
Thank you.

Changes from 'take4' patchset:
 * use miscdevice instead of chardevice
 * comments fixes

Changes from 'take3' patchset:
 * removed serializing mutex from kevent_user_wait()
 * moved storage list processing to RCU
 * removed lockdep screaming - all storage locks are initialized in the same 
function, so it was learned 
to differentiate between various cases
 * remove kevent from storage if is marked as broken after callback
 * fixed a typo in mmaped buffer implementation which would end up in wrong 
index calcualtion 

Changes from 'take2' patchset:
 * split kevent_finish_user() to locked and unlocked variants
 * do not use KEVENT_STAT ifdefs, use inline functions instead
 * use array of callbacks of each type instead of each kevent callback 
initialization
 * changed name of ukevent guarding lock
 * use only one kevent lock in kevent_user for all hash buckets instead of 
per-bucket locks
 * do not use kevent_user_ctl structure instead provide needed arguments as 
syscall parameters
 * various indent cleanups
 * added optimisation, which is aimed to help when a lot of kevents are being 
copied from userspace
 * mapped buffer (initial) implementation (no userspace yet)

Changes from 'take1' patchset:
 - rebased against 2.6.18-git tree
 - removed ioctl controlling
 - added new syscall kevent_get_events(int fd, unsigned int min_nr, unsigned 
int max_nr,
unsigned int timeout, void __user *buf, unsigned flags)
 - use old syscall kevent_ctl for creation/removing, modification and initial 
kevent 
initialization
 - use mutuxes instead of semaphores
 - added file descriptor check and return error if provided descriptor does not 
match
kevent file operations
 - various indent fixes
 - removed aio_sendfile() declarations.

Thank you.

Signed-off-by: Evgeniy Polyakov [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


[take5 1/4] kevent: Core files.

2006-08-08 Thread Evgeniy Polyakov

Core files.

This patch includes core kevent files:
 - userspace controlling
 - kernelspace interfaces
 - initialization
 - notification state machines

It might also inlclude parts from other subsystem (like network related
syscalls, so it is possible that it will not compile without other
patches applied).

Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]

diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index dd63d47..0af988a 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -317,3 +317,7 @@ ENTRY(sys_call_table)
.long sys_tee   /* 315 */
.long sys_vmsplice
.long sys_move_pages
+   .long sys_aio_recv
+   .long sys_aio_send
+   .long sys_kevent_get_events
+   .long sys_kevent_ctl
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 5d4a7d1..e157ad4 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -713,4 +713,8 @@ #endif
.quad sys_tee
.quad compat_sys_vmsplice
.quad compat_sys_move_pages
+   .quad sys_aio_recv
+   .quad sys_aio_send
+   .quad sys_kevent_get_events
+   .quad sys_kevent_ctl
 ia32_syscall_end:  
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index fc1c8dd..a76e50d 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -323,10 +323,14 @@ #define __NR_sync_file_range  314
 #define __NR_tee   315
 #define __NR_vmsplice  316
 #define __NR_move_pages317
+#define __NR_aio_recv  318
+#define __NR_aio_send  319
+#define __NR_kevent_get_events 320
+#define __NR_kevent_ctl321
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 318
+#define NR_syscalls 322
 
 /*
  * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 94387c9..9a0b581 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -619,10 +619,18 @@ #define __NR_vmsplice 278
 __SYSCALL(__NR_vmsplice, sys_vmsplice)
 #define __NR_move_pages279
 __SYSCALL(__NR_move_pages, sys_move_pages)
+#define __NR_aio_recv  280
+__SYSCALL(__NR_aio_recv, sys_aio_recv)
+#define __NR_aio_send  281
+__SYSCALL(__NR_aio_send, sys_aio_send)
+#define __NR_kevent_get_events 282
+__SYSCALL(__NR_kevent_get_events, sys_kevent_get_events)
+#define __NR_kevent_ctl283
+__SYSCALL(__NR_kevent_ctl, sys_kevent_ctl)
 
 #ifdef __KERNEL__
 
-#define __NR_syscall_max __NR_move_pages
+#define __NR_syscall_max __NR_kevent_ctl
 
 #ifndef __NO_STUBS
 
diff --git a/include/linux/kevent.h b/include/linux/kevent.h
new file mode 100644
index 000..c32f3bd
--- /dev/null
+++ b/include/linux/kevent.h
@@ -0,0 +1,296 @@
+/*
+ * kevent.h
+ * 
+ * 2006 Copyright (c) Evgeniy Polyakov [EMAIL PROTECTED]
+ * All rights reserved.
+ * 
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __KEVENT_H
+#define __KEVENT_H
+
+/*
+ * Kevent request flags.
+ */
+
+#define KEVENT_REQ_ONESHOT 0x1 /* Process this event only once 
and then dequeue. */
+
+/*
+ * Kevent return flags.
+ */
+#define KEVENT_RET_BROKEN  0x1 /* Kevent is broken. */
+#define KEVENT_RET_DONE0x2 /* Kevent processing 
was finished successfully. */
+
+/*
+ * Kevent type set.
+ */
+#define KEVENT_SOCKET  0
+#define KEVENT_INODE   1
+#define KEVENT_TIMER   2
+#define KEVENT_POLL3
+#define KEVENT_NAIO4
+#define KEVENT_AIO 5
+#defineKEVENT_MAX  6
+
+/*
+ * Per-type event sets.
+ * Number of per-event sets should be exactly as number of kevent types.
+ */
+
+/*
+ * Timer events.
+ */
+#defineKEVENT_TIMER_FIRED  0x1
+
+/*
+ * Socket/network asynchronous IO events.
+ */
+#defineKEVENT_SOCKET_RECV  0x1
+#defineKEVENT_SOCKET_ACCEPT0x2
+#defineKEVENT_SOCKET_SEND  0x4
+
+/*
+ * Inode events.
+ */
+#defineKEVENT_INODE_CREATE 0x1
+#defineKEVENT_INODE_REMOVE 0x2
+
+/*
+ * Poll events.
+ */
+#defineKEVENT_POLL_POLLIN  0x0001
+#define

[take5 4/4] kevent: poll/select() notifications. Timer notifications.

2006-08-08 Thread Evgeniy Polyakov

poll/select() notifications. Timer notifications.

This patch includes generic poll/select and timer notifications.

kevent_poll works simialr to epoll and has the same issues (callback
is invoked not from internal state machine of the caller, but through
process awake).

Timer notifications can be used for fine grained per-process time 
management, since interval timers are very inconvenient to use, 
and they are limited.

Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]

diff --git a/kernel/kevent/kevent_poll.c b/kernel/kevent/kevent_poll.c
new file mode 100644
index 000..8a4f863
--- /dev/null
+++ b/kernel/kevent/kevent_poll.c
@@ -0,0 +1,220 @@
+/*
+ * kevent_poll.c
+ * 
+ * 2006 Copyright (c) Evgeniy Polyakov [EMAIL PROTECTED]
+ * All rights reserved.
+ * 
+ * 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.
+ */
+
+#include linux/kernel.h
+#include linux/types.h
+#include linux/list.h
+#include linux/slab.h
+#include linux/spinlock.h
+#include linux/timer.h
+#include linux/file.h
+#include linux/kevent.h
+#include linux/poll.h
+#include linux/fs.h
+
+static kmem_cache_t *kevent_poll_container_cache;
+static kmem_cache_t *kevent_poll_priv_cache;
+
+struct kevent_poll_ctl
+{
+   struct poll_table_structpt;
+   struct kevent   *k;
+};
+
+struct kevent_poll_wait_container
+{
+   struct list_headcontainer_entry;
+   wait_queue_head_t   *whead;
+   wait_queue_twait;
+   struct kevent   *k;
+};
+
+struct kevent_poll_private
+{
+   struct list_headcontainer_list;
+   spinlock_t  container_lock;
+};
+
+static int kevent_poll_enqueue(struct kevent *k);
+static int kevent_poll_dequeue(struct kevent *k);
+static int kevent_poll_callback(struct kevent *k);
+
+static int kevent_poll_wait_callback(wait_queue_t *wait, 
+   unsigned mode, int sync, void *key)
+{
+   struct kevent_poll_wait_container *cont = 
+   container_of(wait, struct kevent_poll_wait_container, wait);
+   struct kevent *k = cont-k;
+   struct file *file = k-st-origin;
+   u32 revents;
+
+   revents = file-f_op-poll(file, NULL);
+
+   kevent_storage_ready(k-st, NULL, revents);
+
+   return 0;
+}
+
+static void kevent_poll_qproc(struct file *file, wait_queue_head_t *whead, 
+   struct poll_table_struct *poll_table)
+{
+   struct kevent *k = 
+   container_of(poll_table, struct kevent_poll_ctl, pt)-k;
+   struct kevent_poll_private *priv = k-priv;
+   struct kevent_poll_wait_container *cont;
+   unsigned long flags;
+
+   cont = kmem_cache_alloc(kevent_poll_container_cache, SLAB_KERNEL);
+   if (!cont) {
+   kevent_break(k);
+   return;
+   }
+   
+   cont-k = k;
+   init_waitqueue_func_entry(cont-wait, kevent_poll_wait_callback);
+   cont-whead = whead;
+
+   spin_lock_irqsave(priv-container_lock, flags);
+   list_add_tail(cont-container_entry, priv-container_list);
+   spin_unlock_irqrestore(priv-container_lock, flags);
+
+   add_wait_queue(whead, cont-wait);
+}
+
+static int kevent_poll_enqueue(struct kevent *k)
+{
+   struct file *file;
+   int err, ready = 0;
+   unsigned int revents;
+   struct kevent_poll_ctl ctl;
+   struct kevent_poll_private *priv;
+
+   file = fget(k-event.id.raw[0]);
+   if (!file)
+   return -ENODEV;
+
+   err = -EINVAL;
+   if (!file-f_op || !file-f_op-poll)
+   goto err_out_fput;
+
+   err = -ENOMEM;
+   priv = kmem_cache_alloc(kevent_poll_priv_cache, SLAB_KERNEL);
+   if (!priv)
+   goto err_out_fput;
+
+   spin_lock_init(priv-container_lock);
+   INIT_LIST_HEAD(priv-container_list);
+
+   k-priv = priv;
+
+   ctl.k = k;
+   init_poll_funcptr(ctl.pt, kevent_poll_qproc);
+
+   err = kevent_storage_enqueue(file-st, k);
+   if (err)
+   goto err_out_free;
+
+   revents = file-f_op-poll(file, ctl.pt);
+   if (revents  k-event.event) {
+   ready = 1;
+   kevent_poll_dequeue(k);
+   }
+   
+   return ready;
+
+err_out_free:
+   kmem_cache_free(kevent_poll_priv_cache, priv);
+err_out_fput:
+   fput(file);
+   return err;
+}
+
+static int kevent_poll_dequeue(struct kevent *k)
+{
+   struct file *file = k-st-origin;
+   struct kevent_poll_private *priv = k-priv;
+

[take5 3/4] kevent: Network AIO, socket notifications.

2006-08-08 Thread Evgeniy Polyakov

Network AIO, socket notifications.

This patchset includes socket notifications and network asynchronous IO.
Network AIO is based on kevent and works as usual kevent storage on top
of inode.

Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]

diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h
index 5755d57..9300678 100644
--- a/include/asm-i386/socket.h
+++ b/include/asm-i386/socket.h
@@ -50,4 +50,6 @@ #define SO_ACCEPTCONN 30
 #define SO_PEERSEC 31
 #define SO_PASSSEC 34
 
+#define SO_ASYNC_SOCK  35
+
 #endif /* _ASM_SOCKET_H */
diff --git a/include/asm-x86_64/socket.h b/include/asm-x86_64/socket.h
index b467026..fc2b49d 100644
--- a/include/asm-x86_64/socket.h
+++ b/include/asm-x86_64/socket.h
@@ -50,4 +50,6 @@ #define SO_ACCEPTCONN 30
 #define SO_PEERSEC 31
 #define SO_PASSSEC 34
 
+#define SO_ASYNC_SOCK  35
+
 #endif /* _ASM_SOCKET_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4307e76..9267873 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1283,6 +1283,8 @@ extern struct sk_buff *skb_recv_datagram
 int noblock, int *err);
 extern unsigned intdatagram_poll(struct file *file, struct socket *sock,
 struct poll_table_struct *wait);
+extern intskb_copy_datagram(const struct sk_buff *from, 
+int offset, void *dst, int size);
 extern intskb_copy_datagram_iovec(const struct sk_buff *from,
   int offset, struct iovec *to,
   int size);
diff --git a/include/net/sock.h b/include/net/sock.h
index 324b3ea..c43a153 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -48,6 +48,7 @@ #include linux/lockdep.h
 #include linux/netdevice.h
 #include linux/skbuff.h  /* struct sk_buff */
 #include linux/security.h
+#include linux/kevent.h
 
 #include linux/filter.h
 
@@ -391,6 +392,8 @@ enum sock_flags {
SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */
SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */
SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */
+   SOCK_ASYNC,
+   SOCK_ASYNC_INUSE,
 };
 
 static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -450,6 +453,21 @@ static inline int sk_stream_memory_free(
 
 extern void sk_stream_rfree(struct sk_buff *skb);
 
+struct socket_alloc {
+   struct socket socket;
+   struct inode vfs_inode;
+};
+
+static inline struct socket *SOCKET_I(struct inode *inode)
+{
+   return container_of(inode, struct socket_alloc, vfs_inode)-socket;
+}
+
+static inline struct inode *SOCK_INODE(struct socket *socket)
+{
+   return container_of(socket, struct socket_alloc, socket)-vfs_inode;
+}
+
 static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
 {
skb-sk = sk;
@@ -477,6 +495,7 @@ static inline void sk_add_backlog(struct
sk-sk_backlog.tail = skb;
}
skb-next = NULL;
+   kevent_socket_notify(sk, KEVENT_SOCKET_RECV);
 }
 
 #define sk_wait_event(__sk, __timeo, __condition)  \
@@ -548,6 +567,12 @@ struct proto {
 
int (*backlog_rcv) (struct sock *sk, 
struct sk_buff *skb);
+   
+   int (*async_recv) (struct sock *sk, 
+   void *dst, size_t size);
+   int (*async_send) (struct sock *sk, 
+   struct page **pages, unsigned 
int poffset, 
+   size_t size);
 
/* Keeping track of sk's, looking them up, and port selection methods. 
*/
void(*hash)(struct sock *sk);
@@ -679,21 +704,6 @@ static inline struct kiocb *siocb_to_kio
return si-kiocb;
 }
 
-struct socket_alloc {
-   struct socket socket;
-   struct inode vfs_inode;
-};
-
-static inline struct socket *SOCKET_I(struct inode *inode)
-{
-   return container_of(inode, struct socket_alloc, vfs_inode)-socket;
-}
-
-static inline struct inode *SOCK_INODE(struct socket *socket)
-{
-   return container_of(socket, struct socket_alloc, socket)-vfs_inode;
-}
-
 extern void __sk_stream_mem_reclaim(struct sock *sk);
 extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind);
 
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0720bdd..5a1899b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -364,6 +364,8 @@ extern int  compat_tcp_setsockopt(struc
int level, int optname,
char __user *optval, int optlen);
 extern voidtcp_set_keepalive(struct sock *sk, int val);

remove is_setbyuser patch

2006-08-08 Thread louis . nyffenegger
The same without gmail problems

== Changelog ==

The value is_setbyuser from struct ip_options is never used and set
only one time (http://linux-net.osdl.org/index.php/TODO#IPV4).
This little patch removes it from the kernel source.

Signed-off-by: Louis Nyffenegger [EMAIL PROTECTED]

== Patch ==


--- /usr/src/linux/include/net/inet_sock.h.orig 2006-08-07 17:44:18.0 
+0200
+++ /usr/src/linux/include/net/inet_sock.h  2006-08-07 17:44:49.0 
+0200
@@ -28,7 +28,6 @@
 /** struct ip_options - IP Options
  *
  * @faddr - Saved first hop address
- * @is_setbyuser - Set by setsockopt?
  * @is_data - Options in __data, rather than skb
  * @is_strictroute - Strict source route
  * @srr_is_hit - Packet destination addr was our one
@@ -43,8 +42,7 @@ struct ip_options {
unsigned char   srr;
unsigned char   rr;
unsigned char   ts;
-   unsigned char   is_setbyuser:1,
-   is_data:1,
+   unsigned char   is_data:1,
is_strictroute:1,
srr_is_hit:1,
is_changed:1,



--- /usr/src/linux/net/ipv4/ip_options.c.orig   2006-08-07 17:45:12.0 
+0200
+++ /usr/src/linux/net/ipv4/ip_options.c2006-08-07 17:45:23.0 
+0200
@@ -507,7 +507,6 @@ static int ip_options_get_finish(struct 
opt-__data[optlen++] = IPOPT_END;
opt-optlen = optlen;
opt-is_data = 1;
-   opt-is_setbyuser = 1;
if (optlen  ip_options_compile(opt, NULL)) {
kfree(opt);
return -EINVAL;
-
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


[take5 2/4] kevent: AIO, aio_sendfile() implementation.

2006-08-08 Thread Evgeniy Polyakov

AIO, aio_sendfile() implementation.

This patch includes asynchronous propagation of file's data into VFS
cache and aio_sendfile() implementation.
Network aio_sendfile() works lazily - it asynchronously populates pages
into the VFS cache (which can be used for various tricks with adaptive
readahead) and then uses usual -sendfile() callback.

This patch contains AIO and aio_sendfile() implementation on top of get_block() 
abstraction, which was decided to postpone for a while.

More info can be found in the following thread at linux-kernel@ or netdev@:
http://thread.gmane.org/gmane.linux.kernel/425005

Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]

diff --git a/fs/bio.c b/fs/bio.c
index 6a0b9ad..a3ee530 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -119,7 +119,7 @@ void bio_free(struct bio *bio, struct bi
 /*
  * default destructor for a bio allocated with bio_alloc_bioset()
  */
-static void bio_fs_destructor(struct bio *bio)
+void bio_fs_destructor(struct bio *bio)
 {
bio_free(bio, fs_bio_set);
 }
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index fb4d322..9316551 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -685,6 +685,7 @@ ext2_writepages(struct address_space *ma
 }
 
 const struct address_space_operations ext2_aops = {
+   .get_block  = ext2_get_block,
.readpage   = ext2_readpage,
.readpages  = ext2_readpages,
.writepage  = ext2_writepage,
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index c5ee9f0..d9210d4 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1699,6 +1699,7 @@ static int ext3_journalled_set_page_dirt
 }
 
 static const struct address_space_operations ext3_ordered_aops = {
+   .get_block  = ext3_get_block,
.readpage   = ext3_readpage,
.readpages  = ext3_readpages,
.writepage  = ext3_ordered_writepage,
diff --git a/fs/file_table.c b/fs/file_table.c
index 0131ba0..7f5b35f 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -112,6 +112,10 @@ struct file *get_empty_filp(void)
if (security_file_alloc(f))
goto fail_sec;
 
+#ifdef CONFIG_KEVENT_POLL
+   kevent_storage_init(f, f-st);
+   kevent_poll_reinit(f);
+#endif
tsk = current;
INIT_LIST_HEAD(f-f_u.fu_list);
atomic_set(f-f_count, 1);
@@ -159,6 +163,9 @@ void fastcall __fput(struct file *file)
might_sleep();
 
fsnotify_close(file);
+#ifdef CONFIG_KEVENT_POLL
+   kevent_storage_fini(file-st);
+#endif
/*
 * The function eventpoll_release() should be the first called
 * in the file cleanup chain.
diff --git a/fs/inode.c b/fs/inode.c
index 0bf9f04..fdbd0ba 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -21,6 +21,7 @@ #include linux/pagemap.h
 #include linux/cdev.h
 #include linux/bootmem.h
 #include linux/inotify.h
+#include linux/kevent.h
 #include linux/mount.h
 
 /*
@@ -165,12 +166,18 @@ #endif
}
memset(inode-u, 0, sizeof(inode-u));
inode-i_mapping = mapping;
+#if defined CONFIG_KEVENT
+   kevent_storage_init(inode, inode-st);
+#endif
}
return inode;
 }
 
 void destroy_inode(struct inode *inode) 
 {
+#if defined CONFIG_KEVENT_INODE || defined CONFIG_KEVENT_SOCKET
+   kevent_storage_fini(inode-st);
+#endif
BUG_ON(inode_has_buffers(inode));
security_inode_free(inode);
if (inode-i_sb-s_op-destroy_inode)
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 12dfdcf..f8dca72 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -3001,6 +3001,7 @@ int reiserfs_setattr(struct dentry *dent
 }
 
 const struct address_space_operations reiserfs_address_space_operations = {
+   .get_block = reiserfs_get_block,
.writepage = reiserfs_writepage,
.readpage = reiserfs_readpage,
.readpages = reiserfs_readpages,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2561020..65eb438 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -240,6 +240,9 @@ #include linux/mutex.h
 #include asm/atomic.h
 #include asm/semaphore.h
 #include asm/byteorder.h
+#ifdef CONFIG_KEVENT
+#include linux/kevent_storage.h
+#endif
 
 struct hd_geometry;
 struct iovec;
@@ -352,6 +355,8 @@ struct address_space;
 struct writeback_control;
 
 struct address_space_operations {
+   int  (*get_block)(struct inode *inode, sector_t iblock,
+   struct buffer_head *bh_result, int create);
int (*writepage)(struct page *page, struct writeback_control *wbc);
int (*readpage)(struct file *, struct page *);
void (*sync_page)(struct page *);
@@ -546,6 +551,10 @@ #ifdef CONFIG_INOTIFY
struct mutexinotify_mutex;  /* protects the watches list */
 #endif
 
+#ifdef CONFIG_KEVENT_INODE
+   struct kevent_storage   st;
+#endif
+
unsigned long   i_state;
unsigned long   dirtied_when;   /* jiffies of first dirtying 

Re: 2.6.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Andrew Morton
On Mon, 07 Aug 2006 11:45:28 -0700
Jeremy Fitzhardinge [EMAIL PROTECTED] wrote:

 With 2.6.18-rc3-mm2, I get a bogus device name for my e1000 device, 
 which I would expect to be eth0:
 
 : ezr:pts/0; ifconfig -a
 �6f�  Link encap:Ethernet  HWaddr 00:16:D3:20:D2:0B  
   UP BROADCAST MULTICAST  MTU:1500  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000 
   RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
   Base address:0x2000 Memory:ee00-ee02 
 [...]

e1000 seems OK here.  Don't know, sorry.
-
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.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Jeremy Fitzhardinge

Andrew Morton wrote:

e1000 seems OK here.  Don't know, sorry.
  


It's happening to all my ethernet-like devices: the Atheros wireless 
comes up as a mess too.  It's different each time, so it looks like 
random uninitialized crud.


I did a clean rebuild, but it still happens.  I guess I'll have to try 
with some slab debugging and see if its an overrun or something.


   J
-
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] limit rt cache size

2006-08-08 Thread Kirill Korotaev

David Miller wrote:

we quickly discover this GIT commit:

424c4b70cc4ff3930ee36a2ef7b204e4d704fd26

[IPV4]: Use the fancy alloc_large_system_hash() function for route hash table

- rt hash table allocated using alloc_large_system_hash() function.

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

And it is clear that old code used num_physpages, which counts low
memory only.  This shows clearly that Eric's usage of the HASH_HIGHMEM
flag here is erroneous.  So we should remove it.

at least for i686 num_physpages includes highmem, so IMHO this bug was there 
for years:

./arch/i386/mm/init.c:
static void __init set_max_mapnr_init(void)
{
#ifdef CONFIG_HIGHMEM
   num_physpages = highend_pfn;
#else
   num_physpages = max_low_pfn;
#endif
}


Look!  This thing even uses num_physpages in current code to compute
the scale argument to alloc_large_system_hash() :)))

the same bug here? :) the good thing is that it only select scale 15 or 17.
no any other possible choice here :)))


What's about routing cache size, it looks like it is another bug.
route.c should not force rt_max_size = 16*rt_hash_size.
I think it should consult available memory and to limit rt_max_size
to some reasonable value, even if hash size is too high.



Sure.  This current setting of 16*rt_hash_size is meant to
try to limit hash chain lengths I guess.  2.4.x does the same
thing.  Note also that by basing it upon number of routing cache
hash chains, it is effectively consulting available memory.
This is why when hash table sizing is crap so it rt_max_size
calculation.  Fix one and you fix them both :)

imho chain lengh limitation to 16 is not that bad, but to avoid such features
probably should be fixed :)


Once the HASH_HIGHMEM flag is removed, assuming system has  128K of
memory, what we get is:

hash_chains = lowmem / 128K
rt_max_size = ((lowmem / 128K) * 16) == lowmem / 8K

So we allow one routing cache entry for each 8K of lowmem we have :)

So for now it is probably sufficient to just get rid of the
HASH_HIGHMEM flag here.  Later we can try changing this multiplier
of 16 to something like 8 or even 4.

should we remove it for TCP hashes?

Thanks,
Kirill
-
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] limit rt cache size

2006-08-08 Thread David Miller
From: Kirill Korotaev [EMAIL PROTECTED]
Date: Tue, 08 Aug 2006 12:17:57 +0400

 at least for i686 num_physpages includes highmem, so IMHO this bug
 was there for years:

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


[2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*

2006-08-08 Thread Herbert Xu
Hi:

[IPV4]: Use network-order dport for all visible inet_lookup_*

Right now most inet_lookup_* functions take a host-order hnum instead
of a network-order dport because that's how it is represented internally.

This means that users of these functions have to be careful about using
the right byte-order.  To add more confusion, inet_lookup takes a
network-order dport unlike all other functions.

So this patch changes all visible inet_lookup functions to take a dport
and move all dport-hnum conversion inside them.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -274,7 +274,7 @@ static inline int inet_iif(const struct 
 extern struct sock *
inet_lookup_listener(struct inet_hashinfo *hashinfo,
 const u32 daddr,
-const unsigned short hnum, const int dif);
+const u16 dport, const int dif);
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
@@ -328,10 +328,11 @@ extern struct sock *
 static inline struct sock *
__inet_lookup_established(struct inet_hashinfo *hashinfo,
  const u32 saddr, const u16 sport,
- const u32 daddr, const u16 hnum,
+ const u32 daddr, const u16 dport,
  const int dif)
 {
INET_ADDR_COOKIE(acookie, saddr, daddr)
+   u16 hnum = ntohs(dport);
const __u32 ports = INET_COMBINED_PORTS(sport, hnum);
struct sock *sk;
const struct hlist_node *node;
@@ -364,12 +365,12 @@ hit:
 
 static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
 const u32 saddr, const u16 sport,
-const u32 daddr, const u16 hnum,
+const u32 daddr, const u16 dport,
 const int dif)
 {
struct sock *sk = __inet_lookup_established(hashinfo, saddr, sport, 
daddr,
-   hnum, dif);
-   return sk ? : inet_lookup_listener(hashinfo, daddr, hnum, dif);
+   dport, dif);
+   return sk ? : inet_lookup_listener(hashinfo, daddr, dport, dif);
 }
 
 static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo,
@@ -380,7 +381,7 @@ static inline struct sock *inet_lookup(s
struct sock *sk;
 
local_bh_disable();
-   sk = __inet_lookup(hashinfo, saddr, sport, daddr, ntohs(dport), dif);
+   sk = __inet_lookup(hashinfo, saddr, sport, daddr, dport, dif);
local_bh_enable();
 
return sk;
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -607,7 +607,7 @@ static struct sock *dccp_v4_hnd_req(stru
 
nsk = __inet_lookup_established(dccp_hashinfo,
iph-saddr, dh-dccph_sport,
-   iph-daddr, ntohs(dh-dccph_dport),
+   iph-daddr, dh-dccph_dport,
inet_iif(skb));
if (nsk != NULL) {
if (nsk-sk_state != DCCP_TIME_WAIT) {
@@ -921,7 +921,7 @@ static int dccp_v4_rcv(struct sk_buff *s
 *  Look up flow ID in table and get corresponding socket */
sk = __inet_lookup(dccp_hashinfo,
   skb-nh.iph-saddr, dh-dccph_sport,
-  skb-nh.iph-daddr, ntohs(dh-dccph_dport),
+  skb-nh.iph-daddr, dh-dccph_dport,
   inet_iif(skb));
 
/* 
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -163,11 +163,12 @@ static struct sock *__inet_lookup_listen
 
 /* Optimize the common listener case. */
 struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
- const u32 daddr, const unsigned short hnum,
+ const u32 daddr, const u16 dport,
  const int dif)
 {
struct sock *sk = NULL;
const struct hlist_head *head;
+   u16 hnum = ntohs(dport);
 
read_lock(hashinfo-lhash_lock);
head = hashinfo-listening_hash[inet_lhashfn(hnum)];
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -950,7 +950,7 @@ static struct sock *tcp_v4_hnd_req(struc
 
nsk = __inet_lookup_established(tcp_hashinfo, skb-nh.iph-saddr,

[1/2] [IPV4]: Uninline inet_lookup_listener

2006-08-08 Thread Herbert Xu
Hi:

[IPV4]: Uninline inet_lookup_listener

By modern standards this function is way too big to be inlined.  It's
even bigger than __inet_lookup_listener :)

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -271,39 +271,10 @@ static inline int inet_iif(const struct 
return ((struct rtable *)skb-dst)-rt_iif;
 }
 
-extern struct sock *__inet_lookup_listener(const struct hlist_head *head,
-  const u32 daddr,
-  const unsigned short hnum,
-  const int dif);
-
-/* Optimize the common listener case. */
-static inline struct sock *
+extern struct sock *
inet_lookup_listener(struct inet_hashinfo *hashinfo,
 const u32 daddr,
-const unsigned short hnum, const int dif)
-{
-   struct sock *sk = NULL;
-   const struct hlist_head *head;
-
-   read_lock(hashinfo-lhash_lock);
-   head = hashinfo-listening_hash[inet_lhashfn(hnum)];
-   if (!hlist_empty(head)) {
-   const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
-
-   if (inet-num == hnum  !sk-sk_node.next 
-   (!inet-rcv_saddr || inet-rcv_saddr == daddr) 
-   (sk-sk_family == PF_INET || !ipv6_only_sock(sk)) 
-   !sk-sk_bound_dev_if)
-   goto sherry_cache;
-   sk = __inet_lookup_listener(head, daddr, hnum, dif);
-   }
-   if (sk) {
-sherry_cache:
-   sock_hold(sk);
-   }
-   read_unlock(hashinfo-lhash_lock);
-   return sk;
-}
+const unsigned short hnum, const int dif);
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -124,8 +124,10 @@ EXPORT_SYMBOL(inet_listen_wlock);
  * remote address for the connection. So always assume those are both
  * wildcarded during the search since they can never be otherwise.
  */
-struct sock *__inet_lookup_listener(const struct hlist_head *head, const u32 
daddr,
-   const unsigned short hnum, const int dif)
+static struct sock *__inet_lookup_listener(const struct hlist_head *head,
+  const u32 daddr,
+  const unsigned short hnum,
+  const int dif)
 {
struct sock *result = NULL, *sk;
const struct hlist_node *node;
@@ -159,7 +161,34 @@ struct sock *__inet_lookup_listener(cons
return result;
 }
 
-EXPORT_SYMBOL_GPL(__inet_lookup_listener);
+/* Optimize the common listener case. */
+struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
+ const u32 daddr, const unsigned short hnum,
+ const int dif)
+{
+   struct sock *sk = NULL;
+   const struct hlist_head *head;
+
+   read_lock(hashinfo-lhash_lock);
+   head = hashinfo-listening_hash[inet_lhashfn(hnum)];
+   if (!hlist_empty(head)) {
+   const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
+
+   if (inet-num == hnum  !sk-sk_node.next 
+   (!inet-rcv_saddr || inet-rcv_saddr == daddr) 
+   (sk-sk_family == PF_INET || !ipv6_only_sock(sk)) 
+   !sk-sk_bound_dev_if)
+   goto sherry_cache;
+   sk = __inet_lookup_listener(head, daddr, hnum, dif);
+   }
+   if (sk) {
+sherry_cache:
+   sock_hold(sk);
+   }
+   read_unlock(hashinfo-lhash_lock);
+   return sk;
+}
+EXPORT_SYMBOL_GPL(inet_lookup_listener);
 
 /* called with local bh disabled */
 static int __inet_check_established(struct inet_timewait_death_row *death_row,
-
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] limit rt cache size

2006-08-08 Thread Eric Dumazet
On Tuesday 08 August 2006 05:42, David Miller wrote:
 From: Alexey Kuznetsov [EMAIL PROTECTED]
 Date: Mon, 7 Aug 2006 20:48:42 +0400

  The patch looks OK. But I am not sure too.
 
  To be honest, I do not understand the sense of HASH_HIGHMEM flag.
  At the first sight, hash table eats low memory, objects hashed in this
  table also eat low memory. Why is its size calculated from total memory?
  But taking into account that this flag is used only by tcp.c and route.c,
  both of which feed on low memory, I miss something important.
 
  Let's ask people on netdev.

 Is it not so hard to check history of the change to see where these
 things come from?  :-) If we study the output of command:

   git whatchanged net/core/route.c

 we quickly discover this GIT commit:

 424c4b70cc4ff3930ee36a2ef7b204e4d704fd26

 [IPV4]: Use the fancy alloc_large_system_hash() function for route hash
 table

 - rt hash table allocated using alloc_large_system_hash() function.

 Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
 Signed-off-by: David S. Miller [EMAIL PROTECTED]

 And it is clear that old code used num_physpages, which counts low
 memory only.  This shows clearly that Eric's usage of the HASH_HIGHMEM
 flag here is erroneous.  So we should remove it.

Yes probably.

If I recall well, I blindly copied code from net/ipv4/tcp.c (tcp ehash table 
allocation). I was not aware of this HASH_HIGHMEM part.

As the allocation of routes are SLAB_ATOMIC, while TCP sockets are allocated 
SLAB_KERNEL , it makes sense to size the route hash table accordingly to 
nr_kernel_pages instead of nr_all_pages

For TCP, an OOM is OK since sock_alloc_inode() should returns NULL and this 
should be handled fine.

I think we had discussion about being able to dynamically resize route hash 
table (or tcp hash table), using RCU. Did someone worked on this ?
For most current machines (ram size = 1GB) , the default hash table sizes are 
just insane for 99% of uses.



 Look!  This thing even uses num_physpages in current code to compute
 the scale argument to alloc_large_system_hash() :)))

  What's about routing cache size, it looks like it is another bug.
  route.c should not force rt_max_size = 16*rt_hash_size.
  I think it should consult available memory and to limit rt_max_size
  to some reasonable value, even if hash size is too high.

 Sure.  This current setting of 16*rt_hash_size is meant to
 try to limit hash chain lengths I guess.  2.4.x does the same
 thing.  Note also that by basing it upon number of routing cache
 hash chains, it is effectively consulting available memory.
 This is why when hash table sizing is crap so it rt_max_size
 calculation.  Fix one and you fix them both :)

 Once the HASH_HIGHMEM flag is removed, assuming system has  128K of
 memory, what we get is:

   hash_chains = lowmem / 128K
   rt_max_size = ((lowmem / 128K) * 16) == lowmem / 8K

 So we allow one routing cache entry for each 8K of lowmem we have :)

 So for now it is probably sufficient to just get rid of the
 HASH_HIGHMEM flag here.  Later we can try changing this multiplier
 of 16 to something like 8 or even 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] limit rt cache size

2006-08-08 Thread David Miller
From: Eric Dumazet [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 10:57:31 +0200

 I think we had discussion about being able to dynamically resize
 route hash table (or tcp hash table), using RCU. Did someone worked
 on this ?  For most current machines (ram size = 1GB) , the default
 hash table sizes are just insane for 99% of uses.

Specifically we were talking about TCP recently, but yes the
same rings true for the routing cache as well.
-
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: [1/2] [IPV4]: Uninline inet_lookup_listener

2006-08-08 Thread David Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 18:46:14 +1000

 [IPV4]: Uninline inet_lookup_listener
 
 By modern standards this function is way too big to be inlined.  It's
 even bigger than __inet_lookup_listener :)
 
 Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Applied, 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: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*

2006-08-08 Thread David Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 18:47:29 +1000

 So this patch changes all visible inet_lookup functions to take a
 dport and move all dport-hnum conversion inside them.

This isn't so nice because we will now byte-swap the port twice when
we try looking up a listening socket.  Once for the established lookup
and once for the listening hash lookup.

It should be easy to do the byte-swap once at a higher level right?
-
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


airo: inconsistent {hardirq-on-W} - {in-hardirq-W} usage.

2006-08-08 Thread Pekka Pietikainen
Only aironet lockdep related report I could find was 
http://marc.theaimsgroup.com/?l=linux-netdevm=115406279721287w=2

this looks a bit different:

Linux version 2.6.17-1.2528.fc6 ([EMAIL PROTECTED]) (gcc version 4.1.1 20060802 
(Red Hat 4.1.1-14)) #1 SMP Sun Aug 6 01:43:42 EDT 2006

=
[ INFO: inconsistent lock state ]
-
inconsistent {hardirq-on-W} - {in-hardirq-W} usage.
swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (list-lock){++..}, at: [c05b2ed9] skb_queue_tail+0x14/0x32
{hardirq-on-W} state was registered at:
  [c043bfb9] lock_acquire+0x4b/0x6a
  [c060f428] _spin_lock_bh+0x1e/0x2d
  [c05ed45e] udp_poll+0x49/0xce
  [c05ae678] sock_poll+0x12/0x15
  [c04838da] do_sys_poll+0x1f7/0x3c3
  [c0483ada] sys_poll+0x34/0x36
  [c0403faf] syscall_call+0x7/0xb
irq event stamp: 516288
hardirqs last  enabled at (516287): [c0403ff7] restore_nocheck+0x12/0x15
hardirqs last disabled at (516288): [c0404a3f] common_interrupt+0x1b/0x2c
softirqs last  enabled at (516272): [c042941f] __do_softirq+0xec/0xf2
softirqs last disabled at (516261): [c0406673] do_softirq+0x5a/0xbe

other info that might help us debug this:
no locks held by swapper/0.

stack backtrace:
 [c04051ee] show_trace_log_lvl+0x58/0x159
 [c04057ea] show_trace+0xd/0x10
 [c0405903] dump_stack+0x19/0x1b
 [c043a402] print_usage_bug+0x1ca/0x1d7
 [c043a748] mark_lock+0x96/0x353
 [c043b463] __lock_acquire+0x3b2/0x997
 [c043bfb9] lock_acquire+0x4b/0x6a
 [c060f727] _spin_lock_irqsave+0x22/0x32
 [c05b2ed9] skb_queue_tail+0x14/0x32
 [c05ca889] netlink_broadcast+0x1bf/0x28e
 [c05c234e] wireless_send_event+0x28b/0x29d
 [f099a098] airo_send_event+0x6c/0x76 [airo]
 [f099de2d] airo_interrupt+0x210/0xff7 [airo]
 [c0450dd8] handle_IRQ_event+0x20/0x4d
 [c0450e99] __do_IRQ+0x94/0xef
 [c0406790] do_IRQ+0xb9/0xcd
 [c0404a49] common_interrupt+0x25/0x2c
DWARF2 unwinder stuck at common_interrupt+0x25/0x2c
Leftover inexact backtrace:
 [c04057ea] show_trace+0xd/0x10
 [c0405903] dump_stack+0x19/0x1b
 [c043a402] print_usage_bug+0x1ca/0x1d7
 [c043a748] mark_lock+0x96/0x353
 [c043b463] __lock_acquire+0x3b2/0x997
 [c043bfb9] lock_acquire+0x4b/0x6a
 [c060f727] _spin_lock_irqsave+0x22/0x32
 [c05b2ed9] skb_queue_tail+0x14/0x32
 [c05ca889] netlink_broadcast+0x1bf/0x28e
 [c05c234e] wireless_send_event+0x28b/0x29d
 [f099a098] airo_send_event+0x6c/0x76 [airo]
 [f099de2d] airo_interrupt+0x210/0xff7 [airo]
 [c0450dd8] handle_IRQ_event+0x20/0x4d
 [c0450e99] __do_IRQ+0x94/0xef
 [c0406790] do_IRQ+0xb9/0xcd
 [c0404a49] common_interrupt+0x25/0x2c
 [c0402cd9] cpu_idle+0xa7/0xc1
 [c04005f5] rest_init+0x23/0x26
 [c07aa81a] start_kernel+0x3ab/0x3b3
 [c0400210] 0xc0400210
-
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: [take5 3/4] kevent: Network AIO, socket notifications.

2006-08-08 Thread Eric Dumazet
On Tuesday 08 August 2006 09:44, Evgeniy Polyakov wrote:
 Network AIO, socket notifications.

 This patchset includes socket notifications and network asynchronous IO.
 Network AIO is based on kevent and works as usual kevent storage on top
 of inode.

diff --git a/include/net/sock.h b/include/net/sock.h
index 324b3ea..c43a153 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h

Why are you moving around SOCKET_I() and SOCK_INODE() ?

diff --git a/kernel/kevent/kevent_naio.c b/kernel/kevent/kevent_naio.c
new file mode 100644
index 000..98c357f
--- /dev/null
+++ b/kernel/kevent/kevent_naio.c

 + if (!file-f_dentry || !file-f_dentry-d_inode)
 + goto err_out_fput;
 + if (file-f_op != socket_file_ops)
 + goto err_out_fput;
 +
 + sk = SOCKET_I(file-f_dentry-d_inode)-sk;
 +


You dont need to acess the dentry to get the socket from the file pointer.

(cf net/socket.c , function sock_from_file())

if (file-f_op != socket_file_ops)
goto err_out_fput;
sk = file-private_data;

(I repeat myself on this point, because I have a patch here so that only one 
common dentry is allocated for all the sockets to reduce ram usage on big 
servers : Everything but /proc/pid/fd is fine)

Eric


-
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: [take5 3/4] kevent: Network AIO, socket notifications.

2006-08-08 Thread Evgeniy Polyakov
On Tue, Aug 08, 2006 at 11:52:53AM +0200, Eric Dumazet ([EMAIL PROTECTED]) 
wrote:
 On Tuesday 08 August 2006 09:44, Evgeniy Polyakov wrote:
  Network AIO, socket notifications.
 
  This patchset includes socket notifications and network asynchronous IO.
  Network AIO is based on kevent and works as usual kevent storage on top
  of inode.
 
 diff --git a/include/net/sock.h b/include/net/sock.h
 index 324b3ea..c43a153 100644
 --- a/include/net/sock.h
 +++ b/include/net/sock.h
 
 Why are you moving around SOCKET_I() and SOCK_INODE() ?

I used kevent notification above, which requires socket-inode
transformation (to save some space inside struct sock/socket I use inode
as storage both for socket and inode notifications)

 diff --git a/kernel/kevent/kevent_naio.c b/kernel/kevent/kevent_naio.c
 new file mode 100644
 index 000..98c357f
 --- /dev/null
 +++ b/kernel/kevent/kevent_naio.c
 
  +   if (!file-f_dentry || !file-f_dentry-d_inode)
  +   goto err_out_fput;
  +   if (file-f_op != socket_file_ops)
  +   goto err_out_fput;
  +
  +   sk = SOCKET_I(file-f_dentry-d_inode)-sk;
  +
 
 
 You dont need to acess the dentry to get the socket from the file pointer.
 
 (cf net/socket.c , function sock_from_file())
 
 if (file-f_op != socket_file_ops)
   goto err_out_fput;
 sk = file-private_data;
 
 (I repeat myself on this point, because I have a patch here so that only one 
 common dentry is allocated for all the sockets to reduce ram usage on big 
 servers : Everything but /proc/pid/fd is fine)

It will not be struct sock, but struct socket, i.e. only those sockets
which have userspace process attached.

 Eric
 

-- 
Evgeniy Polyakov
-
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/2] [IPV4]: Use network-order dport for all visible inet_lookup_*

2006-08-08 Thread Herbert Xu
On Tue, Aug 08, 2006 at 02:24:43AM -0700, David Miller wrote:
 
 This isn't so nice because we will now byte-swap the port twice when
 we try looking up a listening socket.  Once for the established lookup
 and once for the listening hash lookup.
 
 It should be easy to do the byte-swap once at a higher level right?

Good point.  This patch eliminates the double swap for __inet_lookup.

[IPV4]: Use network-order dport for all visible inet_lookup_*

Right now most inet_lookup_* functions take a host-order hnum instead
of a network-order dport because that's how it is represented internally.

This means that users of these functions have to be careful about using
the right byte-order.  To add more confusion, inet_lookup takes a
network-order dport unlike all other functions.

So this patch changes all visible inet_lookup functions to take a dport
and move all dport-hnum conversion inside them.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
e27e3b120697dfcf46a840291de318123e9b78f4
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index bd513f3..b4491c9 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -271,10 +271,16 @@ static inline int inet_iif(const struct 
return ((struct rtable *)skb-dst)-rt_iif;
 }
 
-extern struct sock *
-   inet_lookup_listener(struct inet_hashinfo *hashinfo,
-const u32 daddr,
-const unsigned short hnum, const int dif);
+extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo,
+  const u32 daddr,
+  const unsigned short hnum,
+  const int dif);
+
+static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
+   u32 daddr, u16 dport, int dif)
+{
+   return __inet_lookup_listener(hashinfo, daddr, ntohs(dport), dif);
+}
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
@@ -362,14 +368,25 @@ hit:
goto out;
 }
 
+static inline struct sock *
+   inet_lookup_established(struct inet_hashinfo *hashinfo,
+   const u32 saddr, const u16 sport,
+   const u32 daddr, const u16 dport,
+   const int dif)
+{
+   return __inet_lookup_established(hashinfo, saddr, sport, daddr,
+ntohs(dport), dif);
+}
+
 static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
 const u32 saddr, const u16 sport,
-const u32 daddr, const u16 hnum,
+const u32 daddr, const u16 dport,
 const int dif)
 {
+   u16 hnum = ntohs(dport);
struct sock *sk = __inet_lookup_established(hashinfo, saddr, sport, 
daddr,
hnum, dif);
-   return sk ? : inet_lookup_listener(hashinfo, daddr, hnum, dif);
+   return sk ? : __inet_lookup_listener(hashinfo, daddr, hnum, dif);
 }
 
 static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo,
@@ -380,7 +397,7 @@ static inline struct sock *inet_lookup(s
struct sock *sk;
 
local_bh_disable();
-   sk = __inet_lookup(hashinfo, saddr, sport, daddr, ntohs(dport), dif);
+   sk = __inet_lookup(hashinfo, saddr, sport, daddr, dport, dif);
local_bh_enable();
 
return sk;
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7f56f7e..58c3275 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -605,10 +605,10 @@ static struct sock *dccp_v4_hnd_req(stru
if (req != NULL)
return dccp_check_req(sk, skb, req, prev);
 
-   nsk = __inet_lookup_established(dccp_hashinfo,
-   iph-saddr, dh-dccph_sport,
-   iph-daddr, ntohs(dh-dccph_dport),
-   inet_iif(skb));
+   nsk = inet_lookup_established(dccp_hashinfo,
+ iph-saddr, dh-dccph_sport,
+ iph-daddr, dh-dccph_dport,
+ inet_iif(skb));
if (nsk != NULL) {
if (nsk-sk_state != DCCP_TIME_WAIT) {
bh_lock_sock(nsk);
@@ -921,7 +921,7 @@ static int dccp_v4_rcv(struct sk_buff *s
 *  Look up flow ID in table and get corresponding socket */
sk = __inet_lookup(dccp_hashinfo,
   skb-nh.iph-saddr, dh-dccph_sport,
-  skb-nh.iph-daddr, 

Re: 802.11/crypto questions

2006-08-08 Thread Johannes Berg

Jouni Malinen wrote:

Depends on what exactly you mean with on the fly. We have indeed
changed between doing software and hardware crypto for some cases, e.g.,
when enabling another BSS while one BSS is using static WEP (which would
need default WEP keys in hwaccel) in one BSS, we may disable hwaccel for
the receive case. 

Yeah, that's basically what I was thinking of.

Also, if we add a monitor if, does it disable hw crypto so we can see 
the undecrypted frames?


johannes
-
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: airo: inconsistent {hardirq-on-W} - {in-hardirq-W} usage.

2006-08-08 Thread Dan Williams
On Tue, 2006-08-08 at 12:44 +0300, Pekka Pietikainen wrote:
 Only aironet lockdep related report I could find was 
 http://marc.theaimsgroup.com/?l=linux-netdevm=115406279721287w=2

Shouldn't this be fixed by the wireless events patch that was a result
of the orinoco lockdep issues that davej posted about last week?

Dan

 this looks a bit different:
 
 Linux version 2.6.17-1.2528.fc6 ([EMAIL PROTECTED]) (gcc version 4.1.1 
 20060802 (Red Hat 4.1.1-14)) #1 SMP Sun Aug 6 01:43:42 EDT 2006
 
 =
 [ INFO: inconsistent lock state ]
 -
 inconsistent {hardirq-on-W} - {in-hardirq-W} usage.
 swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
  (list-lock){++..}, at: [c05b2ed9] skb_queue_tail+0x14/0x32
 {hardirq-on-W} state was registered at:
   [c043bfb9] lock_acquire+0x4b/0x6a
   [c060f428] _spin_lock_bh+0x1e/0x2d
   [c05ed45e] udp_poll+0x49/0xce
   [c05ae678] sock_poll+0x12/0x15
   [c04838da] do_sys_poll+0x1f7/0x3c3
   [c0483ada] sys_poll+0x34/0x36
   [c0403faf] syscall_call+0x7/0xb
 irq event stamp: 516288
 hardirqs last  enabled at (516287): [c0403ff7] restore_nocheck+0x12/0x15
 hardirqs last disabled at (516288): [c0404a3f] common_interrupt+0x1b/0x2c
 softirqs last  enabled at (516272): [c042941f] __do_softirq+0xec/0xf2
 softirqs last disabled at (516261): [c0406673] do_softirq+0x5a/0xbe
 
 other info that might help us debug this:
 no locks held by swapper/0.
 
 stack backtrace:
  [c04051ee] show_trace_log_lvl+0x58/0x159
  [c04057ea] show_trace+0xd/0x10
  [c0405903] dump_stack+0x19/0x1b
  [c043a402] print_usage_bug+0x1ca/0x1d7
  [c043a748] mark_lock+0x96/0x353
  [c043b463] __lock_acquire+0x3b2/0x997
  [c043bfb9] lock_acquire+0x4b/0x6a
  [c060f727] _spin_lock_irqsave+0x22/0x32
  [c05b2ed9] skb_queue_tail+0x14/0x32
  [c05ca889] netlink_broadcast+0x1bf/0x28e
  [c05c234e] wireless_send_event+0x28b/0x29d
  [f099a098] airo_send_event+0x6c/0x76 [airo]
  [f099de2d] airo_interrupt+0x210/0xff7 [airo]
  [c0450dd8] handle_IRQ_event+0x20/0x4d
  [c0450e99] __do_IRQ+0x94/0xef
  [c0406790] do_IRQ+0xb9/0xcd
  [c0404a49] common_interrupt+0x25/0x2c
 DWARF2 unwinder stuck at common_interrupt+0x25/0x2c
 Leftover inexact backtrace:
  [c04057ea] show_trace+0xd/0x10
  [c0405903] dump_stack+0x19/0x1b
  [c043a402] print_usage_bug+0x1ca/0x1d7
  [c043a748] mark_lock+0x96/0x353
  [c043b463] __lock_acquire+0x3b2/0x997
  [c043bfb9] lock_acquire+0x4b/0x6a
  [c060f727] _spin_lock_irqsave+0x22/0x32
  [c05b2ed9] skb_queue_tail+0x14/0x32
  [c05ca889] netlink_broadcast+0x1bf/0x28e
  [c05c234e] wireless_send_event+0x28b/0x29d
  [f099a098] airo_send_event+0x6c/0x76 [airo]
  [f099de2d] airo_interrupt+0x210/0xff7 [airo]
  [c0450dd8] handle_IRQ_event+0x20/0x4d
  [c0450e99] __do_IRQ+0x94/0xef
  [c0406790] do_IRQ+0xb9/0xcd
  [c0404a49] common_interrupt+0x25/0x2c
  [c0402cd9] cpu_idle+0xa7/0xc1
  [c04005f5] rest_init+0x23/0x26
  [c07aa81a] start_kernel+0x3ab/0x3b3
  [c0400210] 0xc0400210
 -
 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


Re: airo: inconsistent {hardirq-on-W} - {in-hardirq-W} usage.

2006-08-08 Thread Pekka Pietikainen
On Tue, Aug 08, 2006 at 09:16:13PM +1000, Herbert Xu wrote:
 Pekka Pietikainen [EMAIL PROTECTED] wrote:
  Only aironet lockdep related report I could find was 
  http://marc.theaimsgroup.com/?l=linux-netdevm=115406279721287w=2
  
  this looks a bit different:
  
  Linux version 2.6.17-1.2528.fc6 ([EMAIL PROTECTED]) (gcc version 4.1.1 
  20060802 (Red Hat 4.1.1-14)) #1 SMP Sun Aug 6 01:43:42 EDT 2006
 
 If you run the latest upstream kernel this warning will disappear
 as different skb queues no have different lock keys.
Hmm... I retried with a 2.6.18rc4-based rawhide kernel and the warning
is still there, previous one was rc3-git7.

Could be http://marc.theaimsgroup.com/?l=linux-netdevm=115461336523555w=2
which isn't upstream yet, right?
-
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: Stackable devices.

2006-08-08 Thread Christophe Devriese
On Wed, Aug 02, 2006 at 10:50:08AM -0700, Ben Greear wrote:
 Currently, the bridge hook logic is something like:
 
 if (bridge-consumed-pkt) {
   return
 }
 
 // drop through to other layers
 
 
 There are several other hooks I'd like to see added (pktgen receive 
 processing,
 mac-vlans, etc).  Each of these hooks are logically similar to the bridge 
 hook,
 ie if it consumes the pkt, return, else, drop through to the next hook 
 untill
 we get to the regular protocol processing logic.
 
 I would like to be able to chain layer-2 handlers, such as bridge, mac-vlan,
 pktgen such that if one consumed, you break out of the handling, else, you
 try the next handler.  The handlers can be dynamically registered and 
 inserted
 in any order, controllable by user-space and/or module load/unload.
 
 For many of the handlers, the logic will re-insert the packet by re-calling 
 the
 netif-rx logic, so there would need to be some protection to keep loops from
 occurring that would recurse too much and overflow the stack.

I'm also a big fan of a generalized system like this. It would need to
catch both the vlan accelerated path and the normal path.

-- 
---
Christophe Devriese   EURiD
Network Adminstrator / Developer
[EMAIL PROTECTED]
 http://www.eth1.org --

-
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] [e1000]: Remove unnecessary tx_lock

2006-08-08 Thread jamal

Is the patch below making it in? As i pointed out in another email
tests reveal it is good.

cheers,
jamal

On Sun, 2006-06-08 at 12:51 +1000, Herbert Xu wrote:
 On Sat, Aug 05, 2006 at 07:36:50PM -0400, jamal wrote:
  
  I know the qlen is = 0 otherwise i will hit the BUG().
  A qlen of 0 will be interesting to find as well.
 
 When the queue is woken it will always to qdisc_run regardless of
 whether there are packets queued so this might explain what you're
 seeing.
 
 Anyway, I've changed the unconditional atomic op into a memory
 barrier instead.  Let me know if this changes things for you.
 
 I wonder if we could do the TX clean up within the transmission
 routine most of the time.  Has anyone tried this before?
 
 Cheers,
 -- 
 Visit Openswan at http://www.openswan.org/
 Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
 Home Page: http://gondor.apana.org.au/~herbert/
 PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
 --
 diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
 index 627f224..e7e1306 100644
 --- a/drivers/net/e1000/e1000_main.c
 +++ b/drivers/net/e1000/e1000_main.c
 @@ -2861,6 +2861,33 @@ e1000_transfer_dhcp_info(struct e1000_ad
   return 0;
  }
  
 +static int __e1000_maybe_stop_tx(struct net_device *netdev, int size)
 +{
 + struct e1000_adapter *adapter = netdev_priv(netdev);
 + struct e1000_tx_ring *tx_ring = adapter-tx_ring;
 +
 + netif_stop_queue(netdev);
 + smp_mb__after_netif_stop_queue();
 +
 + /* We need to check again in a case another CPU has just
 +  * made room available.
 +  */
 + if (likely(E1000_DESC_UNUSED(tx_ring)  size))
 + return -EBUSY;
 +
 + /* A reprieve! */
 + netif_start_queue(netdev);
 + return 0;
 +}
 +
 +static inline int e1000_maybe_stop_tx(struct net_device *netdev,
 +   struct e1000_tx_ring *tx_ring, int size)
 +{
 + if (likely(E1000_DESC_UNUSED(tx_ring) = size))
 + return 0;
 + return __e1000_maybe_stop_tx(netdev, size);
 +}
 +
  #define TXD_USE_COUNT(S, X) (((S)  (X)) + 1 )
  static int
  e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 @@ -2974,8 +3001,7 @@ #endif
  
   /* need: count + 2 desc gap to keep tail from touching
* head, otherwise try next time */
 - if (unlikely(E1000_DESC_UNUSED(tx_ring)  count + 2)) {
 - netif_stop_queue(netdev);
 + if (unlikely(e1000_maybe_stop_tx(netdev, tx_ring, count + 2))) {
   spin_unlock_irqrestore(tx_ring-tx_lock, flags);
   return NETDEV_TX_BUSY;
   }
 @@ -3022,8 +3048,7 @@ #endif
   netdev-trans_start = jiffies;
  
   /* Make sure there is space in the ring for the next send. */
 - if (unlikely(E1000_DESC_UNUSED(tx_ring)  MAX_SKB_FRAGS + 2))
 - netif_stop_queue(netdev);
 + e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2);
  
   spin_unlock_irqrestore(tx_ring-tx_lock, flags);
   return NETDEV_TX_OK;
 @@ -3515,13 +3540,14 @@ #endif
   tx_ring-next_to_clean = i;
  
  #define TX_WAKE_THRESHOLD 32
 - if (unlikely(cleaned  netif_queue_stopped(netdev) 
 -  netif_carrier_ok(netdev))) {
 - spin_lock(tx_ring-tx_lock);
 - if (netif_queue_stopped(netdev) 
 - (E1000_DESC_UNUSED(tx_ring) = TX_WAKE_THRESHOLD))
 + if (unlikely(cleaned  netif_carrier_ok(netdev) 
 +  E1000_DESC_UNUSED(tx_ring) = TX_WAKE_THRESHOLD)) {
 + /* Make sure that anybody stopping the queue after this
 +  * sees the new next_to_clean.
 +  */
 + smp_mb();
 + if (netif_queue_stopped(netdev))
   netif_wake_queue(netdev);
 - spin_unlock(tx_ring-tx_lock);
   }
  
   if (adapter-detect_tx_hung) {
 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
 index 75f02d8..7daaf71 100644
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
 @@ -33,6 +33,7 @@ #ifdef __KERNEL__
  #include asm/atomic.h
  #include asm/cache.h
  #include asm/byteorder.h
 +#include asm/system.h
  
  #include linux/device.h
  #include linux/percpu.h
 @@ -652,6 +653,12 @@ #endif
   set_bit(__LINK_STATE_XOFF, dev-state);
  }
  
 +static inline void smp_mb__after_netif_stop_queue(void)
 +{
 + /* Need to add smp_mb__after_set_bit(). */
 + smp_mb();
 +}
 +
  static inline int netif_queue_stopped(const struct net_device *dev)
  {
   return test_bit(__LINK_STATE_XOFF, dev-state);
 -
 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


Re: [PATCH -rt DO NOT APPLY] Fix for tg3 networking lockup

2006-08-08 Thread Steven Rostedt

On Sun, 6 Aug 2006, David Miller wrote:

 From: Steven Rostedt [EMAIL PROTECTED]
 Date: Mon, 7 Aug 2006 01:34:56 -0400 (EDT)

  My suggestion would be to separate that tg3_timer into 4 different
  timers, which is what it actually looks like.

 Timers have non-trivial cost.  It's cheaper to have one and
 vector off to the necessary operations each tick internalls.

 That's why it's implemented as one timer.


hrtimers don't have the cost of a normal timer. And that's why I suggested
to convert them.  There's a much bigger cost in a single timer that always
times out than 3 hrtimers.  hrtimers are expected to timeout, but timers
are not.

Of the 4 timers, only one is a timeout. The other three expire every time,
forcing the timer wheel into effect.  Even though it's one timer
implementing 4, it's expensive to use it as a watchdog.

-- Steve

-
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] [e1000]: Remove unnecessary tx_lock

2006-08-08 Thread Herbert Xu
On Tue, Aug 08, 2006 at 08:21:58AM -0400, jamal wrote:
 
 Is the patch below making it in? As i pointed out in another email
 tests reveal it is good.

I'll write up a proper description and submit it.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [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] limit rt cache size

2006-08-08 Thread Kirill Korotaev

David Miller wrote:

From: Andi Kleen [EMAIL PROTECTED]
Date: Tue, 8 Aug 2006 08:53:03 +0200



That's still too big. Consider a 2TB machine, with all memory in LOWMEM.



Andi I agree with you, route.c should pass in a suitable limit.
I'm just suggesting a fix for a seperate problem.


So summaring up we have the following issues imho:
1a) rt hash size should be calculated based on lowmem size, not total size
1b) rt hash size should have some upper limit (requested by Andi Kleen for huge 
mem systems)
2a) max number of rt hash entries should be calculated based on low memory, not 
as
  rt_hash_chains*16.
2b) when CONFIG_DEBUG_SLAB and CONFIG_DEBUG_PAGE_ALLOC are ON, 2a) should be 
corrected
  taking into account _real_ rtable entry size (one page instead of 256b!!!).
3) should we limit TCP hashe and hashb size the same way?

If I haven't missed something I will prepare a patch for 1-2) and
a separate patch for 3).

Thanks,
Kirill
-
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: airo: inconsistent {hardirq-on-W} - {in-hardirq-W} usage.

2006-08-08 Thread Herbert Xu
On Tue, Aug 08, 2006 at 02:38:51PM +0300, Pekka Pietikainen wrote:

 Hmm... I retried with a 2.6.18rc4-based rawhide kernel and the warning
 is still there, previous one was rc3-git7.

Are you sure it's the same warning? The one you quoted earlier is
caused by the lock validator mixing up spin locks from different
skb_buff_head objects.  This is fixed by

commit 76f10ad0e67cbc6ded2ee143e5188e0b7ff9fb15
Author: Arjan van de Ven [EMAIL PROTECTED]
Date:   Wed Aug 2 14:06:55 2006 -0700

[NET]: Remove lockdep_set_class() call from skb_queue_head_init().

which is definitely upstream.

 Could be http://marc.theaimsgroup.com/?l=linux-netdevm=115461336523555w=2
 which isn't upstream yet, right?

That's a separate bug fix which should produce an entirely different
warning.  Although I concede that this patch would make your original
warning look slightly different :)

John, could you please push this to Jeff? Thanks.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [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] limit rt cache size

2006-08-08 Thread Andi Kleen

 3) should we limit TCP hashe and hashb size the same way?

Yes - or best in fact all hashes handled by alloc_large_system_hash()

-Andi
-
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: airo: inconsistent {hardirq-on-W} - {in-hardirq-W} usage.

2006-08-08 Thread John W. Linville
On Tue, Aug 08, 2006 at 10:52:22PM +1000, Herbert Xu wrote:
 On Tue, Aug 08, 2006 at 02:38:51PM +0300, Pekka Pietikainen wrote:

  Could be http://marc.theaimsgroup.com/?l=linux-netdevm=115461336523555w=2
  which isn't upstream yet, right?
 
 That's a separate bug fix which should produce an entirely different
 warning.  Although I concede that this patch would make your original
 warning look slightly different :)
 
 John, could you please push this to Jeff? Thanks.

Already did so, on Friday.

John
-- 
John W. Linville
[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/2] [IPV4]: Use network-order dport for all visible inet_lookup_*

2006-08-08 Thread Christoph Hellwig
On Tue, Aug 08, 2006 at 09:11:40PM +1000, Herbert Xu wrote:
 On Tue, Aug 08, 2006 at 02:24:43AM -0700, David Miller wrote:
  
  This isn't so nice because we will now byte-swap the port twice when
  we try looking up a listening socket.  Once for the established lookup
  and once for the listening hash lookup.
  
  It should be easy to do the byte-swap once at a higher level right?
 
 Good point.  This patch eliminates the double swap for __inet_lookup.
 
 [IPV4]: Use network-order dport for all visible inet_lookup_*

Shouldn't it use __be16 types then?

-
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/2] [IPV4]: Use network-order dport for all visible inet_lookup_*

2006-08-08 Thread Herbert Xu
Christoph Hellwig [EMAIL PROTECTED] wrote:

 [IPV4]: Use network-order dport for all visible inet_lookup_*
 
 Shouldn't it use __be16 types then?

Yes it should.

However, we can't easily annotate the stack piecemeal.  So this should
be annotated along with the rest of the stack (e.g., tcphdr, etc.).

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [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 1/6] rt2x00 - pci request/release regions

2006-08-08 Thread Ivo van Doorn
According to Documentation/pci.txt in 2.6.18 pci_request_regions()
should be called _before_ pci_enable_device().
And pci_release_regions() should be called after pci_disable_device().

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c  
2006-08-08 14:18:32.0 +0200
+++ wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2400pci.c  
2006-08-08 14:35:53.0 +0200
@@ -2851,10 +2851,16 @@
struct net_device *net_dev;
int status;
 
+   status = pci_request_regions(pci_dev, pci_name(pci_dev));
+   if (status) {
+   ERROR(PCI request regions failed.\n);
+   return status;
+   }
+
status = pci_enable_device(pci_dev);
if (status) {
ERROR(Enable device failed.\n);
-   return status;
+   goto exit_release_regions;
}
 
pci_set_master(pci_dev);
@@ -2869,17 +2875,11 @@
goto exit_disable_device;
}
 
-   status = pci_request_regions(pci_dev, pci_name(pci_dev));
-   if (status) {
-   ERROR(PCI request regions failed.\n);
-   goto exit_disable_device;
-   }
-
net_dev = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), NULL);
if (!net_dev) {
ERROR(Failed to allocate hardware.\n);
status = -ENOMEM;
-   goto exit_release_regions;
+   goto exit_disable_device;
}
 
SET_ETHTOOL_OPS(net_dev, rt2400pci_ethtool_ops);
@@ -2898,13 +2898,13 @@
 exit_free_device:
ieee80211_free_hw(net_dev);
 
-exit_release_regions:
-   pci_release_regions(pci_dev);
-
 exit_disable_device:
if (status != -EBUSY)
pci_disable_device(pci_dev);
 
+exit_release_regions:
+   pci_release_regions(pci_dev);
+
pci_set_drvdata(pci_dev, NULL);
 
return status;
@@ -2927,9 +2927,9 @@
 
pci_set_drvdata(pci_dev, NULL);
 
-   pci_release_regions(pci_dev);
-
pci_disable_device(pci_dev);
+
+   pci_release_regions(pci_dev);
 }
 
 #ifdef CONFIG_PM
diff -rU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c  
2006-08-08 14:18:32.0 +0200
+++ wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500pci.c  
2006-08-08 14:35:38.0 +0200
@@ -3134,10 +3134,16 @@
struct net_device *net_dev;
int status;
 
+   status = pci_request_regions(pci_dev, pci_name(pci_dev));
+   if (status) {
+   ERROR(PCI request regions failed.\n);
+   return status;
+   }
+
status = pci_enable_device(pci_dev);
if (status) {
ERROR(Enable device failed.\n);
-   return status;
+   goto exit_release_regions;
}
 
pci_set_master(pci_dev);
@@ -3152,17 +3158,11 @@
goto exit_disable_device;
}
 
-   status = pci_request_regions(pci_dev, pci_name(pci_dev));
-   if (status) {
-   ERROR(PCI request regions failed.\n);
-   goto exit_disable_device;
-   }
-
net_dev = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), NULL);
if (!net_dev) {
ERROR(Failed to allocate hardware.\n);
status = -ENOMEM;
-   goto exit_release_regions;
+   goto exit_disable_device;
}
 
SET_ETHTOOL_OPS(net_dev, rt2500pci_ethtool_ops);
@@ -3181,13 +3181,13 @@
 exit_free_device:
ieee80211_free_hw(net_dev);
 
-exit_release_regions:
-   pci_release_regions(pci_dev);
-
 exit_disable_device:
if (status != -EBUSY)
pci_disable_device(pci_dev);
 
+exit_release_regions:
+   pci_release_regions(pci_dev);
+
pci_set_drvdata(pci_dev, NULL);
 
return status;
@@ -3210,9 +3210,9 @@
 
pci_set_drvdata(pci_dev, NULL);
 
-   pci_release_regions(pci_dev);
-
pci_disable_device(pci_dev);
+
+   pci_release_regions(pci_dev);
 }
 
 #ifdef CONFIG_PM
diff -rU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt61pci.c 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt61pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt61pci.c
2006-08-08 14:18:32.0 +0200
+++ wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt61pci.c
2006-08-08 14:35:44.0 +0200
@@ -3665,10 +3665,16 @@
struct net_device *net_dev;
int status;
 
+   status = pci_request_regions(pci_dev, pci_name(pci_dev));
+   if (status) {
+   ERROR(PCI request regions failed.\n);
+   return status;
+

[PATCH 0/6] rt2x00

2006-08-08 Thread Ivo van Doorn
Hi,

Here are some minor patches for rt2x00 for wireless-dev,
nothing fancy in there, just some optimizations and fixes that
are now possible due to some changes in the dscape stack. :)

Ivo
-
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 5/6] rt2x00 - scan handlers

2006-08-08 Thread Ivo van Doorn
Move scan structure initialization and handling into
some generic handlers in rt2x00.h.
This also fixed some obscure coding when waiting for the
empty txrings before starting a scan.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.c  
2006-08-08 14:55:51.0 +0200
+++ wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
2006-08-08 15:09:24.0 +0200
@@ -1381,10 +1381,8 @@
/*
 * Cancel scanning.
 */
-   if (rt2x00dev-scan) {
-   rt2x00dev-scan-status = SCANNING_CANCELLED;
-   complete_all(rt2x00dev-scan-completion);
-   }
+   if (rt2x00dev-scan)
+   rt2x00_signal_scan(rt2x00dev-scan, SCANNING_CANCELLED);
 
/*
 * Flush out all pending work.
@@ -1802,10 +1800,8 @@
if (rt2x00dev-scan 
rt2x00_ring_empty(rt2x00dev-ring[RING_TX]) 
rt2x00_ring_empty(rt2x00dev-ring[RING_ATIM]) 
-   rt2x00_ring_empty(rt2x00dev-ring[RING_PRIO])) {
-   rt2x00dev-scan-status = SCANNING_READY;
-   complete(rt2x00dev-scan-completion);
-   }
+   rt2x00_ring_empty(rt2x00dev-ring[RING_PRIO]))
+   rt2x00_signal_scan(rt2x00dev-scan, SCANNING_READY);
 
/*
 * If the data ring was full before the txdone handler
@@ -2153,14 +2149,7 @@
 * we need to wait untill all TX rings are empty to
 * guarentee that all frames are send on the correct channel.
 */
-   if (rt2x00dev-scan-status != SCANNING_READY)
-   wait_for_completion(rt2x00dev-scan-completion);
-
-   /*
-* Check if this scan has been cancelled while
-* work was still scheduled.
-*/
-   if (rt2x00dev-scan-status == SCANNING_CANCELLED)
+   if (rt2x00_wait_scan(rt2x00dev-scan))
goto exit;
 
/*
@@ -2232,13 +2221,7 @@
/*
 * Initialize Scanning structure.
 */
-   init_completion(rt2x00dev-scan-completion);
-
-   memcpy(rt2x00dev-scan-conf, conf, sizeof(*conf));
-
-   rt2x00dev-scan-state = state;
-
-   rt2x00dev-scan-status = 0;
+   rt2x00_start_scan(rt2x00dev-scan, conf, state);
 
/*
 * Queue work.
diff -rU3 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.c  
2006-08-08 14:56:52.0 +0200
+++ wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
2006-08-08 15:10:31.0 +0200
@@ -1501,10 +1501,8 @@
/*
 * Cancel scanning.
 */
-   if (rt2x00dev-scan) {
-   rt2x00dev-scan-status = SCANNING_CANCELLED;
-   complete_all(rt2x00dev-scan-completion);
-   }
+   if (rt2x00dev-scan)
+   rt2x00_signal_scan(rt2x00dev-scan, SCANNING_CANCELLED);
 
/*
 * Flush out all pending work.
@@ -1949,10 +1947,8 @@
if (rt2x00dev-scan 
rt2x00_ring_empty(rt2x00dev-ring[RING_TX]) 
rt2x00_ring_empty(rt2x00dev-ring[RING_ATIM]) 
-   rt2x00_ring_empty(rt2x00dev-ring[RING_PRIO])) {
-   rt2x00dev-scan-status = SCANNING_READY;
-   complete(rt2x00dev-scan-completion);
-   }
+   rt2x00_ring_empty(rt2x00dev-ring[RING_PRIO]))
+   rt2x00_signal_scan(rt2x00dev-scan, SCANNING_READY);
 
/*
 * If the data ring was full before the txdone handler
@@ -2301,14 +2297,7 @@
 * we need to wait untill all TX rings are empty to
 * guarentee that all frames are send on the correct channel.
 */
-   if (rt2x00dev-scan-status != SCANNING_READY)
-   wait_for_completion(rt2x00dev-scan-completion);
-
-   /*
-* Check if this scan has been cancelled while
-* work was still scheduled.
-*/
-   if (rt2x00dev-scan-status == SCANNING_CANCELLED)
+   if (rt2x00_wait_scan(rt2x00dev-scan))
goto exit;
 
/*
@@ -2376,13 +2365,7 @@
/*
 * Initialize Scanning structure.
 */
-   init_completion(rt2x00dev-scan-completion);
-
-   memcpy(rt2x00dev-scan-conf, conf, sizeof(*conf));
-
-   rt2x00dev-scan-state = state;
-
-   rt2x00dev-scan-status = 0;
+   rt2x00_start_scan(rt2x00dev-scan, conf, state);
 
/*
 * Queue work.
diff -rU3 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.c  
2006-08-08 14:57:42.0 +0200
+++ 

[PATCH 4/6] rt2x00 - txpower limits

2006-08-08 Thread Ivo van Doorn
Also check for equality with txpower limits.
It doesn't do any harm, but it does prevent compiler
warnings in certain conditions.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.h 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.h
--- 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.h
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.h  
2006-08-08 15:05:04.0 +0200
@@ -881,8 +881,8 @@
 #define TXPOWER_TO_DEV(__txpower) \
({ \
(__txpower) += MIN_TXPOWER; \
-   ((__txpower)  MIN_TXPOWER) ? MAX_TXPOWER : \
-   (((__txpower)  MAX_TXPOWER) ? MIN_TXPOWER : \
+   ((__txpower) = MIN_TXPOWER) ? MAX_TXPOWER : \
+   (((__txpower) = MAX_TXPOWER) ? MIN_TXPOWER : \
(MAX_TXPOWER - ((__txpower) - MIN_TXPOWER))); \
})
 
diff -rU3 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.h 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
--- 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.h  
2006-08-08 15:05:16.0 +0200
@@ -1142,8 +1142,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
({ \
-   ((__txpower)  MIN_TXPOWER) ? MIN_TXPOWER : \
-   (((__txpower)  MAX_TXPOWER) ? MAX_TXPOWER : \
+   ((__txpower) = MIN_TXPOWER) ? MIN_TXPOWER : \
+   (((__txpower) = MAX_TXPOWER) ? MAX_TXPOWER : \
(__txpower)); \
})
 
diff -rU3 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.h 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
--- 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.h  
2006-08-08 15:05:27.0 +0200
@@ -679,8 +679,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
({ \
-   ((__txpower)  MIN_TXPOWER) ? MIN_TXPOWER : \
-   (((__txpower)  MAX_TXPOWER) ? MAX_TXPOWER : \
+   ((__txpower) = MIN_TXPOWER) ? MIN_TXPOWER : \
+   (((__txpower) = MAX_TXPOWER) ? MAX_TXPOWER : \
(__txpower)); \
})
 
diff -rU3 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt61pci.h 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt61pci.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt61pci.h  
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt61pci.h
2006-08-08 15:05:36.0 +0200
@@ -1360,8 +1360,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
({ \
-   ((__txpower)  MIN_TXPOWER) ? MIN_TXPOWER : \
-   (((__txpower)  MAX_TXPOWER) ? MAX_TXPOWER : \
+   ((__txpower) = MIN_TXPOWER) ? MIN_TXPOWER : \
+   (((__txpower) = MAX_TXPOWER) ? MAX_TXPOWER : \
(__txpower)); \
})
 
diff -rU3 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt73usb.h 
wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt73usb.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt73usb.h  
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt73usb.h
2006-08-08 15:05:44.0 +0200
@@ -939,8 +939,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
({ \
-   ((__txpower)  MIN_TXPOWER) ? MIN_TXPOWER : \
-   (((__txpower)  MAX_TXPOWER) ? MAX_TXPOWER : \
+   ((__txpower) = MIN_TXPOWER) ? MIN_TXPOWER : \
+   (((__txpower) = MAX_TXPOWER) ? MAX_TXPOWER : \
(__txpower)); \
})
 
-
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 6/6] rt2x00 - misc fixes

2006-08-08 Thread Ivo van Doorn
Small misc fixes,
- remove unwanted whitespaces
- limit lines to 80 characters
- byteordering fix
- comment fix

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 
wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
2006-08-08 15:10:31.0 +0200
+++ wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
2006-08-08 15:26:03.0 +0200
@@ -2315,7 +2315,7 @@
} else {
rt2500pci_config_phymode(rt2x00dev,
rt2x00dev-scan-conf.running_phymode);
-   
+
rt2500pci_config_channel(rt2x00dev,
rt2x00dev-scan-conf.running_channel_val,
rt2x00dev-scan-conf.running_channel,
@@ -2842,7 +2842,7 @@
};
 
struct ieee80211_channel *chan = channels + 14;
-   
+
for (i = 0; i  ARRAY_SIZE(vals); i++)
(chan++)-val = cpu_to_le32(vals[i]);
}
diff -rU3 
wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
2006-08-08 15:12:02.0 +0200
+++ wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
2006-08-08 15:27:05.0 +0200
@@ -170,7 +170,8 @@
*value = 0xff;
 }
 
-static void rt2x00_rf_write(const struct rt2x00_dev *rt2x00dev, const u32 
value)
+static void rt2x00_rf_write(const struct rt2x00_dev *rt2x00dev,
+   const u32 value)
 {
u16 reg;
unsigned int i;
@@ -1481,7 +1482,7 @@
else
rt2x00_set_field32(txd-word0, TXD_W0_MORE_FRAG, 0);
 
-   if ((ieee80211hdr-seq_ctrl  IEEE80211_SCTL_FRAG) == 0)
+   if ((le16_to_cpu(ieee80211hdr-seq_ctrl)  IEEE80211_SCTL_FRAG) == 0)
rt2x00_set_field32(txd-word0, TXD_W0_NEW_SEQ, 1);
else
rt2x00_set_field32(txd-word0, TXD_W0_NEW_SEQ, 0);
@@ -2031,7 +2032,7 @@
if (rt2x00dev-scan-state == IEEE80211_SCAN_START) {
rt2500usb_config_phymode(rt2x00dev,
rt2x00dev-scan-conf.scan_phymode);
-   
+
rt2500usb_config_channel(rt2x00dev,
rt2x00dev-scan-conf.scan_channel_val,
rt2x00dev-scan-conf.scan_channel,
@@ -2040,7 +2041,7 @@
} else {
rt2500usb_config_phymode(rt2x00dev,
rt2x00dev-scan-conf.running_phymode);
-   
+
rt2500usb_config_channel(rt2x00dev,
rt2x00dev-scan-conf.running_channel_val,
rt2x00dev-scan-conf.running_channel,
diff -rU3 wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2x00.h 
wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2x00.h
--- wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt2x00.h
2006-08-08 15:12:43.0 +0200
+++ wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt2x00.h
2006-08-08 15:27:30.0 +0200
@@ -794,7 +794,7 @@
 * Device structure.
 * The structure stored in here depends on the
 * system bus (PCI or USB).
-* When accessing this variable, the rt2x00{pci,usb}_dev
+* When accessing this variable, the rt2x00dev_{pci,usb}
 * macro's should be used for correct typecasting.
 */
void *dev;
diff -rU3 wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt61pci.c 
wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt61pci.c
--- wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt61pci.c   
2006-08-08 15:14:45.0 +0200
+++ wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt61pci.c   
2006-08-08 15:28:30.0 +0200
@@ -3459,7 +3459,6 @@
hw-modes[0].num_channels = 14;
hw-modes[0].num_rates = 12;
 
-
/*
 * Intitialize 802.11b
 * Rates: CCK.
diff -rU3 wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt73usb.c 
wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt73usb.c
--- wireless-dev-rt2x00-scan/drivers/net/wireless/d80211/rt2x00/rt73usb.c   
2006-08-08 15:19:04.0 +0200
+++ wireless-dev-rt2x00-misc/drivers/net/wireless/d80211/rt2x00/rt73usb.c   
2006-08-08 15:28:35.0 +0200
@@ -2124,6 +2124,7 @@
 static int rt73usb_reset(struct net_device *net_dev)
 {
struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
+
rt73usb_disable_radio(rt2x00dev);
return rt73usb_enable_radio(rt2x00dev);
 }
@@ -2967,7 +2968,6 @@
hw-modes[0].num_channels = 14;
hw-modes[0].num_rates = 12;
 
-
/*
 * Intitialize 802.11b
 * Rates: CCK.
-
To 

[PATCH 3/6] rt2x00 - optimize MAC reading initialize perm_addr

2006-08-08 Thread Ivo van Doorn
When reading the MAC addr from MAC register or EEPROM
it is always read as little endian. Since we want to store it in a u8 array
we don't require byte ordering as long as we correctly read it into
an u8 array directly.
Also copy the address to perm_addr and enable ethtool to read it.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2400pci.c   
2006-08-08 14:42:33.0 +0200
+++ 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
2006-08-08 14:55:51.0 +0200
@@ -434,6 +434,7 @@
.get_link   = ethtool_op_get_link,
.get_eeprom_len = rt2400pci_get_eeprom_len,
.get_eeprom = rt2400pci_get_eeprom,
+   .get_perm_addr  = ethtool_op_get_perm_addr,
 };
 
 /*
@@ -2509,25 +2510,29 @@
 static int rt2400pci_init_mac(struct rt2x00_dev *rt2x00dev)
 {
struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
-   u32 reg[2] = { 0, 0 };
+   u8 reg[8];
 
if (GET_FLAG(rt2x00dev, DEVICE_INITIALIZED_MAC))
return 0;
 
-   rt2x00_register_multiread(rt2x00dev, CSR3, reg[0], sizeof(reg));
+   /*
+* Read MAC address from MAC register.
+*/
+   rt2x00_register_multiread(rt2x00dev, CSR3, (u32*)reg[0], 6);
 
-   net_dev-dev_addr[0] = rt2x00_get_field32(reg[0], CSR3_BYTE0);
-   net_dev-dev_addr[1] = rt2x00_get_field32(reg[0], CSR3_BYTE1);
-   net_dev-dev_addr[2] = rt2x00_get_field32(reg[0], CSR3_BYTE2);
-   net_dev-dev_addr[3] = rt2x00_get_field32(reg[0], CSR3_BYTE3);
-   net_dev-dev_addr[4] = rt2x00_get_field32(reg[1], CSR4_BYTE4);
-   net_dev-dev_addr[5] = rt2x00_get_field32(reg[1], CSR4_BYTE5);
+   /*
+* Check if a valid MAC address has been read.
+*/
+   if (!is_valid_ether_addr(reg[0]))
+   return -EINVAL;
 
+   /*
+* Copy to netdevice structure.
+*/
+   memcpy(net_dev-dev_addr[0], reg[0], 6);
+   memcpy(net_dev-perm_addr[0], reg[0], 6);
net_dev-addr_len = 6;
 
-   if (!is_valid_ether_addr(net_dev-dev_addr[0]))
-   return -EINVAL;
-
SET_FLAG(rt2x00dev, DEVICE_INITIALIZED_MAC);
return 0;
 }
diff -rU3 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500pci.c   
2006-08-08 14:43:39.0 +0200
+++ 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
2006-08-08 14:56:52.0 +0200
@@ -434,6 +434,7 @@
.get_link   = ethtool_op_get_link,
.get_eeprom_len = rt2500pci_get_eeprom_len,
.get_eeprom = rt2500pci_get_eeprom,
+   .get_perm_addr  = ethtool_op_get_perm_addr,
 };
 
 /*
@@ -2661,25 +2662,29 @@
 static int rt2500pci_init_mac(struct rt2x00_dev *rt2x00dev)
 {
struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
-   u32 reg[2] = { 0, 0 };
+   u8 reg[8];
 
if (GET_FLAG(rt2x00dev, DEVICE_INITIALIZED_MAC))
return 0;
 
-   rt2x00_register_multiread(rt2x00dev, CSR3, reg[0], sizeof(reg));
+   /*
+* Read MAC address from MAC register.
+*/
+   rt2x00_register_multiread(rt2x00dev, CSR3, (u32*)reg[0], 6);
 
-   net_dev-dev_addr[0] = rt2x00_get_field32(reg[0], CSR3_BYTE0);
-   net_dev-dev_addr[1] = rt2x00_get_field32(reg[0], CSR3_BYTE1);
-   net_dev-dev_addr[2] = rt2x00_get_field32(reg[0], CSR3_BYTE2);
-   net_dev-dev_addr[3] = rt2x00_get_field32(reg[0], CSR3_BYTE3);
-   net_dev-dev_addr[4] = rt2x00_get_field32(reg[1], CSR4_BYTE4);
-   net_dev-dev_addr[5] = rt2x00_get_field32(reg[1], CSR4_BYTE5);
+   /*
+* Check if a valid MAC address has been read.
+*/
+   if (!is_valid_ether_addr(reg[0]))
+   return -EINVAL;
 
+   /*
+* Copy to netdevice structure.
+*/
+   memcpy(net_dev-dev_addr[0], reg[0], 6);
+   memcpy(net_dev-perm_addr[0], reg[0], 6);
net_dev-addr_len = 6;
 
-   if (!is_valid_ether_addr(net_dev-dev_addr[0]))
-   return -EINVAL;
-
SET_FLAG(rt2x00dev, DEVICE_INITIALIZED_MAC);
return 0;
 }
diff -rU3 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500usb.c   
2006-08-08 14:45:02.0 +0200
+++ 
wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
2006-08-08 14:57:42.0 +0200
@@ -284,6 +284,7 @@
.get_link   = ethtool_op_get_link,

[PATCH 2/6] rt2x00 - ieee80211_hw-config no longer requires scheduling

2006-08-08 Thread Ivo van Doorn
d80211 no longer calls ieee80211_hw-config() fom interrupt context.
Make gratefully use of this and remove the workqueue scheduling
for the config changes.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rU3 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2400pci.c  
2006-08-08 14:35:53.0 +0200
+++ wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2400pci.c   
2006-08-08 14:42:33.0 +0200
@@ -2050,11 +2050,10 @@
rt2400pci_disable_radio(rt2x00dev);
 }
 
-static void rt2400pci_config_update(void *data)
+static int rt2400pci_config(struct net_device *net_dev,
+   struct ieee80211_conf *conf)
 {
-   struct rt2x00_dev *rt2x00dev = data;
-   struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
-   struct ieee80211_conf *conf = ieee80211_get_hw_conf(net_dev);
+   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
u32 reg;
 
/*
@@ -2085,21 +2084,10 @@
rt2x00_register_read(rt2x00dev, RXCSR0, reg);
rt2x00_set_field32(reg, RXCSR0_DISABLE_RX, 0);
rt2x00_register_write(rt2x00dev, RXCSR0, reg);
-   } else if (conf-radio_enabled) {
-   if (rt2400pci_enable_radio(rt2x00dev))
-   return;
-   }
-}
+   } else if (conf-radio_enabled)
+   return rt2400pci_enable_radio(rt2x00dev);
 
-static int rt2400pci_config(struct net_device *net_dev,
-   struct ieee80211_conf *conf)
-{
-   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
-
-   /*
-* Queue work.
-*/
-   return !queue_work(rt2x00dev-workqueue, rt2x00dev-config_work);
+   return 0;
 }
 
 static int rt2400pci_config_interface(struct net_device *net_dev, int if_id,
@@ -2798,11 +2786,6 @@
goto exit;
 
/*
-* Initialize cofniguration work.
-*/
-   INIT_WORK(rt2x00dev-config_work, rt2400pci_config_update, rt2x00dev);
-
-   /*
 * Reset current working type.
 */
rt2x00dev-interface.type = -EINVAL;
diff -rU3 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500pci.c  
2006-08-08 14:35:38.0 +0200
+++ wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500pci.c   
2006-08-08 14:43:39.0 +0200
@@ -2197,11 +2197,10 @@
rt2500pci_disable_radio(rt2x00dev);
 }
 
-static void rt2500pci_config_update(void *data)
+static int rt2500pci_config(struct net_device *net_dev,
+   struct ieee80211_conf *conf)
 {
-   struct rt2x00_dev *rt2x00dev = data;
-   struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
-   struct ieee80211_conf *conf = ieee80211_get_hw_conf(net_dev);
+   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
u32 reg;
 
/*
@@ -2233,21 +2232,10 @@
rt2x00_register_read(rt2x00dev, RXCSR0, reg);
rt2x00_set_field32(reg, RXCSR0_DISABLE_RX, 0);
rt2x00_register_write(rt2x00dev, RXCSR0, reg);
-   } else if (conf-radio_enabled) {
-   if (rt2500pci_enable_radio(rt2x00dev))
-   return;
-   }
-}
+   } else if (conf-radio_enabled)
+   return rt2500pci_enable_radio(rt2x00dev);
 
-static int rt2500pci_config(struct net_device *net_dev,
-   struct ieee80211_conf *conf)
-{
-   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
-
-   /*
-* Queue work.
-*/
-   return !queue_work(rt2x00dev-workqueue, rt2x00dev-config_work);
+   return 0;
 }
 
 static int rt2500pci_config_interface(struct net_device *net_dev, int if_id,
@@ -3081,11 +3069,6 @@
goto exit;
 
/*
-* Initialize cofniguration work.
-*/
-   INIT_WORK(rt2x00dev-config_work, rt2500pci_config_update, rt2x00dev);
-
-   /*
 * Reset current working type.
 */
rt2x00dev-interface.type = -EINVAL;
diff -rU3 
wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 
wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00-pci/drivers/net/wireless/d80211/rt2x00/rt2500usb.c  
2006-08-08 14:18:32.0 +0200
+++ wireless-dev-rt2x00-config/drivers/net/wireless/d80211/rt2x00/rt2500usb.c   
2006-08-08 14:45:02.0 +0200
@@ -1912,12 +1912,10 @@
rt2500usb_disable_radio(rt2x00dev);
 }
 
-static void rt2500usb_config_update(void *data)
+static int rt2500usb_config(struct net_device *net_dev,
+   struct ieee80211_conf *conf)
 {
-   struct rt2x00_dev *rt2x00dev = data;
-   

bonding questions: replaying call to set_multicast_list and sending IGMP doing Fail-Over

2006-08-08 Thread Or Gerlitz
Another question that bothers me is the bonding code multicast related 
behavior when it does fail-over.


From what I see in bond_mc_swap(), set_multicast_list() is well 
handled: dev_mc_delete() is called for the old slave (so if in the 
future the old slave has a link, it will leave the multicast group) and 
dev_mc_add() is called for the active slave (so the active slave joins 
the multicast group).


As for sending IGMP, in bond_xmit_activebackup() i see the following 
comment: Xmit IGMP frames on all slaves to ensure rapid fail-over

for multicast traffic on snooping switches.

As i don't see any buffering of the IGMP packets, i understand there's 
no reply of sending them during fail-over and this means that only 
when the router would do IGMP query on this node it will learn on the 
fail-over. Is it indeed what's going on? if i understand correct it 
would take some meaningful time for the fail-over to be externally 
visible in this respect.


Also assuming it does exactly what the comment says, another issue i see 
here is that in the case of not only the active_slave being UP, the code 
would TX the IGMP packets over  1 slave, and hence multicast packets 
would be sent by the switch also to ports connected to non-active 
slaves, something which will hurt the system performance!?


Or.









-
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 -rt DO NOT APPLY] Fix for tg3 networking lockup

2006-08-08 Thread Steven Rostedt

On Tue, 8 Aug 2006, Steven Rostedt wrote:


 On Sun, 6 Aug 2006, David Miller wrote:

  From: Steven Rostedt [EMAIL PROTECTED]
  Date: Mon, 7 Aug 2006 01:34:56 -0400 (EDT)
 
   My suggestion would be to separate that tg3_timer into 4 different
   timers, which is what it actually looks like.
 
  Timers have non-trivial cost.  It's cheaper to have one and
  vector off to the necessary operations each tick internalls.
 
  That's why it's implemented as one timer.
 

 hrtimers don't have the cost of a normal timer. And that's why I suggested
 to convert them.  There's a much bigger cost in a single timer that always
 times out than 3 hrtimers.  hrtimers are expected to timeout, but timers
 are not.

 Of the 4 timers, only one is a timeout. The other three expire every time,
 forcing the timer wheel into effect.  Even though it's one timer
 implementing 4, it's expensive to use it as a watchdog.

I just got a chance to look a little more deeper at what the tg3 timer is
doing, and I was wrong.  The timeout is not a timeout but some messing
around when the network card doesn't use tagged status (whatever that is).
Which just pushes the point that this should _not_ be a timer, but a
hrtimer (expected to expire).

So you can keep this as one timer, but I would still switch it to a
hrtimer regardless, since it is expected to timeout.  (maybe separate out
the ASF if that still needs to be special?).

Ted,

I don't know what the max latency of that timer is, (I'm sure it wouldn't
be too hard to measuer, just add some timings around the timer handler,
let it run for a while and keep account of the max time).  But, since the
user that opens this network card is the one that initializes the timer,
if you simply switch the timer to be a hrtimer (that should also go in
mainline) and then have a really high prio task start up the network, that
timer would then run at the prio of the task that started the network.


-- Steve

-
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/3] ppc32: board-specific part of fs_enet update

2006-08-08 Thread Vitaly Bordug
Jeff,

This is the same as previous, but with a number of indentation issues addressed
in arch/ppc/platforms/mpc*. I think it makes sense to do it right now, since 
all the files are touched
anyway. Haven't noticed before, sorry about that. Please find the patch inlined 
below.


This contains board-specific portion to respect driver changes (for 8272ads
, 885ads and 866ads). Altered platform_data structures as well as initial
setup routines relevant to fs_enet.

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]
---

 arch/ppc/platforms/85xx/mpc8560_ads.c|   89 
 arch/ppc/platforms/85xx/mpc85xx_ads_common.h |   19 +++
 arch/ppc/platforms/mpc8272ads_setup.c|  154 -
 arch/ppc/platforms/mpc866ads_setup.c |  192 +-
 arch/ppc/platforms/mpc885ads_setup.c |  175 +---
 arch/ppc/platforms/pq2ads_pd.h   |   82 ---
 arch/ppc/syslib/mpc85xx_devices.c|   89 
 arch/ppc/syslib/mpc8xx_devices.c |8 +
 arch/ppc/syslib/mpc8xx_sys.c |6 +
 arch/ppc/syslib/pq2_devices.c|5 +
 arch/ppc/syslib/pq2_sys.c|3 
 include/asm-ppc/cpm2.h   |   95 +
 include/asm-ppc/mpc8260.h|1 
 include/asm-ppc/mpc8xx.h |1 
 include/linux/fs_enet_pd.h   |   50 +++
 15 files changed, 578 insertions(+), 391 deletions(-)

diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c 
b/arch/ppc/platforms/85xx/mpc8560_ads.c
index d90cd24..94badaf 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -29,6 +29,7 @@ #include linux/serial_core.h
 #include linux/initrd.h
 #include linux/module.h
 #include linux/fsl_devices.h
+#include linux/fs_enet_pd.h
 
 #include asm/system.h
 #include asm/pgtable.h
@@ -58,6 +59,71 @@ #include syslib/ppc85xx_setup.h
  * Setup the architecture
  *
  */
+static void init_fcc_ioports(void)
+{
+   struct immap *immap;
+   struct io_port *io;
+   u32 tempval;
+
+   immap = cpm2_immr;
+
+   io = immap-im_ioport;
+   /* FCC2/3 are on the ports B/C. */
+   tempval = in_be32(io-iop_pdirb);
+   tempval = ~PB2_DIRB0;
+   tempval |= PB2_DIRB1;
+   out_be32(io-iop_pdirb, tempval);
+
+   tempval = in_be32(io-iop_psorb);
+   tempval = ~PB2_PSORB0;
+   tempval |= PB2_PSORB1;
+   out_be32(io-iop_psorb, tempval);
+
+   tempval = in_be32(io-iop_pparb);
+   tempval |= (PB2_DIRB0 | PB2_DIRB1);
+   out_be32(io-iop_pparb, tempval);
+
+   tempval = in_be32(io-iop_pdirb);
+   tempval = ~PB3_DIRB0;
+   tempval |= PB3_DIRB1;
+   out_be32(io-iop_pdirb, tempval);
+
+   tempval = in_be32(io-iop_psorb);
+   tempval = ~PB3_PSORB0;
+   tempval |= PB3_PSORB1;
+   out_be32(io-iop_psorb, tempval);
+
+   tempval = in_be32(io-iop_pparb);
+   tempval |= (PB3_DIRB0 | PB3_DIRB1);
+   out_be32(io-iop_pparb, tempval);
+
+tempval = in_be32(io-iop_pdirc);
+tempval |= PC3_DIRC1;
+out_be32(io-iop_pdirc, tempval);
+
+tempval = in_be32(io-iop_pparc);
+tempval |= PC3_DIRC1;
+out_be32(io-iop_pparc, tempval);
+
+   /* Port C has clocks..  */
+   tempval = in_be32(io-iop_psorc);
+   tempval = ~(CLK_TRX);
+   out_be32(io-iop_psorc, tempval);
+
+   tempval = in_be32(io-iop_pdirc);
+   tempval = ~(CLK_TRX);
+   out_be32(io-iop_pdirc, tempval);
+   tempval = in_be32(io-iop_pparc);
+   tempval |= (CLK_TRX);
+   out_be32(io-iop_pparc, tempval);
+
+   /* Configure Serial Interface clock routing.
+* First,  clear all FCC bits to zero,
+* then set the ones we want.
+*/
+   immap-im_cpmux.cmx_fcr = ~(CPMUX_CLK_MASK);
+   immap-im_cpmux.cmx_fcr |= CPMUX_CLK_ROUTE;
+}
 
 static void __init
 mpc8560ads_setup_arch(void)
@@ -66,6 +132,7 @@ mpc8560ads_setup_arch(void)
unsigned int freq;
struct gianfar_platform_data *pdata;
struct gianfar_mdio_data *mdata;
+   struct fs_platform_info *fpi;
 
cpm2_reset();
 
@@ -110,6 +177,28 @@ #endif
memcpy(pdata-mac_addr, binfo-bi_enet1addr, 6);
}
 
+   init_fcc_ioports();
+   ppc_sys_device_remove(MPC85xx_CPM_FCC1);
+
+   fpi = (struct fs_platform_info *) ppc_sys_get_pdata(MPC85xx_CPM_FCC2);
+   if (fpi) {
+   memcpy(fpi-macaddr, binfo-bi_enet2addr, 6);
+   fpi-bus_id = 0:02;
+   fpi-phy_addr = 2;
+   fpi-dpram_offset = (u32)cpm2_immr-im_dprambase;
+   fpi-fcc_regs_c = (u32)cpm2_immr-im_fcc_c[1];
+   }
+
+   fpi = (struct fs_platform_info *) ppc_sys_get_pdata(MPC85xx_CPM_FCC3);
+   if (fpi) {
+   memcpy(fpi-macaddr, binfo-bi_enet2addr, 6);
+   fpi-macaddr[5] += 1;
+   fpi-bus_id = 0:03;
+ 

[PATCH 0/2] crc-itu-t

2006-08-08 Thread Ivo van Doorn
Hi,

These patches are for wireless-dev
and will add a crc-itu-t implementation to the lib/ directory.
Some drivers are currently using there own version
of this crc routine so there could be usefull to add
this to lib/

The second patch is to make rt2x00 use this crc-itu-t library
and removes its own version of the crc check.

Ivo
-
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 2/2] crc-itu-t - rt2x00 should use crc-itu-t

2006-08-08 Thread Ivo van Doorn
Now crc-itu-t is available rt2x00 should use that implementation
instead of its own private version.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rNU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/Kconfig 
wireless-dev-rt2x00-crc/drivers/net/wireless/d80211/rt2x00/Kconfig
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/Kconfig  
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-crc/drivers/net/wireless/d80211/rt2x00/Kconfig  
2006-08-08 15:53:50.0 +0200
@@ -56,6 +56,7 @@
 config RT61PCI
tristate Ralink rt61 pci/pcmcia support
depends on RT2X00  FW_LOADER  PCI
+   select CRC_ITU_T
---help---
This is an experimental driver for the Ralink rt61 wireless chip.
 
@@ -93,6 +94,7 @@
 config RT73USB
tristate Ralink rt73 usb support
depends on RT2X00  FW_LOADER  USB
+   select CRC_ITU_T
---help---
This is an experimental driver for the Ralink rt73 wireless chip.
 
diff -rNU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00crc.h 
wireless-dev-rt2x00-crc/drivers/net/wireless/d80211/rt2x00/rt2x00crc.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00crc.h  
2006-08-01 19:30:38.0 +0200
+++ wireless-dev-rt2x00-crc/drivers/net/wireless/d80211/rt2x00/rt2x00crc.h  
1970-01-01 01:00:00.0 +0100
@@ -1,82 +0,0 @@
-/*
-   Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
-   http://rt2x00.serialmonkey.com
-
-   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.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/*
-   Module: rt2x00
-   Abstract: rt2x00 CRC implementation for firmware validation.
-   Supported chipsets: rt2561, rt2561s, rt2661  rt2573
- */
-
-#ifndef RT2X00CRC_H
-#define RT2X00CRC_H
-
-static const u16 rt2x00crc_table[256] = {
-   0x, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
-   0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
-   0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
-   0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
-   0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
-   0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
-   0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
-   0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
-   0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
-   0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
-   0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
-   0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
-   0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
-   0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
-   0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
-   0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
-   0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
-   0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
-   0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
-   0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
-   0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
-   0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
-   0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
-   0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
-   0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
-   0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
-   0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
-   0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
-   0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
-   0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
-   0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
-   0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
-};
-
-static inline u16
-rt2x00crc_byte(u16 crc, const u8 data)
-{
-   return (crc  8) ^ rt2x00crc_table[((crc  8) ^ data)  0xff];
-}
-
-/*
- * Compute the rt2x00 

[PATCH 1/2] crc-itu-t - Add crc-itu-t lib/

2006-08-08 Thread Ivo van Doorn
Add the CRC-ITU-T implementation to lib/

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff --git a/include/linux/crc-itu-t.h b/include/linux/crc-itu-t.h
new file mode 100644
index 000..3e6d80c
--- /dev/null
+++ b/include/linux/crc-itu-t.h
@@ -0,0 +1,27 @@
+/*
+ * crc-itu-t.h - CRC ITU-T V.41 routine
+ *
+ * Implements the standard CRC ITU-T V.41:
+ *   Width 16
+ *   Poly  0x1021 (x^16 + x^12 + x^15 + 1)
+ *   Init  0
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+ */
+
+#ifndef CRC_ITU_T_H
+#define CRC_ITU_T_H
+
+#include linux/types.h
+
+extern u16 const crc_itu_t_table[256];
+
+extern u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len);
+
+static inline u16 crc_itu_t_byte(u16 crc, const u8 data)
+{
+   return (crc  8) ^ crc_itu_t_table[((crc  8) ^ data)  0xff];
+}
+
+#endif /* CRC_ITU_T_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index f629934..2d40a4d 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -20,6 +20,14 @@ config CRC16
  the kernel tree does. Such modules that use library CRC16
  functions require M here.
 
+config CRC_ITU_T
+   tristate CRC ITU-T V.41 functions
+   help
+ This option is provided for the case where no in-kernel-tree
+ modules require CRC ITU-T V.41 functions, but a module built outside
+ the kernel tree does. Such modules that use library CRC ITU-T V.41
+ functions require M here.
+
 config CRC32
tristate CRC32 functions
default y
diff --git a/lib/Makefile b/lib/Makefile
index be9719a..80986ef 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -35,6 +35,7 @@ endif
 
 obj-$(CONFIG_CRC_CCITT)+= crc-ccitt.o
 obj-$(CONFIG_CRC16)+= crc16.o
+obj-$(CONFIG_CRC_ITU_T)+= crc-itu-t.o
 obj-$(CONFIG_CRC32)+= crc32.o
 obj-$(CONFIG_LIBCRC32C)+= libcrc32c.o
 obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
diff --git a/lib/crc-itu-t.c b/lib/crc-itu-t.c
new file mode 100644
index 000..0ca977c
--- /dev/null
+++ b/lib/crc-itu-t.c
@@ -0,0 +1,64 @@
+/*
+ * crc-itu-t.c
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+ */
+
+#include linux/types.h
+#include linux/module.h
+#include linux/crc-itu-t.h
+
+/** CRC table for the CRC ITU-T V.41 0x0x1021 (x^16 + x^12 + x^15 + 1) */
+const u16 crc_itu_t_table[256] = {
+   0x, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+   0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+   0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+   0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+   0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+   0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+   0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+   0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+   0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+   0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+   0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+   0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+   0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+   0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+   0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+   0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+   0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+   0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+   0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+   0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+   0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+   0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+   0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+   0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+   0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+   0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+   0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+   0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+   0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+   0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+   0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+   0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
+};
+EXPORT_SYMBOL(crc_itu_t_table);
+
+/**
+ * crc_itu_t - Compute the CRC-ITU-T for the data buffer
+ * @crc: previous CRC value
+ * @buffer: data pointer
+ * @len: number of bytes in the buffer
+ */
+u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len)
+{

Re: pci=routeirq solves EHCI-problem

2006-08-08 Thread Lutz Urban

Hello,

I'm sorry to tell you that my previous message was bogus. The problem 
still persists.


Sorry to have bothered you.

Regards,
Lutz Urban


Lutz Urban schrieb:

Hello,

I got your email-addresses from my /var/log/boot.msg.

The kernel switch 'pci=routeirq' solved the following problem:

Setup:
- VIA KT880 mainboard with a Geode-CPU
- SUSE Linux 10.0, kernel 2.6.13-15-default
- USB-mass storage device (2.5' Samsung disk, chipset can presumably be 
identified if needed)


Booting WITHOUT 'pci=routeirq':
- When the USB-disk had been connected BEFORE booting, the device would 
freeze upon loading ehci-hcd and usb-storage. usb-storage would be 
unable to read the partion table.
- After physically disconnecting and reconnecting the device everything 
would be fine.

- This problem would not occur with uhci-hcd instead of ehci-hcd.

Booting WITH 'pci=routeirq':
- Everything works fine also when the USB-disk was connected BEFORE boot.

I enclose the output of 'lspci -bvv' (booted with 'pci=routeirq') as a 
text file. If you want further info, I'm very willing to help. (I have 
benefitted a lot from the work of the Open Source Community and given 
very little back)


Kind regards,
Lutz Urban, Germany

phone: +49-208-4459550





00:00.0 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort+ SERR- PERR-
Latency: 8
Region 0: Memory at e000 (32-bit, prefetchable)
Capabilities: [80] AGP version 3.5
Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 
64bit- FW- AGP3- Rate=x4
Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- 
Rate=none
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:00.1 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0

00:00.2 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0

00:00.3 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0

00:00.4 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0

00:00.7 Host bridge: VIA Technologies, Inc. KT880 Host Bridge
Subsystem: VIA Technologies, Inc. KT880 Host Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0

00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge (prog-if 00 
[Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
Memory behind bridge: fca0-feaf
Prefetchable memory behind bridge: bff0-cfef
Secondary status: 66MHz+ FastB2B- ParErr- DEVSEL=medium TAbort- TAbort- 
MAbort+ SERR- PERR-
BridgeCtl: Parity+ SERR+ NoISA- VGA+ MAbort- Reset- FastB2B-
Capabilities: [70] Power Management version 2
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:06.0 Network controller: AVM Audiovisuelles MKTG  Computer System GmbH A1 
ISDN [Fritz] (rev 02)
Subsystem: AVM Audiovisuelles MKTG  Computer System GmbH FRITZ!Card 
ISDN Controller
Control: I/O+ Mem+ BusMaster- SpecCycle- 

[PATCH 2/2] rfkill - rt2x00 should use rfkill

2006-08-08 Thread Ivo van Doorn
Now rfkill is available rt2x00 should make use of it let
the hardware button status be periodically probed by rfkill.
This makes the ACPI implementation as done in rt2x00 no longer required.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff -rNU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/Kconfig 
wireless-dev-rt2x00-rfkill/drivers/net/wireless/d80211/rt2x00/Kconfig
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/Kconfig  
2006-08-08 16:09:13.0 +0200
+++ wireless-dev-rt2x00-rfkill/drivers/net/wireless/d80211/rt2x00/Kconfig   
2006-08-08 16:03:41.0 +0200
@@ -17,12 +17,12 @@
 
 config RT2400PCI_BUTTON
bool Ralink rt2400 hardware button support
-   depends on RT2400PCI  X86
+   depends on RT2400PCI  RFKILL
---help---
In some notebooks the rt2400 chipset is integrated in the machine,
-   with this option enabled the device will periodically poll the
-   the status of this button and will send and ACPI event when
-   the button has been pressed.
+   with this option enabled the driver will register itself to the
+   rfkill driver for periodical polling of the hardware button
+   status, and the correct handling of button press events.
 
 config RT2400PCI_DEBUG
bool Ralink rt2400 debug output
@@ -40,12 +40,12 @@
 
 config RT2500PCI_BUTTON
bool Ralink rt2500 hardware button support
-   depends on RT2500PCI  X86
+   depends on RT2500PCI  RFKILL
---help---
In some notebooks the rt2500 chipset is integrated in the machine,
-   with this option enabled the device will periodically poll the
-   the status of this button and will send and ACPI event when
-   the button has been pressed.
+   with this option enabled the driver will register itself to the
+   rfkill driver for periodical polling of the hardware button
+   status, and the correct handling of button press events.
 
 config RT2500PCI_DEBUG
bool Ralink rt2500 debug output
@@ -64,12 +64,12 @@
 
 config RT61PCI_BUTTON
bool Ralink rt61 hardware button support
-   depends on RT61PCI  X86
+   depends on RT61PCI  RFKILL
---help---
In some notebooks the rt61 chipset is integrated in the machine,
-   with this option enabled the device will periodically poll the
-   the status of this button and will send and ACPI event when
-   the button has been pressed.
+   with this option enabled the driver will register itself to the
+   rfkill driver for periodical polling of the hardware button
+   status, and the correct handling of button press events.
 
 config RT61PCI_DEBUG
bool Ralink rt61 debug output
diff -rNU3 wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
wireless-dev-rt2x00-rfkill/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c  
2006-08-08 16:09:02.0 +0200
+++ wireless-dev-rt2x00-rfkill/drivers/net/wireless/d80211/rt2x00/rt2400pci.c   
2006-08-08 16:00:28.0 +0200
@@ -346,23 +346,6 @@
rt2x00_eeprom_read(rt2x00dev, word + i, data++);
 }
 
-#ifdef CONFIG_RT2400PCI_BUTTON
-/*
- * Hardware button poll handler.
- */
-static void rt2400pci_button_poll(unsigned long data)
-{
-   struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev*)data;
-   u32 reg;
-
-   rt2x00_register_read(rt2x00dev, GPIOCSR, reg);
-   rt2x00pci_button_status(
-   rt2x00dev, rt2x00_get_field32(reg, GPIOCSR_BIT0));
-}
-#else /* CONFIG_RT2400PCI_BUTTON */
-static void rt2400pci_button_poll(unsigned long data){}
-#endif /* CONFIG_RT2400PCI_BUTTON */
-
 /*
  * Ethtool handlers.
  */
@@ -437,6 +420,60 @@
.get_perm_addr  = ethtool_op_get_perm_addr,
 };
 
+#ifdef CONFIG_RT2400PCI_BUTTON
+static int rt2400pci_button_poll(unsigned long data)
+{
+   struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev*)data;
+   u32 reg;
+
+   rt2x00_register_read(rt2x00dev, GPIOCSR, reg);
+   return rt2x00_get_field32(reg, GPIOCSR_BIT0);
+}
+
+static void rt2400pci_button_enable_radio(unsigned long data)
+{
+   rt2400pci_enable_radio((struct rt2x00_dev*)data);
+}
+
+static void rt2400pci_button_disable_radio(unsigned long data)
+{
+   rt2400pci_disable_radio((struct rt2x00_dev*)data);
+}
+
+static void rt2400pci_button_start(struct rt2x00_dev *rt2x00dev)
+{
+   struct rfkill *rfkill = rt2x00dev-rfkill;
+
+   /*
+* Only start the button polling when
+* the hardware button is present.
+*/
+   if (!GET_FLAG(rt2x00dev, DEVICE_SUPPORT_HW_BUTTON))
+   return;
+
+   rfkill-dev_name= rt2400pci;
+   rfkill-data= (unsigned long)rt2x00dev;
+   rfkill-poll= rt2400pci_button_poll;
+   rfkill-enable_radio= rt2400pci_button_enable_radio;
+   rfkill-disable_radio   = rt2400pci_button_disable_radio;
+   

[PATCH 1/2] rfkill - Add rfkill driver to misc input devices

2006-08-08 Thread Ivo van Doorn
This will add the rfkill driver to the input/misc section of the kernel.
rfkill is usefull for newtwork devices that contain a hardware button
to enable or disable the radio.
With rfkill a generic interface is created for the network drivers,
as well as providing a  uniform way for userspace to listen
to the hardware button events.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index a6dfc74..ac10c02 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -79,4 +79,19 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config RFKILL
+   tristate RF button support
+   help
+ If you say yes here, the rfkill driver will be build
+ which allowed network devices to register their hardware
+ RF button which controls the radio state. This driver
+ will then create an input device for it.
+
+ When the input device is not used, the rfkill driver
+ will make sure that when the RF button is pressed the radio
+ is enabled or disabled accordingly. When the input device
+ has been opened by the user this radio control will be left
+ to the user, and rfkill will only send the RF button status
+ change to userspace.
+
 endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 415c491..e788a1b 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_INPUT_UINPUT)+= uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_RFKILL)   += rfkill.o
diff --git a/drivers/input/misc/rfkill.c b/drivers/input/misc/rfkill.c
new file mode 100644
index 000..5fbe320
--- /dev/null
+++ b/drivers/input/misc/rfkill.c
@@ -0,0 +1,210 @@
+/*
+   Copyright (C) 2006 Ivo van Doorn
+
+   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.,
+   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/timer.h
+#include linux/rfkill.h
+
+#include asm/atomic.h
+
+MODULE_AUTHOR(Ivo van Doorn [EMAIL PROTECTED]);
+MODULE_VERSION(1.0);
+MODULE_DESCRIPTION(RF button support);
+MODULE_LICENSE(GPL);
+
+/*
+ * List of all registered buttons.
+ */
+static struct list_head rfkill_list;
+static spinlock_t rfkill_list_lock;
+
+/*
+ * Polling timer, poll_delay and use count.
+ */
+static struct timer_list poll_timer;
+static atomic_t poll_required;
+
+static void rfkill_toggle_radio(int new_status)
+{
+   struct list_head *entry;
+   struct rfkill *rfkill;
+
+   /*
+* Go through the list of all radio's to toggle the radio state.
+*/
+   list_for_each(entry, rfkill_list) {
+   rfkill =  list_entry(entry, struct rfkill, entry);
+
+   rfkill-current_status = new_status;
+
+   /*
+* If the input_device has been opened
+* all radio events should be send to user space.
+*/
+   if (rfkill-input_dev-users) {
+   input_report_key(rfkill-input_dev,
+   KEY_RFKILL, new_status);
+   input_sync(rfkill-input_dev);
+   continue;
+   }
+
+   /*
+* If the hardware does not toggle the radio status automaticly,
+* we should take care of it.
+*/
+   if (new_status  rfkill-enable_radio)
+   rfkill-enable_radio(rfkill-data);
+   else if (!new_status  rfkill-disable_radio)
+   rfkill-disable_radio(rfkill-data);
+   }
+}
+
+static void rfkill_poll_button(unsigned long data)
+{
+   struct list_head *entry;
+   struct rfkill *rfkill;
+   int status;
+
+   spin_lock(rfkill_list_lock);
+
+   list_for_each(entry, rfkill_list) {
+   rfkill =  list_entry(entry, struct rfkill, entry);
+
+   if (!rfkill-poll)
+   continue;
+
+   

[PATCH 0/2] rfkill

2006-08-08 Thread Ivo van Doorn
Hi,

With the previous Request for comments for rfkill it seemed
most people did not have any objectiosn against rfkill.
So now I wish to submit rfkill to wireless-dev. :)

First patch will add rfkill to input/misc/ while the second
patch will make rt2x00 use rfkill.

Ivo
-
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: 802.11/crypto questions

2006-08-08 Thread Jouni Malinen
On Tue, Aug 08, 2006 at 01:35:22PM +0200, Johannes Berg wrote:
 Jouni Malinen wrote:
 Depends on what exactly you mean with on the fly. We have indeed
 changed between doing software and hardware crypto for some cases, e.g.,
 when enabling another BSS while one BSS is using static WEP (which would
 need default WEP keys in hwaccel) in one BSS, we may disable hwaccel for
 the receive case. 

 Also, if we add a monitor if, does it disable hw crypto so we can see 
 the undecrypted frames?

I haven't looked at the current implementation (if this has been
modified), but it would be nice to have an option for doing this. This
gets a bit complex, but if having such an option is not going to slow
down the normal case (i.e., monitor mode disabled), being able to select
whether frames are decrypted in monitor interface could be useful. This
would, of course, require that hwaccel is disabled for normal data
packets when this kind of mode is enabled.

Because of quite large CPU load difference, I would expect there to be
valid use cases for both allowing hardware to continue decrypting frames
(and monitor interface would show whatever was received from hardware,
i.e., some frames may be decrypted, some not based on whether a key was
configured) and stopping hardware acceleration and delivering unmodified
frames into the monitor interface (and if a normal data connection is
active at the same time, doing software decryption for frames before
they are delivered to data interface).

-- 
Jouni MalinenPGP id EFC895FA
-
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: 802.11/crypto questions

2006-08-08 Thread Ivo van Doorn
On Tuesday 08 August 2006 17:57, Jouni Malinen wrote:
 On Tue, Aug 08, 2006 at 01:35:22PM +0200, Johannes Berg wrote:
  Jouni Malinen wrote:
  Depends on what exactly you mean with on the fly. We have indeed
  changed between doing software and hardware crypto for some cases, e.g.,
  when enabling another BSS while one BSS is using static WEP (which would
  need default WEP keys in hwaccel) in one BSS, we may disable hwaccel for
  the receive case. 
 
  Also, if we add a monitor if, does it disable hw crypto so we can see 
  the undecrypted frames?
 
 I haven't looked at the current implementation (if this has been
 modified), but it would be nice to have an option for doing this. This
 gets a bit complex, but if having such an option is not going to slow
 down the normal case (i.e., monitor mode disabled), being able to select
 whether frames are decrypted in monitor interface could be useful. This
 would, of course, require that hwaccel is disabled for normal data
 packets when this kind of mode is enabled.
 
 Because of quite large CPU load difference, I would expect there to be
 valid use cases for both allowing hardware to continue decrypting frames
 (and monitor interface would show whatever was received from hardware,
 i.e., some frames may be decrypted, some not based on whether a key was
 configured) and stopping hardware acceleration and delivering unmodified
 frames into the monitor interface (and if a normal data connection is
 active at the same time, doing software decryption for frames before
 they are delivered to data interface).

Would also depend on the hardware itself I would think.
Looking at the Legacy drivers from Ralink code for hardware encryption
it would be quite possible for having hardware decryption enabled
while also working in monitor mode. This is because the driver
will first receive the encrypted frame (at this time the driver could pass
it to the monitor interface) and then  signals the hardware encryption
machine to encrypt the frame after which the unencrypted frame can go through
the normal RX handling routines.
Only downside here, is that the receiving in this case should be specifically 
be done
to the monitor interface otherwise all frames would be send to the ieee80211 rx 
handler twice.

Note however that this is currently not possible with rt2x00 since that
has not yet implemented hardware encryption.

Ivo
-
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.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Jeremy Fitzhardinge

Arjan van de Ven wrote:
and you're also sure this is not your userspace using interface 
renaming...

(could be an initscripts bug for name-by-MAC ethernet device naming)


It's definitely in-kernel, since its specific to this version.  And it 
seems to have gone away since I turned on slab debugging.


   J
-
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.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Arjan van de Ven

Jeremy Fitzhardinge wrote:

Andrew Morton wrote:

e1000 seems OK here.  Don't know, sorry.
  


It's happening to all my ethernet-like devices: the Atheros wireless 
comes up as a mess too.  It's different each time, so it looks like 
random uninitialized crud.




is this the binary atheros driver? then please try without that..
-
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.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Arjan van de Ven

Jeremy Fitzhardinge wrote:

Arjan van de Ven wrote:

Jeremy Fitzhardinge wrote:

Andrew Morton wrote:

e1000 seems OK here.  Don't know, sorry.
  


It's happening to all my ethernet-like devices: the Atheros wireless 
comes up as a mess too.  It's different each time, so it looks like 
random uninitialized crud.




is this the binary atheros driver? then please try without that.. 


It happens regardless of whether the atheros driver is loaded (or has 
ever been loaded).  But it also happens to the atheros driver, so it 
isn't specific to the e1000.




and you're also sure this is not your userspace using interface renaming...
(could be an initscripts bug for name-by-MAC ethernet device naming)
-
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.18-rc3-mm2: bad e1000 device name

2006-08-08 Thread Jeremy Fitzhardinge

Arjan van de Ven wrote:

Jeremy Fitzhardinge wrote:

Andrew Morton wrote:

e1000 seems OK here.  Don't know, sorry.
  


It's happening to all my ethernet-like devices: the Atheros wireless 
comes up as a mess too.  It's different each time, so it looks like 
random uninitialized crud.




is this the binary atheros driver? then please try without that.. 


It happens regardless of whether the atheros driver is loaded (or has 
ever been loaded).  But it also happens to the atheros driver, so it 
isn't specific to the e1000.


   J
-
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] llc: SOCK_DGRAM interface fixes

2006-08-08 Thread Alexey Kuznetsov
Hello!

 This fix goes against the old historical comments about UNIX98 semantics
 but without this fix SOCK_DGRAM is broken and useless. So either ANK's
 interpretation was incorect or UNIX98 standard was wrong.

Just found this reference to me. :-)

The comment migrated from tcp.c. It is only about connected SOCK_STREAM
sockets, I do not see how it can make SOCK_DGRAM broken or useless.

That UNIX98 statement allowed to avoid expensive callback to protocol
specific setup of address in tcp_recvmsg().

Alexey
-
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: Stackable devices.

2006-08-08 Thread Ben Greear

Christophe Devriese wrote:

On Wed, Aug 02, 2006 at 10:50:08AM -0700, Ben Greear wrote:


Currently, the bridge hook logic is something like:

if (bridge-consumed-pkt) {
return
}

// drop through to other layers


There are several other hooks I'd like to see added (pktgen receive 
processing,
mac-vlans, etc).  Each of these hooks are logically similar to the bridge 
hook,
ie if it consumes the pkt, return, else, drop through to the next hook 
untill

we get to the regular protocol processing logic.

I would like to be able to chain layer-2 handlers, such as bridge, mac-vlan,
pktgen such that if one consumed, you break out of the handling, else, you
try the next handler.  The handlers can be dynamically registered and 
inserted

in any order, controllable by user-space and/or module load/unload.

For many of the handlers, the logic will re-insert the packet by re-calling 
the

netif-rx logic, so there would need to be some protection to keep loops from
occurring that would recurse too much and overflow the stack.



I'm also a big fan of a generalized system like this. It would need to
catch both the vlan accelerated path and the normal path.


Well, it isn't actually needed for VLANs since VLAN's hook is a protocol
handler

Ben

--
Ben Greear [EMAIL PROTECTED]
Candela Technologies Inc  http://www.candelatech.com

-
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] llc: SOCK_DGRAM interface fixes

2006-08-08 Thread Stephen Hemminger
On Tue, 8 Aug 2006 20:36:18 +0400
Alexey Kuznetsov [EMAIL PROTECTED] wrote:

 Hello!
 
  This fix goes against the old historical comments about UNIX98 semantics
  but without this fix SOCK_DGRAM is broken and useless. So either ANK's
  interpretation was incorect or UNIX98 standard was wrong.
 
 Just found this reference to me. :-)
 
 The comment migrated from tcp.c. It is only about connected SOCK_STREAM
 sockets, I do not see how it can make SOCK_DGRAM broken or useless.

The code was in the place where the source information was being copied
from the data portion to the cb portion of the skb. The original code
did the save only for SOCK_STREAM.
The cb portion is needed later to produce the address portion of the
receive handling which is critical with SOCK_DGRAM in LLC.

 That UNIX98 statement allowed to avoid expensive callback to protocol
 specific setup of address in tcp_recvmsg().

So the comment made sense for TCP but not LLC.


-- 
-
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] [e1000]: Remove unnecessary tx_lock

2006-08-08 Thread Benjamin LaHaise
On Fri, Aug 04, 2006 at 04:31:11PM -0700, David Miller wrote:
 Yes, it's meant to catch unintented races.
 
 The queueing layer that calls -hard_start_xmit() technically has no
 need to support NETDEV_TX_BUSY as a return value, since the device
 is able to prevent this.
 
 If we could avoid NETDEV_TX_BUSY et al. from happening, the idea is
 that we could eliminate all of the requeueing logic in the packet
 scheduler layer.  It is a pipe dream from many years ago.

Maybe the way NETDEV_TX_BUSY is implemented is wrong -- that is, it should 
be possible to return a result saying we sent the packet, but the queue is 
now full.  That would eliminate the atomic op that netif_queue_stop() 
performs and allow higher layers to merge the necessary barrier on the full 
case with the op on the tx lock.  That way we could have lockless queue 
handling within the driver.  This might need start/stop sequence counters, 
though.

-ben
-- 
Time is of no importance, Mr. President, only life is important.
Don't Email: [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: bonding questions: replaying call to set_multicast_list and sending IGMP doing Fail-Over

2006-08-08 Thread Jay Vosburgh
Or Gerlitz [EMAIL PROTECTED] wrote:
[...]
As i don't see any buffering of the IGMP packets, i understand there's no
reply of sending them during fail-over and this means that only when the
router would do IGMP query on this node it will learn on the fail-over. Is
it indeed what's going on? if i understand correct it would take some
meaningful time for the fail-over to be externally visible in this respect.

As I recall, the intent is to keep switches up to date all the
time, so that there is no delay during a failover.  I.e., at every IGMP
query, the switch is answered on all possible ports.

Also assuming it does exactly what the comment says, another issue i see
here is that in the case of not only the active_slave being UP, the code
would TX the IGMP packets over  1 slave, and hence multicast packets
would be sent by the switch also to ports connected to non-active
slaves, something which will hurt the system performance!?

I haven't studied the effects of having large amounts of
multicast traffic coming in under this situation.

However, I would suspect that the MAC filters found on
sufficiently modern network adapters would drop the incoming multicast
traffic on the backup slaves, as only the active slave in active-backup
mode has its multicast list set.  That information is sent to a slave
when it becomes the active slave; see the call to bond_mc_swap() made by
bond_change_active_slave().

-J

---
-Jay Vosburgh, IBM Linux Technology Center, [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 RESEND 2/2] update sunrpc to use in-kernel sockets API

2006-08-08 Thread Sridhar Samudrala
On Mon, 2006-08-07 at 20:59 -0700, David Miller wrote:
 From: Sridhar Samudrala [EMAIL PROTECTED]
 Date: Mon, 07 Aug 2006 16:00:32 -0700
 
  Update sunrpc to use in-kernel sockets API.
  
  Signed-off-by: Sridhar Samudrala [EMAIL PROTECTED]
  Acked-by: James Morris [EMAIL PROTECTED]
 
 Applied, thanks.
 
  @@ -207,7 +207,7 @@ static inline int xs_sendpages(struct so
  base = ~PAGE_CACHE_MASK;
  }
   
  -   sendpage = sock-ops-sendpage ? : sock_no_sendpage;
  +   sendpage = kernel_sendpage;
  do {
  int flags = XS_SENDMSG_FLAGS;
   
 
 Seemingly this chunk could be simplified further, by
 just invoking kernel_sendpage() directly?

We cannot do this as xs_sendpages() doesn't like to use sendpage()
with highmem pages and has the following check before making the
actual call.
/* Hmm... We might be dealing with highmem pages */
if (PageHighMem(*ppage))
sendpage = sock_no_sendpage;
err = sendpage(sock, *ppage, base, len, flags);

Thanks
Sridhar


-
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: Fwd: [PATCH] ethtool v4: add full autoneg specify feature]

2006-08-08 Thread Auke Kok


I figured that the word ad ver tise must throw off the spam filter,
so I hope this gets through now that I've removed it from the subject.

Note this is an ethtool patch, not a kernel one :)

Cheers,

Auke

-- Forwarded message --
From: Jeff Kirsher [EMAIL PROTECTED]
Date: Aug 7, 2006 9:53 PM
Subject: [PATCH] ethtool v4: add autoneg - feature
To: netdev@vger.kernel.org


adds the ability to change the advertised speed and duplex for a network
interfce.  Previously, a network interface was only able to advertise all
supported speed's and duplex's, or one individual speed and duplex.  This
feature allows the user to choose which supported speed's and duplex's to
advertise by using the hex value.
--
Signed-off-by: Jeff Kirsher [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
---

ethtool.c |   30 +++---
1 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 7d408be..2ad2f99 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -99,6 +99,7 @@ static struct option {
  [ duplex half|full ]\n
  [ port tp|aui|bnc|mii|fibre ]\n
  [ autoneg on|off ]\n
+  [ advertise %%x ]\n
  [ phyad %%d ]\n
  [ xcvr internal|external ]\n
  [ wol p|u|m|b|a|g|s|d... ]\n
@@ -546,6 +547,15 @@ static void parse_cmdline(int argc, char
   show_usage(1);
   }
   break;
+   } else if (!strcmp(argp[i], advertise)) {
+   gset_changed = 1;
+   i += 1;
+   if (i = argc)
+   show_usage(1);
+   advertising_wanted = strtol(argp[i], NULL, 6);
+   if (advertising_wanted  0)
+   show_usage(1);
+   break;
   } else if (!strcmp(argp[i], phyad)) {
   gset_changed = 1;
   i += 1;
@@ -598,25 +608,7 @@ static void parse_cmdline(int argc, char
   }
   }

-   if (autoneg_wanted == AUTONEG_ENABLE){
-   if (speed_wanted == SPEED_10  duplex_wanted == DUPLEX_HALF)
-   advertising_wanted = ADVERTISED_10baseT_Half;
-   else if (speed_wanted == SPEED_10 
-duplex_wanted == DUPLEX_FULL)
-   advertising_wanted = ADVERTISED_10baseT_Full;
-   else if (speed_wanted == SPEED_100 
-duplex_wanted == DUPLEX_HALF)
-   advertising_wanted = ADVERTISED_100baseT_Half;
-   else if (speed_wanted == SPEED_100 
-duplex_wanted == DUPLEX_FULL)
-   advertising_wanted = ADVERTISED_100baseT_Full;
-   else if (speed_wanted == SPEED_1000 
-duplex_wanted == DUPLEX_HALF)
-   advertising_wanted = ADVERTISED_1000baseT_Half;
-   else if (speed_wanted == SPEED_1000 
-duplex_wanted == DUPLEX_FULL)
-   advertising_wanted = ADVERTISED_1000baseT_Full;
-   else
+   if ((autoneg_wanted == AUTONEG_ENABLE)  (advertising_wanted  0)) {
   /* auto negotiate without forcing,
* all supported speed will be assigned in do_sset()
*/


--
Cheers,
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] llc: SOCK_DGRAM interface fixes

2006-08-08 Thread Arnaldo Carvalho de Melo
Em Tue, Aug 08, 2006 at 08:36:18PM +0400, Alexey Kuznetsov escreveu:
 Hello!
 
  This fix goes against the old historical comments about UNIX98 semantics
  but without this fix SOCK_DGRAM is broken and useless. So either ANK's
  interpretation was incorect or UNIX98 standard was wrong.
 
 Just found this reference to me. :-)
 
 The comment migrated from tcp.c. It is only about connected SOCK_STREAM
 sockets, I do not see how it can make SOCK_DGRAM broken or useless.

Its just that the work to get the AF_LLC code closer to the AF_INET
structure was suspended before the SOCK_STREAM code was separated from the
SOCK_DGRAM one, moving PF_LLC to sk-sk_prot- land, so the comment is
indeed about SOCK_STREAM part, not DGRAM.

- 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


[PATCH] fib: convert reader/writer to spinlock

2006-08-08 Thread Stephen Hemminger
Ther is no point in using a more expensive reader/writer lock
for a low contention lock like the fib_info_lock. The only
reader case is in handling route redirects.

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

--- tcp-rcu.orig/net/ipv4/fib_semantics.c
+++ tcp-rcu/net/ipv4/fib_semantics.c
@@ -49,7 +49,7 @@
 
 #define FSprintk(a...)
 
-static DEFINE_RWLOCK(fib_info_lock);
+static DEFINE_SPINLOCK(fib_info_lock);
 static struct hlist_head *fib_info_hash;
 static struct hlist_head *fib_info_laddrhash;
 static unsigned int fib_hash_size;
@@ -159,7 +159,7 @@ void free_fib_info(struct fib_info *fi)
 
 void fib_release_info(struct fib_info *fi)
 {
-   write_lock(fib_info_lock);
+   spin_lock(fib_info_lock);
if (fi  --fi-fib_treeref == 0) {
hlist_del(fi-fib_hash);
if (fi-fib_prefsrc)
@@ -172,7 +172,7 @@ void fib_release_info(struct fib_info *f
fi-fib_dead = 1;
fib_info_put(fi);
}
-   write_unlock(fib_info_lock);
+   spin_unlock(fib_info_lock);
 }
 
 static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info 
*ofi)
@@ -254,7 +254,7 @@ int ip_fib_check_default(u32 gw, struct 
struct fib_nh *nh;
unsigned int hash;
 
-   read_lock(fib_info_lock);
+   spin_lock(fib_info_lock);
 
hash = fib_devindex_hashfn(dev-ifindex);
head = fib_info_devhash[hash];
@@ -262,12 +262,12 @@ int ip_fib_check_default(u32 gw, struct 
if (nh-nh_dev == dev 
nh-nh_gw == gw 
!(nh-nh_flagsRTNH_F_DEAD)) {
-   read_unlock(fib_info_lock);
+   spin_unlock(fib_info_lock);
return 0;
}
}
 
-   read_unlock(fib_info_lock);
+   spin_unlock(fib_info_lock);
 
return -1;
 }
@@ -598,7 +598,7 @@ static void fib_hash_move(struct hlist_h
unsigned int old_size = fib_hash_size;
unsigned int i, bytes;
 
-   write_lock(fib_info_lock);
+   spin_lock(fib_info_lock);
old_info_hash = fib_info_hash;
old_laddrhash = fib_info_laddrhash;
fib_hash_size = new_size;
@@ -639,7 +639,7 @@ static void fib_hash_move(struct hlist_h
}
fib_info_laddrhash = new_laddrhash;
 
-   write_unlock(fib_info_lock);
+   spin_unlock(fib_info_lock);
 
bytes = old_size * sizeof(struct hlist_head *);
fib_hash_free(old_info_hash, bytes);
@@ -821,7 +821,7 @@ link_it:
 
fi-fib_treeref++;
atomic_inc(fi-fib_clntref);
-   write_lock(fib_info_lock);
+   spin_lock(fib_info_lock);
hlist_add_head(fi-fib_hash,
   fib_info_hash[fib_info_hashfn(fi)]);
if (fi-fib_prefsrc) {
@@ -840,7 +840,7 @@ link_it:
head = fib_info_devhash[hash];
hlist_add_head(nh-nh_hash, head);
} endfor_nexthops(fi)
-   write_unlock(fib_info_lock);
+   spin_unlock(fib_info_lock);
return fi;
 
 err_inval:
-
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


another networking lockdep trace.

2006-08-08 Thread Dave Jones
From a recent rc3-git kernel.

Dave

-- 
http://www.codemonkey.org.uk
---BeginMessage---
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.




https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201560

   Summary: INFO: inconsistent lock state - during boot .2528
   Product: Fedora Core
   Version: devel
  Platform: All
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: normal
 Component: kernel
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
 QAContact: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


Description of problem:
Get this on boot of new kernel:

Aug  7 06:47:44 localhost kernel: [ INFO: inconsistent lock state ]
Aug  7 06:47:44 localhost pcscd: winscard.c:219:SCardConnect() Reader E-Gate 0 0
Not Found
Aug  7 06:47:44 localhost kernel: -
Aug  7 06:47:44 localhost kernel: inconsistent {in-softirq-W} - {softirq-on-W}
usage.
Aug  7 06:47:44 localhost kernel: ip/2617 [HC0[0]:SC0[0]:HE1:SE1] takes:
Aug  7 06:47:44 localhost kernel:  (ifa-lock){-+..}, at: [f90a3836]
inet6_addr_add+0xf8/0x13e [ipv6]
Aug  7 06:47:44 localhost kernel: {in-softirq-W} state was registered at:
Aug  7 06:47:44 localhost kernel:   [c043bfb9] lock_acquire+0x4b/0x6a
Aug  7 06:47:44 localhost kernel:   [c060f428] _spin_lock_bh+0x1e/0x2d
Aug  7 06:47:44 localhost kernel:   [f90a4757] addrconf_dad_timer+0x3a/0xe2 
[ipv6]
Aug  7 06:47:44 localhost pcscd: winscard.c:219:SCardConnect() Reader E-Gate 0 0
Not Found
Aug  7 06:47:44 localhost kernel:   [c042dbc0] run_timer_softirq+0x108/0x167
Aug  7 06:47:44 localhost kernel:   [c04293ab] __do_softirq+0x78/0xf2
Aug  7 06:47:44 localhost kernel:   [c0406673] do_softirq+0x5a/0xbe
Aug  7 06:47:44 localhost kernel: irq event stamp: 3551
Aug  7 06:47:44 localhost kernel: hardirqs last  enabled at (3551): [c04291bf]
local_bh_enable_ip+0xc6/0xcf
Aug  7 06:47:45 localhost kernel: hardirqs last disabled at (3549): [c0429152]
local_bh_enable_ip+0x59/0xcf
Aug  7 06:47:45 localhost kernel: softirqs last  enabled at (3550): [f90a09ce]
ipv6_add_addr+0x210/0x254 [ipv6]
Aug  7 06:47:45 localhost kernel: softirqs last disabled at (3538): [c060f4f7]
_read_lock_bh+0xb/0x2d
Aug  7 06:47:45 localhost kernel:
Aug  7 06:47:45 localhost kernel: other info that might help us debug this:
Aug  7 06:47:45 localhost kernel: 1 lock held by ip/2617:
Aug  7 06:47:45 localhost kernel:  #0:  (rtnl_mutex){--..}, at: [c060e378]
mutex_lock+0x21/0x24
Aug  7 06:47:45 localhost kernel:
Aug  7 06:47:45 localhost kernel: stack backtrace:
Aug  7 06:47:45 localhost kernel:  [c04051ee] show_trace_log_lvl+0x58/0x159
Aug  7 06:47:45 localhost kernel:  [c04057ea] show_trace+0xd/0x10
Aug  7 06:47:45 localhost kernel:  [c0405903] dump_stack+0x19/0x1b
Aug  7 06:47:45 localhost kernel:  [c043a402] print_usage_bug+0x1ca/0x1d7
Aug  7 06:47:45 localhost kernel:  [c043a8eb] mark_lock+0x239/0x353
Aug  7 06:47:45 localhost kernel:  [c043b50a] __lock_acquire+0x459/0x997
Aug  7 06:47:45 localhost kernel:  [c043bfb9] lock_acquire+0x4b/0x6a
Aug  7 06:47:45 localhost kernel:  [c060f3fb] _spin_lock+0x19/0x28
Aug  7 06:47:45 localhost kernel:  [f90a3836] inet6_addr_add+0xf8/0x13e [ipv6]
Aug  7 06:47:45 localhost kernel:  [f90a3a39] inet6_rtm_newaddr+0x1bd/0x1d2 
[ipv6]
Aug  7 06:47:45 localhost kernel:  [c05bf5f3] rtnetlink_rcv_msg+0x1b3/0x1d6
Aug  7 06:47:45 localhost kernel:  [c05cae7b] netlink_run_queue+0x69/0xfe
Aug  7 06:47:45 localhost kernel:  [c05bf3f6] rtnetlink_rcv+0x29/0x42
Aug  7 06:47:45 localhost kernel:  [c05cb308] netlink_data_ready+0x12/0x50
Aug  7 06:47:45 localhost kernel:  [c05ca370] netlink_sendskb+0x1f/0x37
Aug  7 06:47:45 localhost kernel:  [c05cac49] netlink_unicast+0x1a1/0x1bb
Aug  7 06:47:45 localhost kernel:  [c05cb2e9] netlink_sendmsg+0x275/0x282
Aug  7 06:47:45 localhost kernel:  [c05ae91a] sock_sendmsg+0xe8/0x103
Aug  7 06:47:45 localhost kernel:  [c05af129] sys_sendmsg+0x14d/0x1a8
Aug  7 06:47:45 localhost kernel:  [c05b02fb] sys_socketcall+0x16b/0x186
Aug  7 06:47:45 localhost kernel:  [c0403faf] syscall_call+0x7/0xb
Aug  7 06:47:45 localhost kernel: DWARF2 unwinder stuck at syscall_call+0x7/0xb
Aug  7 06:47:45 localhost kernel: Leftover inexact backtrace:
Aug  7 06:47:45 localhost avahi-daemon[2392]: New relevant interface eth0.IPv6
for mDNS.
Aug  7 06:47:45 localhost kernel:  [c04057ea] show_trace+0xd/0x10
Aug  7 06:47:45 localhost avahi-daemon[2392]: Joining mDNS multicast group on
interface eth0.IPv6 with address fe80::20a:e4ff:fe3f:8bc4.
Aug  7 06:47:45 localhost kernel:  [c0405903] dump_stack+0x19/0x1b
Aug  7 06:47:45 localhost avahi-daemon[2392]: Registering new address record for
fe80::20a:e4ff:fe3f:8bc4 on eth0.
Aug  7 06:47:45 localhost kernel:  [c043a402] print_usage_bug+0x1ca/0x1d7
Aug  7 06:47:45 localhost kernel:  [c043a8eb] mark_lock+0x239/0x353
Aug  7 

Re: Linux v2.6.18-rc4

2006-08-08 Thread Jan Engelhardt

It's been a week since -rc3, so now we have a -rc4.

2.6.18 comes with ipt_statistic, but there is no way from userspace 
(iptables) to use it (libipt_statistic.so simply does not come with the 
latest iptables from svn). Does someone know what's going on?



Jan Engelhardt
-- 
-
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: Linux v2.6.18-rc4

2006-08-08 Thread Patrick McHardy
Jan Engelhardt wrote:
It's been a week since -rc3, so now we have a -rc4.
 
 
 2.6.18 comes with ipt_statistic, but there is no way from userspace 
 (iptables) to use it (libipt_statistic.so simply does not come with the 
 latest iptables from svn). Does someone know what's going on?

I still have to add the userspace part to SVN.
-
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: -mm patch] bcm43xx_main.c: remove 3 functions

2006-08-08 Thread Michael Buesch
On Monday 07 August 2006 23:04, Adrian Bunk wrote:
 This patch removes three no longer used functions (that are even 
 generating gcc warnings).
 
 This patch doesn't look right, but it is the result of 
 58e5528ee464d38040b9489e10033c9387a10d56 in git-netdev...

Hm, can't find that commit in a tree.
I looked at linus', netdev-2.6.

But one thing is for sure. This patch is _wrong_. ;)

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

NACK.

  drivers/net/wireless/bcm43xx/bcm43xx_main.c |   33 
  1 file changed, 33 deletions(-)
 
 --- linux-2.6.18-rc3-mm2-full/drivers/net/wireless/bcm43xx/bcm43xx_main.c.old 
 2006-08-07 18:21:31.0 +0200
 +++ linux-2.6.18-rc3-mm2-full/drivers/net/wireless/bcm43xx/bcm43xx_main.c 
 2006-08-07 18:23:36.0 +0200
 @@ -3194,39 +3194,6 @@
   bcm43xx_clear_keys(bcm);
  }
  
 -static int bcm43xx_rng_read(struct hwrng *rng, u32 *data)
 -{
 - struct bcm43xx_private *bcm = (struct bcm43xx_private *)rng-priv;
 - unsigned long flags;
 -
 - spin_lock_irqsave((bcm)-irq_lock, flags);
 - *data = bcm43xx_read16(bcm, BCM43xx_MMIO_RNG);
 - spin_unlock_irqrestore((bcm)-irq_lock, flags);
 -
 - return (sizeof(u16));
 -}
 -
 -static void bcm43xx_rng_exit(struct bcm43xx_private *bcm)
 -{
 - hwrng_unregister(bcm-rng);
 -}
 -
 -static int bcm43xx_rng_init(struct bcm43xx_private *bcm)
 -{
 - int err;
 -
 - snprintf(bcm-rng_name, ARRAY_SIZE(bcm-rng_name),
 -  %s_%s, KBUILD_MODNAME, bcm-net_dev-name);
 - bcm-rng.name = bcm-rng_name;
 - bcm-rng.data_read = bcm43xx_rng_read;
 - bcm-rng.priv = (unsigned long)bcm;
 - err = hwrng_register(bcm-rng);
 - if (err)
 - printk(KERN_ERR PFX RNG init failed (%d)\n, err);
 -
 - return err;
 -}
 -
  static int bcm43xx_shutdown_all_wireless_cores(struct bcm43xx_private *bcm)
  {

-- 
Greetings Michael.
-
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][PATCH 5/9] r8169 driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the netdev_alloc_skb() API and the
NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 drivers/net/r8169.c |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

Index: linux-2.6/drivers/net/r8169.c
===
--- linux-2.6.orig/drivers/net/r8169.c
+++ linux-2.6/drivers/net/r8169.c
@@ -1480,6 +1480,8 @@ rtl8169_init_board(struct pci_dev *pdev,
}
}
 
+   dev-features |= NETIF_F_MEMALLOC;
+
pci_set_master(pdev);
 
/* ioremap MMIO region */
@@ -1909,14 +1911,15 @@ static inline void rtl8169_map_to_asic(s
rtl8169_mark_to_asic(desc, rx_buf_sz);
 }
 
-static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
+static int rtl8169_alloc_rx_skb(struct net_device *dev, struct pci_dev *pdev,
+   struct sk_buff **sk_buff,
struct RxDesc *desc, int rx_buf_sz)
 {
struct sk_buff *skb;
dma_addr_t mapping;
int ret = 0;
 
-   skb = dev_alloc_skb(rx_buf_sz + NET_IP_ALIGN);
+   skb = netdev_alloc_skb(dev, rx_buf_sz + NET_IP_ALIGN);
if (!skb)
goto err_out;
 
@@ -1960,7 +1963,7 @@ static u32 rtl8169_rx_fill(struct rtl816
if (tp-Rx_skbuff[i])
continue;

-   ret = rtl8169_alloc_rx_skb(tp-pci_dev, tp-Rx_skbuff + i,
+   ret = rtl8169_alloc_rx_skb(dev, tp-pci_dev, tp-Rx_skbuff + i,
   tp-RxDescArray + i, tp-rx_buf_sz);
if (ret  0)
break;
@@ -2371,7 +2374,8 @@ static inline void rtl8169_rx_csum(struc
skb-ip_summed = CHECKSUM_NONE;
 }
 
-static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size,
+static inline int rtl8169_try_rx_copy(struct net_device *dev,
+ struct sk_buff **sk_buff, int pkt_size,
  struct RxDesc *desc, int rx_buf_sz)
 {
int ret = -1;
@@ -2379,7 +2383,7 @@ static inline int rtl8169_try_rx_copy(st
if (pkt_size  rx_copybreak) {
struct sk_buff *skb;
 
-   skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
+   skb = netdev_alloc_skb(dev, pkt_size + NET_IP_ALIGN);
if (skb) {
skb_reserve(skb, NET_IP_ALIGN);
eth_copy_and_sum(skb, sk_buff[0]-data, pkt_size, 0);
@@ -2452,7 +2456,7 @@ rtl8169_rx_interrupt(struct net_device *
le64_to_cpu(desc-addr), tp-rx_buf_sz,
PCI_DMA_FROMDEVICE);
 
-   if (rtl8169_try_rx_copy(skb, pkt_size, desc,
+   if (rtl8169_try_rx_copy(dev, skb, pkt_size, desc,
tp-rx_buf_sz)) {
pci_action = pci_unmap_single;
tp-Rx_skbuff[entry] = 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


[RFC][PATCH 7/9] UML eth driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the netdev_alloc_skb() API and the
NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 arch/um/drivers/net_kern.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/um/drivers/net_kern.c
===
--- linux-2.6.orig/arch/um/drivers/net_kern.c
+++ linux-2.6/arch/um/drivers/net_kern.c
@@ -43,7 +43,7 @@ static int uml_net_rx(struct net_device 
struct sk_buff *skb;
 
/* If we can't allocate memory, try again next round. */
-   skb = dev_alloc_skb(dev-mtu);
+   skb = netdev_alloc_skb(dev, dev-mtu);
if (skb == NULL) {
lp-stats.rx_dropped++;
return 0;
@@ -377,6 +377,7 @@ static int eth_configure(int n, void *in
dev-ethtool_ops = uml_net_ethtool_ops;
dev-watchdog_timeo = (HZ  1);
dev-irq = UM_ETH_IRQ;
+   dev-features |= NETIF_F_MEMALLOC;
 
rtnl_lock();
err = register_netdevice(dev);
-
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][PATCH 8/9] 3c59x driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the netdev_alloc_skb() API and the
NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 drivers/net/3c59x.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/net/3c59x.c
===
--- linux-2.6.orig/drivers/net/3c59x.c
+++ linux-2.6/drivers/net/3c59x.c
@@ -1383,6 +1383,8 @@ static int __devinit vortex_probe1(struc
(dev-features  NETIF_F_IP_CSUM) ? en:dis);
}
 
+   dev-features |= NETIF_F_MEMALLOC;
+
dev-stop = vortex_close;
dev-get_stats = vortex_get_stats;
 #ifdef CONFIG_PCI
@@ -1680,7 +1682,7 @@ vortex_open(struct net_device *dev)
vp-rx_ring[i].next = cpu_to_le32(vp-rx_ring_dma + 
sizeof(struct boom_rx_desc) * (i+1));
vp-rx_ring[i].status = 0;  /* Clear complete bit. 
*/
vp-rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ | 
LAST_FRAG);
-   skb = dev_alloc_skb(PKT_BUF_SZ);
+   skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
vp-rx_skbuff[i] = skb;
if (skb == NULL)
break;  /* Bad news!  */
@@ -2405,7 +2407,7 @@ static int vortex_rx(struct net_device *
int pkt_len = rx_status  0x1fff;
struct sk_buff *skb;
 
-   skb = dev_alloc_skb(pkt_len + 5);
+   skb = netdev_alloc_skb(dev, pkt_len + 5);
if (vortex_debug  4)
printk(KERN_DEBUG Receiving packet size %d 
status %4.4x.\n,
   pkt_len, rx_status);
@@ -2486,7 +2488,7 @@ boomerang_rx(struct net_device *dev)
 
/* Check if the packet is long enough to just accept 
without
   copying to a properly sized skbuff. */
-   if (pkt_len  rx_copybreak  (skb = 
dev_alloc_skb(pkt_len + 2)) != 0) {
+   if (pkt_len  rx_copybreak  (skb = 
netdev_alloc_skb(dev, pkt_len + 2)) != 0) {
skb-dev = dev;
skb_reserve(skb, 2);/* Align IP on 16 byte 
boundaries */
pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), 
dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
@@ -2525,7 +2527,7 @@ boomerang_rx(struct net_device *dev)
struct sk_buff *skb;
entry = vp-dirty_rx % RX_RING_SIZE;
if (vp-rx_skbuff[entry] == NULL) {
-   skb = dev_alloc_skb(PKT_BUF_SZ);
+   skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
if (skb == NULL) {
static unsigned long last_jif;
if (time_after(jiffies, last_jif + 10 * HZ)) {
-
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][PATCH 6/9] tg3 driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 drivers/net/tg3.c |2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/drivers/net/tg3.c
===
--- linux-2.6.orig/drivers/net/tg3.c
+++ linux-2.6/drivers/net/tg3.c
@@ -11643,6 +11643,8 @@ static int __devinit tg3_init_one(struct
 */
pci_save_state(tp-pdev);
 
+   dev-features |= NETIF_F_MEMALLOC;
+
err = register_netdev(dev);
if (err) {
printk(KERN_ERR PFX Cannot register net device, 
-
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][PATCH 9/9] deadlock prevention for NBD

2006-08-08 Thread Peter Zijlstra


Use sk_set_memalloc() on the nbd socket.

Limit each request to 1 page, so that the request throttling also limits the
number of in-flight pages and force the IO scheduler to NOOP as anything else
doesn't make sense anyway.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 block/elevator.c   |5 +
 block/ll_rw_blk.c  |   12 ++--
 drivers/block/nbd.c|   11 ++-
 include/linux/blkdev.h |9 +
 4 files changed, 34 insertions(+), 3 deletions(-)

Index: linux-2.6/block/ll_rw_blk.c
===
--- linux-2.6.orig/block/ll_rw_blk.c
+++ linux-2.6/block/ll_rw_blk.c
@@ -1899,6 +1899,14 @@ EXPORT_SYMBOL(blk_init_queue);
 request_queue_t *
 blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
 {
+   return blk_init_queue_node_elv(rfn, lock, node_id, NULL);
+}
+EXPORT_SYMBOL(blk_init_queue_node);
+
+request_queue_t *
+blk_init_queue_node_elv(request_fn_proc *rfn, spinlock_t *lock, int node_id,
+   char *elv_name)
+{
request_queue_t *q = blk_alloc_queue_node(GFP_KERNEL, node_id);
 
if (!q)
@@ -1939,7 +1947,7 @@ blk_init_queue_node(request_fn_proc *rfn
/*
 * all done
 */
-   if (!elevator_init(q, NULL)) {
+   if (!elevator_init(q, elv_name)) {
blk_queue_congestion_threshold(q);
return q;
}
@@ -1947,7 +1955,7 @@ blk_init_queue_node(request_fn_proc *rfn
blk_put_queue(q);
return NULL;
 }
-EXPORT_SYMBOL(blk_init_queue_node);
+EXPORT_SYMBOL(blk_init_queue_node_elv);
 
 int blk_get_queue(request_queue_t *q)
 {
Index: linux-2.6/drivers/block/nbd.c
===
--- linux-2.6.orig/drivers/block/nbd.c
+++ linux-2.6/drivers/block/nbd.c
@@ -361,6 +361,10 @@ static void nbd_do_it(struct nbd_device 
 
BUG_ON(lo-magic != LO_MAGIC);
 
+   if (sk_set_memalloc(lo-sock-sk))
+   printk(KERN_WARNING
+   failed to set SO_MEMALLOC on NBD socket\n);
+
while ((req = nbd_read_stat(lo)) != NULL)
nbd_end_request(req);
return;
@@ -628,11 +632,16 @@ static int __init nbd_init(void)
 * every gendisk to have its very own request_queue struct.
 * These structs are big so we dynamically allocate them.
 */
-   disk-queue = blk_init_queue(do_nbd_request, nbd_lock);
+   disk-queue = blk_init_queue_node_elv(do_nbd_request,
+   nbd_lock, -1, noop);
if (!disk-queue) {
put_disk(disk);
goto out;
}
+   blk_queue_pin_elevator(disk-queue);
+   blk_queue_max_segment_size(disk-queue, PAGE_SIZE);
+   blk_queue_max_hw_segments(disk-queue, 1);
+   blk_queue_max_phys_segments(disk-queue, 1);
}
 
if (register_blkdev(NBD_MAJOR, nbd)) {
Index: linux-2.6/include/linux/blkdev.h
===
--- linux-2.6.orig/include/linux/blkdev.h
+++ linux-2.6/include/linux/blkdev.h
@@ -444,6 +444,12 @@ struct request_queue
 #define QUEUE_FLAG_REENTER 6   /* Re-entrancy avoidance */
 #define QUEUE_FLAG_PLUGGED 7   /* queue is plugged */
 #define QUEUE_FLAG_ELVSWITCH   8   /* don't use elevator, just do FIFO */
+#define QUEUE_FLAG_ELVPINNED   9   /* pin the current elevator */
+
+static inline void blk_queue_pin_elevator(struct request_queue *q)
+{
+   set_bit(QUEUE_FLAG_ELVPINNED, q-queue_flags);
+}
 
 enum {
/*
@@ -696,6 +702,9 @@ static inline void elv_dispatch_add_tail
 /*
  * Access functions for manipulating queue properties
  */
+extern request_queue_t *blk_init_queue_node_elv(request_fn_proc *rfn,
+   spinlock_t *lock, int node_id,
+   char *elv_name);
 extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn,
spinlock_t *lock, int node_id);
 extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *);
Index: linux-2.6/block/elevator.c
===
--- linux-2.6.orig/block/elevator.c
+++ linux-2.6/block/elevator.c
@@ -861,6 +861,11 @@ ssize_t elv_iosched_store(request_queue_
size_t len;
struct elevator_type *e;
 
+   if (test_bit(QUEUE_FLAG_ELVPINNED, q-queue_flags)) {
+   printk(KERN_ERR elevator: cannot switch elevator, pinned\n);
+   return count;
+   }
+
elevator_name[sizeof(elevator_name) - 1] = '\0';
strncpy(elevator_name, name, sizeof(elevator_name) - 1);
len = strlen(elevator_name);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a 

[RFC][PATCH 0/9] Network receive deadlock prevention for NBD

2006-08-08 Thread Peter Zijlstra

From: Daniel Phillips [EMAIL PROTECTED]

Recently, Peter Zijlstra and I have been busily collaborating on a
solution to the memory deadlock problem described here:

   http://lwn.net/Articles/144273/
   Kernel Summit 2005: Convergence of network and storage paths

We believe that an approach very much like today's patch set is
necessary for NBD, iSCSI, AoE or the like ever to work reliably. 
We further believe that a properly working version of at least one of
these subsystems is critical to the viability of Linux as a modern
storage platform.

Today's patch set builds on a patch I posted a while back:

   http://lwn.net/Articles/146061/
   Net vm deadlock fix (preliminary)

Peter Zijlstra got the ball rolling again by posting this patch:

   http://lkml.org/lkml/2006/7/7/164

Which I gently flamed:

   http://lkml.org/lkml/2006/7/7/245
   
Peter turned out to be right. Any elevator other than NOOP is wrong for
NBD on the client side.  It turns out that something in the elevator
itself deadlocks under heavy load.  This is a bug: io_sched waits
forever under certain conditions.  Maybe it is another memory deadlock,
who knows.  It is for sure a bug for another day, in a piece of machinery
that we have now discarded as far as the NBD client is concerned.

However, the mere possibility that Peter's deadlock might be in the
network receive path was enough to motivate us to get down to work and
close that subtle hole.  To be sure, the network receive path deadlock
is not so much a deadlock as a severe performance bug.  When it bites,
valuable packets will be lost just when the system is least able to
afford the loss.  Under rare circumstances a true deadlock will occur.

Our immediate objective is to prevent that rare deadlock and to go
further: we also prevent the performance bug in all but the most exotic
of circumstances.  And we go further yet by attemping to keep unrelated
traffic flowing more or less smoothly on the same socket as the block IO
traffic, even under conditions of heavy memory stress.

Peter will be doing the heavy lifting on this patch from here on, so I
suppose we can call this a changing of the hats.

The problem:

Sometimes our Linux VMM needs to allocate memory in order to free
memory, for example when writing dirty file pages to disk or writing
process pages to swap.  In the case of dirty file pages we may need to
read in some file metadata in order to know where to write a given page.
We avoid deadlock in this case by providing the filesystem access to a
special memalloc reserve of pages whenever it is doing work on behalf
of the VMM.  This is implemented via a PF_MEMALLOC process flag to
tell alloc_pages that it may satisfy a memory allocation request by
dipping into the memalloc reserve if it must.  A PF_MEMALLOC
process is thus able to complete its work without recursing into
the memory-freeing code and risking deadlock.  This simple strategy
has served us well for years.

A difficulty that has arisen in recent years is that sometimes code
involved in writing out pages needs to rely on some other process than
itself to help it do its work.  Such a memhelper process does not
automatically inherit the PF_MEMALLOC process flag because it is
not called directly, and ends up competing for the same memory as any
other process.  There is clear and present danger that such a process
may block forever waiting for memory to be freed, a deadlock.  Clearly
we must either get rid of such processes entirely by refactoring code,
or where that is impossible, we must provide access to a special memory
reserve in order to avoid falling into the deep black pit of vm
recursion.  This is not particularly hard.  We just need to:

   a) Run such a process in PF_MEMALLOC mode

and

   b) Throttle the activity of the process so that it never exceeds
   some pre-calculated threshold of memory usage, and thus does not
   exhaust the memalloc reserve.

Other solutions such as mempool (similarly combined with throttling) are
certainly possible, but the memalloc solution is particularly simple and
obviously correct.

Unfortunately, a particularly nasty form of memory deadlock arises from
the fact that receive side of the network stack is also a sort of
separate process.  If we operate a block device remotely over the
network as many of us do these days, we must provide reserve memory to
the network receive path in order to avoid deadlock.  But we cannot
provide such reserve memory willy nilly to every network packet
arriving, otherwise the reserve may be exhausted just as essential
memory-freeing protocol traffic shows up.  This is the dread network
memory deadlock that has plagued such subsystems as the network block
device since time immemorial.

Our solution:

Today we consider only the network receive aspect of the memory deadlock
problem, because it is by far the most difficult manifestation and
because a solution to just this aspect is all that stands in the way of
a reliable network block device.

We 

[RFC][PATCH 4/9] e100 driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the netdev_alloc_skb() API and the
NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

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

Index: linux-2.6/drivers/net/e100.c
===
--- linux-2.6.orig/drivers/net/e100.c
+++ linux-2.6/drivers/net/e100.c
@@ -1763,7 +1763,7 @@ static inline void e100_start_receiver(s
 #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
 static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
 {
-   if(!(rx-skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN)))
+   if(!(rx-skb = netdev_alloc_skb(nic-netdev, RFD_BUF_LEN + 
NET_IP_ALIGN)))
return -ENOMEM;
 
/* Align, init, and map the RFD. */
@@ -2143,7 +2143,7 @@ static int e100_loopback_test(struct nic
 
e100_start_receiver(nic, NULL);
 
-   if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) {
+   if(!(skb = netdev_alloc_skb(nic-netdev, ETH_DATA_LEN))) {
err = -ENOMEM;
goto err_loopback_none;
}
@@ -2573,6 +2573,7 @@ static int __devinit e100_probe(struct p
 #ifdef CONFIG_NET_POLL_CONTROLLER
netdev-poll_controller = e100_netpoll;
 #endif
+   netdev-features |= NETIF_F_MEMALLOC;
strcpy(netdev-name, pci_name(pdev));
 
nic = netdev_priv(netdev);
-
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][PATCH 3/9] e1000 driver conversion

2006-08-08 Thread Peter Zijlstra

Update the driver to make use of the NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 drivers/net/e1000/e1000_main.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -822,7 +822,7 @@ e1000_probe(struct pci_dev *pdev,
if (pci_using_dac)
netdev-features |= NETIF_F_HIGHDMA;
 
-   netdev-features |= NETIF_F_LLTX;
+   netdev-features |= NETIF_F_LLTX | NETIF_F_MEMALLOC;
 
adapter-en_mng_pt = e1000_enable_mng_pass_thru(adapter-hw);
 
@@ -4020,8 +4020,6 @@ e1000_alloc_rx_buffers(struct e1000_adap
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-   skb-dev = netdev;
-
buffer_info-skb = skb;
buffer_info-length = adapter-rx_buffer_len;
 map_skb:
@@ -4099,8 +4097,11 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
for (j = 0; j  PS_PAGE_BUFFERS; j++) {
if (j  adapter-rx_ps_pages) {
if (likely(!ps_page-ps_page[j])) {
+   /* Perhaps we should alloc the skb first
+* and use something like sk_buff_gfp().
+*/
ps_page-ps_page[j] =
-   alloc_page(GFP_ATOMIC);
+   alloc_page(GFP_ATOMIC | 
__GFP_MEMALLOC);
if (unlikely(!ps_page-ps_page[j])) {
adapter-alloc_rx_buff_failed++;
goto no_buffers;
@@ -4135,8 +4136,6 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-   skb-dev = netdev;
-
buffer_info-skb = skb;
buffer_info-length = adapter-rx_ps_bsize0;
buffer_info-dma = pci_map_single(pdev, skb-data,
-
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][PATCH 2/9] deadlock prevention core

2006-08-08 Thread Peter Zijlstra

The core of the VM deadlock avoidance framework.

From the 'user' side of things it provides a function to mark a 'struct sock'
as SOCK_MEMALLOC, meaning this socket may dip into the memalloc reserves on
the receive side.

From the net_device side of things, the extra 'struct net_device *' argument
to {,__}netdev_alloc_skb() is used to attribute/account the memalloc usage.
Converted drivers will make use of this new API and will set NETIF_F_MEMALLOC
to indicate the driver fully supports this feature.

When a SOCK_MEMALLOC socket is marked, the device is checked for this feature
and tries to increase the memalloc pool; if both succeed, the device is marked
with IFF_MEMALLOC, indicating to {,__}netdev_alloc_skb() that it is OK to dip
into the memalloc pool.

Memalloc sk_buff allocations are not done from the SLAB but are done using 
alloc_pages(). sk_buff::memalloc records this exception so that kfree_skbmem()
can do the right thing.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 include/linux/gfp.h   |3 -
 include/linux/if.h|1 
 include/linux/mmzone.h|1 
 include/linux/netdevice.h |   48 ++-
 include/linux/skbuff.h|3 -
 include/net/sock.h|8 +++
 mm/page_alloc.c   |   29 ++-
 net/core/dev.c|1 
 net/core/skbuff.c |  114 +++---
 net/core/sock.c   |   54 +
 net/ethernet/eth.c|1 
 net/ipv4/af_inet.c|   14 +
 net/ipv4/icmp.c   |5 ++
 net/ipv4/tcp_ipv4.c   |6 ++
 net/ipv4/udp.c|   11 
 15 files changed, 274 insertions(+), 25 deletions(-)

Index: linux-2.6/include/linux/gfp.h
===
--- linux-2.6.orig/include/linux/gfp.h
+++ linux-2.6/include/linux/gfp.h
@@ -46,6 +46,7 @@ struct vm_area_struct;
 #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on 
success */
 #define __GFP_NOMEMALLOC ((__force gfp_t)0x1u) /* Don't use emergency 
reserves */
 #define __GFP_HARDWALL   ((__force gfp_t)0x2u) /* Enforce hardwall cpuset 
memory allocs */
+#define __GFP_MEMALLOC  ((__force gfp_t)0x4u) /* Use emergency reserves */
 
 #define __GFP_BITS_SHIFT 20/* Room for 20 __GFP_FOO bits */
 #define __GFP_BITS_MASK ((__force gfp_t)((1  __GFP_BITS_SHIFT) - 1))
@@ -54,7 +55,7 @@ struct vm_area_struct;
 #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
-   __GFP_NOMEMALLOC|__GFP_HARDWALL)
+   __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_MEMALLOC)
 
 /* This equals 0, but use constants in case they ever change */
 #define GFP_NOWAIT (GFP_ATOMIC  ~__GFP_HIGH)
Index: linux-2.6/include/linux/mmzone.h
===
--- linux-2.6.orig/include/linux/mmzone.h
+++ linux-2.6/include/linux/mmzone.h
@@ -420,6 +420,7 @@ int percpu_pagelist_fraction_sysctl_hand
void __user *, size_t *, loff_t *);
 int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
struct file *, void __user *, size_t *, loff_t *);
+int adjust_memalloc_reserve(int bytes);
 
 #include linux/topology.h
 /* Returns the number of the current Node. */
Index: linux-2.6/include/linux/netdevice.h
===
--- linux-2.6.orig/include/linux/netdevice.h
+++ linux-2.6/include/linux/netdevice.h
@@ -298,18 +298,22 @@ struct net_device
 
/* Net device features */
unsigned long   features;
-#define NETIF_F_SG 1   /* Scatter/gather IO. */
-#define NETIF_F_IP_CSUM2   /* Can checksum only TCP/UDP 
over IPv4. */
-#define NETIF_F_NO_CSUM4   /* Does not require checksum. 
F.e. loopack. */
-#define NETIF_F_HW_CSUM8   /* Can checksum all the 
packets. */
-#define NETIF_F_HIGHDMA32  /* Can DMA to high memory. */
-#define NETIF_F_FRAGLIST   64  /* Scatter/gather IO. */
-#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
-#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
-#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
-#define NETIF_F_VLAN_CHALLENGED1024/* Device cannot handle VLAN 
packets */
-#define NETIF_F_GSO2048/* Enable software GSO. */
-#define NETIF_F_LLTX   4096/* LockLess TX */
+#define NETIF_F_SG 0x0001  /* Scatter/gather IO. */
+#define NETIF_F_IP_CSUM0x0002  /* Can checksum only TCP/UDP 
over IPv4. */
+#define NETIF_F_NO_CSUM0x0004  /* Does not require 

[RFC][PATCH 1/9] pfn_to_kaddr() for UML

2006-08-08 Thread Peter Zijlstra

Update UML with a proper 'pfn_to_kaddr()' definition, the VM deadlock
avoidance framework uses it.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 include/asm-um/page.h |2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/include/asm-um/page.h
===
--- linux-2.6.orig/include/asm-um/page.h
+++ linux-2.6/include/asm-um/page.h
@@ -111,6 +111,8 @@ extern unsigned long uml_physmem;
 #define pfn_valid(pfn) ((pfn)  max_mapnr)
 #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
 
+#define pfn_to_kaddr(pfn)  __va((pfn)  PAGE_SHIFT)
+
 extern struct page *arch_validate(struct page *page, gfp_t mask, int order);
 #define HAVE_ARCH_VALIDATE
 
-
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: -mm patch] bcm43xx_main.c: remove 3 functions

2006-08-08 Thread Adrian Bunk
On Tue, Aug 08, 2006 at 08:32:37PM +0200, Michael Buesch wrote:
 On Monday 07 August 2006 23:04, Adrian Bunk wrote:
  This patch removes three no longer used functions (that are even 
  generating gcc warnings).
  
  This patch doesn't look right, but it is the result of 
  58e5528ee464d38040b9489e10033c9387a10d56 in git-netdev...
 
 Hm, can't find that commit in a tree.
 I looked at linus', netdev-2.6.

It's in netdev-2.6.git#ALL that gets included in -mm.

 But one thing is for sure. This patch is _wrong_. ;)
...

And it seems to be your fault.  ;-)


commit 58e5528ee464d38040b9489e10033c9387a10d56
Author: Michael Buesch [EMAIL PROTECTED]
Date:   Sat Jul 8 22:02:18 2006 +0200

[PATCH] bcm43xx: init routine rewrite

Rewrite of the bcm43xx initialization routines.
This fixes several issues:
* up-down-up-down-up... stale data issue
  (May fix some DHCP issues)
* Fix the init vs IRQ handler race (and remove the workaround)
* Fix init for cards with multiple cores (APHY)
  As softmac has no internal PHY handling (unlike dscape),
  this adds the file phymode to sysfs.
  The active PHY can be selected by writing either a, b or g
  to this file. Current PHY can be determined by reading from it.
* Fix the controller restart code.
  Controller restart can now also be triggered through
  echo 1  /debug/bcm43xx/ethX/restart

Signed-off-by: Michael Buesch [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]


 Greetings Michael.

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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 2/3] [IPv4]: Convert FIB dumping to use new netlink api

2006-08-08 Thread Thomas Graf
Signed-off-by: Thomas Graf [EMAIL PROTECTED]

Index: net-2.6.19.git/net/ipv4/fib_semantics.c
===
--- net-2.6.19.git.orig/net/ipv4/fib_semantics.c
+++ net-2.6.19.git/net/ipv4/fib_semantics.c
@@ -286,7 +286,7 @@ void rtmsg_fib(int event, u32 key, struc
return;
 
if (fib_dump_info(skb, pid, seq, event, tb_id, fa-fa_type,
- fa-fa_scope, key, dst_len, fa-fa_tos,
+ fa-fa_scope, key, dst_len, fa-fa_tos,
  fa-fa_info, 0) = 0) {
kfree_skb(skb);
return;
@@ -935,17 +935,18 @@ u32 __fib_res_prefsrc(struct fib_result 
return inet_select_addr(FIB_RES_DEV(*res), FIB_RES_GW(*res), 
res-scope);
 }
 
-int
-fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
- u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos,
- struct fib_info *fi, unsigned int flags)
+int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
+ u8 tb_id, u8 type, u8 scope, u32 dst, int dst_len, u8 tos,
+ struct fib_info *fi, unsigned int flags)
 {
+   struct nlmsghdr *nlh;
struct rtmsg *rtm;
-   struct nlmsghdr  *nlh;
-   unsigned char*b = skb-tail;
 
-   nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags);
-   rtm = NLMSG_DATA(nlh);
+   nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags);
+   if (nlh == NULL)
+   return -ENOBUFS;
+
+   rtm = nlmsg_data(nlh);
rtm-rtm_family = AF_INET;
rtm-rtm_dst_len = dst_len;
rtm-rtm_src_len = 0;
@@ -954,59 +955,66 @@ fib_dump_info(struct sk_buff *skb, u32 p
rtm-rtm_type = type;
rtm-rtm_flags = fi-fib_flags;
rtm-rtm_scope = scope;
-   if (rtm-rtm_dst_len)
-   RTA_PUT(skb, RTA_DST, 4, dst);
rtm-rtm_protocol = fi-fib_protocol;
+
+   if (rtm-rtm_dst_len)
+   NLA_PUT_U32(skb, RTA_DST, dst);
+
if (fi-fib_priority)
-   RTA_PUT(skb, RTA_PRIORITY, 4, fi-fib_priority);
+   NLA_PUT_U32(skb, RTA_PRIORITY, fi-fib_priority);
+
if (rtnetlink_put_metrics(skb, fi-fib_metrics)  0)
-   goto rtattr_failure;
+   goto nla_put_failure;
+
if (fi-fib_prefsrc)
-   RTA_PUT(skb, RTA_PREFSRC, 4, fi-fib_prefsrc);
+   NLA_PUT_U32(skb, RTA_PREFSRC, fi-fib_prefsrc);
+
if (fi-fib_nhs == 1) {
if (fi-fib_nh-nh_gw)
-   RTA_PUT(skb, RTA_GATEWAY, 4, fi-fib_nh-nh_gw);
+   NLA_PUT_U32(skb, RTA_GATEWAY, fi-fib_nh-nh_gw);
+
if (fi-fib_nh-nh_oif)
-   RTA_PUT(skb, RTA_OIF, sizeof(int), fi-fib_nh-nh_oif);
+   NLA_PUT_U32(skb, RTA_OIF, fi-fib_nh-nh_oif);
 #ifdef CONFIG_NET_CLS_ROUTE
if (fi-fib_nh[0].nh_tclassid)
-   RTA_PUT(skb, RTA_FLOW, 4, fi-fib_nh[0].nh_tclassid);
+   NLA_PUT_U32(skb, RTA_FLOW, fi-fib_nh[0].nh_tclassid);
 #endif
}
 #ifdef CONFIG_IP_ROUTE_MULTIPATH
if (fi-fib_nhs  1) {
-   struct rtnexthop *nhp;
-   struct rtattr *mp_head;
-   if (skb_tailroom(skb) = RTA_SPACE(0))
-   goto rtattr_failure;
-   mp_head = (struct rtattr*)skb_put(skb, RTA_SPACE(0));
+   struct rtnexthop *rtnh;
+   struct nlattr *mp;
+
+   mp = nla_nest_start(skb, RTA_MULTIPATH);
+   if (mp == NULL)
+   goto nla_put_failure;
 
for_nexthops(fi) {
-   if (skb_tailroom(skb)  
RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4))
-   goto rtattr_failure;
-   nhp = (struct rtnexthop*)skb_put(skb, 
RTA_ALIGN(sizeof(*nhp)));
-   nhp-rtnh_flags = nh-nh_flags  0xFF;
-   nhp-rtnh_hops = nh-nh_weight-1;
-   nhp-rtnh_ifindex = nh-nh_oif;
+   rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh));
+   if (rtnh == NULL)
+   goto nla_put_failure;
+
+   rtnh-rtnh_flags = nh-nh_flags  0xFF;
+   rtnh-rtnh_hops = nh-nh_weight - 1;
+   rtnh-rtnh_ifindex = nh-nh_oif;
+
if (nh-nh_gw)
-   RTA_PUT(skb, RTA_GATEWAY, 4, nh-nh_gw);
+   NLA_PUT_U32(skb, RTA_GATEWAY, nh-nh_gw);
 #ifdef CONFIG_NET_CLS_ROUTE
if (nh-nh_tclassid)
-   RTA_PUT(skb, RTA_FLOW, 4, nh-nh_tclassid);
+   NLA_PUT_U32(skb, RTA_FLOW, nh-nh_tclassid);
 #endif
-   nhp-rtnh_len = skb-tail - (unsigned char*)nhp;
+   /* length of rtnetlink header + 

[PATCH 3/3] [IPv4]: Convert route get to new netlink api

2006-08-08 Thread Thomas Graf
Fixes various unvalidated netlink attributes causing memory
corruptions when left empty by userspace applications.

Signed-off-by: Thomas Graf [EMAIL PROTECTED]

Index: net-2.6.19.git/include/net/ip_fib.h
===
--- net-2.6.19.git.orig/include/net/ip_fib.h
+++ net-2.6.19.git/include/net/ip_fib.h
@@ -245,6 +245,7 @@ extern void fib_select_default(const str
 #endif /* CONFIG_IP_MULTIPLE_TABLES */
 
 /* Exported by fib_frontend.c */
+extern struct nla_policy rtm_ipv4_policy[];
 extern voidip_fib_init(void);
 extern int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void 
*arg);
 extern int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void 
*arg);
Index: net-2.6.19.git/net/ipv4/fib_frontend.c
===
--- net-2.6.19.git.orig/net/ipv4/fib_frontend.c
+++ net-2.6.19.git/net/ipv4/fib_frontend.c
@@ -433,7 +433,7 @@ int ip_rt_ioctl(unsigned int cmd, void *
 
 #endif
 
-static struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = {
+struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = {
[RTA_DST]   = { .type = NLA_U32 },
[RTA_SRC]   = { .type = NLA_U32 },
[RTA_IIF]   = { .type = NLA_U32 },
Index: net-2.6.19.git/net/ipv4/route.c
===
--- net-2.6.19.git.orig/net/ipv4/route.c
+++ net-2.6.19.git/net/ipv4/route.c
@@ -2736,18 +2736,24 @@ nla_put_failure:
 
 int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
 {
-   struct rtattr **rta = arg;
-   struct rtmsg *rtm = NLMSG_DATA(nlh);
+   struct rtmsg *rtm;
+   struct nlattr *tb[RTA_MAX+1];
struct rtable *rt = NULL;
-   u32 dst = 0;
-   u32 src = 0;
-   int iif = 0;
-   int err = -ENOBUFS;
+   u32 dst, src, iif;
+   int err;
struct sk_buff *skb;
 
+   err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy);
+   if (err  0)
+   goto errout;
+
+   rtm = nlmsg_data(nlh);
+
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
-   if (!skb)
-   goto out;
+   if (skb == NULL) {
+   err = -ENOBUFS;
+   goto errout;
+   }
 
/* Reserve room for dummy headers, this skb can pass
   through good chunk of routing engine.
@@ -2758,62 +2764,64 @@ int inet_rtm_getroute(struct sk_buff *in
skb-nh.iph-protocol = IPPROTO_ICMP;
skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
 
-   if (rta[RTA_SRC - 1])
-   memcpy(src, RTA_DATA(rta[RTA_SRC - 1]), 4);
-   if (rta[RTA_DST - 1])
-   memcpy(dst, RTA_DATA(rta[RTA_DST - 1]), 4);
-   if (rta[RTA_IIF - 1])
-   memcpy(iif, RTA_DATA(rta[RTA_IIF - 1]), sizeof(int));
+   src = tb[RTA_SRC] ? nla_get_u32(tb[RTA_SRC]) : 0;
+   dst = tb[RTA_DST] ? nla_get_u32(tb[RTA_DST]) : 0;
+   iif = tb[RTA_IIF] ? nla_get_u32(tb[RTA_IIF]) : 0;
 
if (iif) {
-   struct net_device *dev = __dev_get_by_index(iif);
-   err = -ENODEV;
-   if (!dev)
-   goto out_free;
+   struct net_device *dev;
+
+   dev = __dev_get_by_index(iif);
+   if (dev == NULL) {
+   err = -ENODEV;
+   goto errout_free;
+   }
+
skb-protocol   = htons(ETH_P_IP);
skb-dev= dev;
+
local_bh_disable();
err = ip_route_input(skb, dst, src, rtm-rtm_tos, dev);
local_bh_enable();
-   rt = (struct rtable*)skb-dst;
-   if (!err  rt-u.dst.error)
+
+   rt = (struct rtable*) skb-dst;
+   if (err == 0  rt-u.dst.error)
err = -rt-u.dst.error;
} else {
-   struct flowi fl = { .nl_u = { .ip4_u = { .daddr = dst,
-.saddr = src,
-.tos = rtm-rtm_tos } 
} };
-   int oif = 0;
-   if (rta[RTA_OIF - 1])
-   memcpy(oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int));
-   fl.oif = oif;
+   struct flowi fl = {
+   .nl_u = {
+   .ip4_u = {
+   .daddr = dst,
+   .saddr = src,
+   .tos = rtm-rtm_tos,
+   },
+   },
+   .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
+   };
+
err = ip_route_output_key(rt, fl);
}
if (err)
-   goto out_free;
+   goto errout_free;
 
skb-dst = rt-u.dst;
if 

[PATCHSET] IPv4 FIB configuration rework

2006-08-08 Thread Thomas Graf
Replaces the rather ugly struct kern_rta + rtmsg with a new
struct fib_config while converting everything to the new netlink
api. Simplifies the FIB module interface quite a bit and allows
changing internals while keeping a stable netlink interface.

Gets rid of things like passing on netlink_skb_parms all around
the fib code etc.

Also fixes some memory corruptions that could be triggered via
netlink messages, not sure which would actually lead to an oops
though.

-
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/3] [IPv4]: FIB configuration using struct fib_config

2006-08-08 Thread Thomas Graf
Introduces struct fib_config replacing the ugly struct kern_rta
prone to ordering issues. Avoids creating faked netlink messages
for auto generated routes or requests via ioctl.

A new interface net/nexthop.h is added to help navigate through
nexthop configuration arrays.

Since the netlink source pid of the requesting process is stored
in fib_config, it is no longer required to pass netlink_skb_parms
all along just for event notification.

Signed-off-by: Thomas Graf [EMAIL PROTECTED]

Index: net-2.6.19.git/include/net/ip_fib.h
===
--- net-2.6.19.git.orig/include/net/ip_fib.h
+++ net-2.6.19.git/include/net/ip_fib.h
@@ -20,25 +20,46 @@
 #include linux/seq_file.h
 #include net/fib_rules.h
 
-/* WARNING: The ordering of these elements must match ordering
- *  of RTA_* rtnetlink attribute numbers.
- */
-struct kern_rta {
-   void*rta_dst;
-   void*rta_src;
-   int *rta_iif;
-   int *rta_oif;
-   void*rta_gw;
-   u32 *rta_priority;
-   void*rta_prefsrc;
-   struct rtattr   *rta_mx;
-   struct rtattr   *rta_mp;
-   unsigned char   *rta_protoinfo;
-   u32 *rta_flow;
-   struct rta_cacheinfo *rta_ci;
-   struct rta_session *rta_sess;
-   u32 *rta_mp_alg;
-};
+struct fib_config {
+   u8  fc_family;
+   u8  fc_dst_len;
+   u8  fc_src_len;
+   u8  fc_tos;
+   u8  fc_protocol;
+   u8  fc_scope;
+   u8  fc_type;
+   /* 1 byte unused */
+   u32 fc_table;
+   u32 fc_flags;
+   u32 fc_dst;
+   u32 fc_src;
+   u32 fc_gw;
+   int fc_oif;
+   u32 fc_priority;
+   u32 fc_prefsrc;
+   struct nlattr   *fc_mx;
+   struct rtnexthop*fc_mp;
+   int fc_mx_len;
+   int fc_mp_len;
+   u32 fc_flow;
+   u32 fc_mp_alg;
+
+   /*
+* Request was issued via netlink, points to netlink header
+* to answer request
+*/
+   struct nlmsghdr *fc_nlh;
+
+   /*
+* Use separate field for netlink flags so non-netlink
+* sources are able to emulate it without providing a
+* complete header.
+*/
+   u32 fc_nlmsg_flags;
+
+   /* Netlink PID of the process requesting the change */
+   u32 fc_pid;
+ };
 
 struct fib_info;
 
@@ -153,12 +174,8 @@ struct fib_table {
unsigned char   tb_id;
unsignedtb_stamp;
int (*tb_lookup)(struct fib_table *tb, const struct flowi 
*flp, struct fib_result *res);
-   int (*tb_insert)(struct fib_table *table, struct rtmsg *r,
-struct kern_rta *rta, struct nlmsghdr *n,
-struct netlink_skb_parms *req);
-   int (*tb_delete)(struct fib_table *table, struct rtmsg *r,
-struct kern_rta *rta, struct nlmsghdr *n,
-struct netlink_skb_parms *req);
+   int (*tb_insert)(struct fib_table *, struct fib_config *);
+   int (*tb_delete)(struct fib_table *, struct fib_config *);
int (*tb_dump)(struct fib_table *table, struct sk_buff *skb,
 struct netlink_callback *cb);
int (*tb_flush)(struct fib_table *table);
@@ -243,8 +260,6 @@ struct rtentry;
 extern int ip_fib_check_default(u32 gw, struct net_device *dev);
 extern int fib_sync_down(u32 local, struct net_device *dev, int force);
 extern int fib_sync_up(struct net_device *dev);
-extern int fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
-  struct kern_rta *rta, struct rtentry *r);
 extern u32  __fib_res_prefsrc(struct fib_result *res);
 
 /* Exported by fib_hash.c */
Index: net-2.6.19.git/net/ipv4/fib_frontend.c
===
--- net-2.6.19.git.orig/net/ipv4/fib_frontend.c
+++ net-2.6.19.git/net/ipv4/fib_frontend.c
@@ -233,42 +233,190 @@ e_inval:
 
 #ifndef CONFIG_IP_NOSIOCRT
 
+static inline u32 sk_extract_addr(struct sockaddr *addr)
+{
+   return ((struct sockaddr_in *) addr)-sin_addr.s_addr;
+}
+
+static int put_rtax(struct nlattr *mx, int len, int type, u32 value)
+{
+   struct nlattr *nla;
+
+   nla = (struct nlattr *) ((char *) mx + len);
+   nla-nla_type = type;
+   nla-nla_len = nla_attr_size(4);
+   *(u32 *) 

Re: [PATCH] limit rt cache size

2006-08-08 Thread akepner

On Tue, 8 Aug 2006, Andi Kleen wrote:



The hash sizing code needs far more tweaks. iirc it can still allocate
several GB hash tables on large memory systems (i've seen that once in 
the boot log  of a 2TB system).  Even on smaller systems it is usually 
too much.


Yes. Linear growth with memory is not a good algorithm for
sizing hashes on a machine with ~TB... SGI has recommended
booting with thash_entries=2097152, but that's often much
bigger than needed, too.



IMHO there needs to be a maximum size (maybe related to the sum of
caches of all CPUs in the system?)

Best would be to fix this for all large system hashes together.


How about using an algorithm like this: up to a certain size
(memory size, cache size,...), scale the hash tables linearly; 
but for larger sizes, scale logarithmically (or approximately

logarithmically)

Code that implements this is below. (It's not perfect, but mostly
works. Just trying to get the idea across) struct hash_sizer
has fields that fix the linear/logarithmic crossover point. And
size_system_hash() recommends the number of hash table entries
based the amount of memory.


#include stdio.h

unsigned long nr_all_pages;
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL  PAGE_SHIFT)

static int 
long_log2 (unsigned long x)

{
int r = 0;
for (x = 1; x  0; x = 1)
r++;
return r;
}

/*
 * scale linearly 64Kibuckets/GiByte up to 1 GiByte,
 * and (sort of) logarithmically thereafter
 */
struct hash_sizer {
unsigned long buckets; /* power of 2 */
unsigned long bytes;   /* multiple of PAGE_SIZE */
} tcp_hash_sizer = {
(1UL  16), /* 64 Kibuckets */
(1UL  30)  /* GiByte */
};

unsigned long 
size_system_hash (struct hash_sizer *hs) 
{

unsigned long size;
unsigned long long slog;
unsigned long scale, tmp;
int log2, i = 0;

if ( nr_all_pages  (hs-bytes/PAGE_SIZE)) {
/* linear scaling */
unsigned long long tmp = nr_all_pages;
tmp *= hs-buckets;
tmp /= (hs-bytes/PAGE_SIZE);
return (unsigned long)tmp;
}

/* logarithmic scaling */
log2 = long_log2(nr_all_pages);
scale  = (1  log2);

slog = log2 * scale;

tmp = nr_all_pages;
tmp = ~(1  log2);

while (tmp) {

i++;
tmp = 1;
if (tmp  (1  log2))
slog += (scale / (1  i));
}

/* slog/scale is approximately log2(nr_all_pages)
 */

size = (hs-buckets * slog)/scale;
size -= hs-buckets * (long_log2(hs-bytes) - PAGE_SHIFT);
size += hs-buckets;

return size;

}

int 
main(void) 
{


unsigned long hash_size;

printf(# nr_all_pages memory_size [bytes] hash_size\n);

for (nr_all_pages = 1; nr_all_pages  (1UL  26);
//nr_all_pages = 1) {
nr_all_pages += 7919) {

hash_size = size_system_hash(tcp_hash_sizer);
printf(  %lu  %llu%lu\n,
nr_all_pages,
(unsigned long long)(nr_all_pages)*PAGE_SIZE,
hash_size);
}

return 0;
}


--
Arthur


-
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


3945 driver using d80211

2006-08-08 Thread Mohamed Abbas

Hi
I am currently working on porting 3945 driver to use d80211. The porting 
is going well, thanks for the great stack. I ran into some problems and 
issues that I had to use some work around to have it functioning. I hope 
I can find the help to point me to right way of using the stack.


1- I needed to use sta_info_get function to do rate scaling for 3945, 
although this function is exported but it was missing from d80211.h, for 
work around I had to copy more header files to my driver's directory, It 
this plan to add this function to d80211.h ?


2- Scanning; in 3945 driver, we can not tune to other channels while we 
are connected, this will cause a firmware error. The firmware provides a 
scanning command we call so the firmware will take care of switching of 
the available channels and gather beacons and probe responses. The 
current d80211 the stack will call config callback to switch to 
different channel and send the probe requests. One of our engineers did 
come up with a patch to add one more callback function if provided the 
d80211 will call this function to allow the registered driver to perform 
the scanning functionalities. For work around I currently check inside 
config callback if the scanning flag set I will issues the scan command 
then ignore the next config callback.


3- I can not access beacon's info from current associated AP. 
information I need to callback into the firmware like timestamp and aid, 
work around I would parse incoming management frame and filter beacon 
from associated AP to get this info. This is a duplicate code that 
d80211 stack doing, maybe there is away to get these info that I don’t 
know of. Also it will be nice to have some callback function on 
association, disassociation.


4- I am been using the driver for sometime right now and it seems to be 
stable and liable although I am using SMP system. I hearted of some SMP 
issues in d80211 and I have the machine and time to help in this. Do you 
have any test script the cause this SMP problems? Or steps to reproduce it.


again thanks alot for the great work on d80211.

Thanks

Mohamed Abbas
-
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: [take5 0/4] kevent: Generic event handling mechanism.

2006-08-08 Thread Zach Brown
Evgeniy Polyakov wrote:
 Generic event handling mechanism.
 
 I send this patchset for comments and review, it still contains AIO and 
 aio_sendfile() implementation on top of get_block() abstraction, which was
 decided to postpone for a while (it is simpler right now to generate patchset 
 as a whole,
 when kevent will be ready for merge, I will generate patchset without AIO 
 stuff).

I think that's the wrong order.  Let's see the clean patch before
deciding to merge it.  Just remove the current aio_sendfile
implementation.  We can build up one that is suitable for merging once
the kevent core is ready for merging.

 Since number of suggested changes goes from 'several' to 'very small', I'm 
 asking for 
 inclusion or declining.

Well, I'm a little confused.  It still seems like we have a long way to
go before having something that we'll want to merge.  There's still
trivial things that need fixing like using LIST_POISON outside list.h
and that nutty 1 second default timeout thing, both previously
mentioned.  Then there's much more fundamental stuff like still
returning events from the _wait() syscall.  I thought the notion was
that the wait syscall would only wait and that events were always to be
collected from the ring.

David, what do you think about the networking calls in here?  Are they
suitable for merging?  I've been assuming that you'll want much more
code re-use, but I don't remember seeing you say either way.

There's also something that's been bugging me that I want to ask the
crowd.  The kevent work is doing the same thing fs/aio.c did: for an API
to support async operation we duplicate its existing system call API.
In fs/aio.c it was IO_CMD_* and struct uiocb members, with kevent it's a
system call like sys_aio_sendfile().  This seems like it might get to be
a little much if we bring async support to much of networking, disk io,
and say timers.  That's a lot of interfaces to duplicate.  Is this the
direction we want to take?  One could imagine doing a wrapper syscall
that might allocate a kevent struct and hang it off task_struct for
subsystems to recognize and work with, but that'd bring different
trade-offs.

 Should I prepare final patchset and what should it include?

Can you address the things I mentioned last time I looked through the
code and remove the parts of the patch that we know aren't going to be
merged?

- z
-
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: 3945 driver using d80211

2006-08-08 Thread Michael Wu
On Tuesday 08 August 2006 14:27, Mohamed Abbas wrote:
 2- Scanning; in 3945 driver, we can not tune to other channels while we
 are connected, this will cause a firmware error. The firmware provides a
 scanning command we call so the firmware will take care of switching of
 the available channels and gather beacons and probe responses. The
 current d80211 the stack will call config callback to switch to
 different channel and send the probe requests. One of our engineers did
 come up with a patch to add one more callback function if provided the
 d80211 will call this function to allow the registered driver to perform
 the scanning functionalities. For work around I currently check inside
 config callback if the scanning flag set I will issues the scan command
 then ignore the next config callback.

I think it would be best if you made the firmware not be aware of a 
connection, and let the d80211 code take care of all the 
scanning/authenticating/associating. Of course, I know nothing about 3945, so 
I don't know if that's possible.

-Michael Wu


pgphdl1a29lmf.pgp
Description: PGP signature


Re: [RFC][PATCH 4/9] e100 driver conversion

2006-08-08 Thread Auke Kok

Peter Zijlstra wrote:

Update the driver to make use of the netdev_alloc_skb() API and the
NETIF_F_MEMALLOC feature.


this should be done in two separate patches. I should take care of the 
netdev_alloc_skb()
part too for e100 (which I've already queued internally), also since ixgb still 
needs it.

do you have any plans to visit ixgb for this change too?

Cheers,

Auke



Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

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

Index: linux-2.6/drivers/net/e100.c
===
--- linux-2.6.orig/drivers/net/e100.c
+++ linux-2.6/drivers/net/e100.c
@@ -1763,7 +1763,7 @@ static inline void e100_start_receiver(s
 #define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
 static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
 {
-   if(!(rx-skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN)))
+   if(!(rx-skb = netdev_alloc_skb(nic-netdev, RFD_BUF_LEN + 
NET_IP_ALIGN)))
return -ENOMEM;
 
 	/* Align, init, and map the RFD. */

@@ -2143,7 +2143,7 @@ static int e100_loopback_test(struct nic
 
 	e100_start_receiver(nic, NULL);
 
-	if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) {

+   if(!(skb = netdev_alloc_skb(nic-netdev, ETH_DATA_LEN))) {
err = -ENOMEM;
goto err_loopback_none;
}
@@ -2573,6 +2573,7 @@ static int __devinit e100_probe(struct p
 #ifdef CONFIG_NET_POLL_CONTROLLER
netdev-poll_controller = e100_netpoll;
 #endif
+   netdev-features |= NETIF_F_MEMALLOC;
strcpy(netdev-name, pci_name(pdev));
 
 	nic = netdev_priv(netdev);

-
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


Re: [RFC][PATCH 4/9] e100 driver conversion

2006-08-08 Thread Peter Zijlstra
On Tue, 2006-08-08 at 13:13 -0700, Auke Kok wrote:
 Peter Zijlstra wrote:
  Update the driver to make use of the netdev_alloc_skb() API and the
  NETIF_F_MEMALLOC feature.
 
 this should be done in two separate patches. I should take care of the 
 netdev_alloc_skb()
 part too for e100 (which I've already queued internally), also since ixgb 
 still needs it.
 
 do you have any plans to visit ixgb for this change too?

Well, all drivers are queued, these were just the ones I have hardware
for in running systems (except wireless).

Since this patch-set is essentially a RFC, your patch will likely hit
mainline ere this one, at that point I'll rebase.

For future patches I'll split up in two if people are so inclined.


-
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][PATCH 3/9] e1000 driver conversion

2006-08-08 Thread Auke Kok

Peter Zijlstra wrote:

Update the driver to make use of the NETIF_F_MEMALLOC feature.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Daniel Phillips [EMAIL PROTECTED]

---
 drivers/net/e1000/e1000_main.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -4020,8 +4020,6 @@ e1000_alloc_rx_buffers(struct e1000_adap
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-		skb-dev = netdev;

-
buffer_info-skb = skb;
buffer_info-length = adapter-rx_buffer_len;
 map_skb:
@@ -4135,8 +4136,6 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-		skb-dev = netdev;

-
buffer_info-skb = skb;
buffer_info-length = adapter-rx_ps_bsize0;
buffer_info-dma = pci_map_single(pdev, skb-data,
-


can we really delete these??

Cheers,

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: [RFC][PATCH 2/9] deadlock prevention core

2006-08-08 Thread Peter Zijlstra
On Tue, 2006-08-08 at 13:57 -0700, Stephen Hemminger wrote:
 On Tue, 08 Aug 2006 21:33:45 +0200
 Peter Zijlstra [EMAIL PROTECTED] wrote:
 
  
  The core of the VM deadlock avoidance framework.
  
  From the 'user' side of things it provides a function to mark a 'struct 
  sock'
  as SOCK_MEMALLOC, meaning this socket may dip into the memalloc reserves on
  the receive side.
  
  From the net_device side of things, the extra 'struct net_device *' argument
  to {,__}netdev_alloc_skb() is used to attribute/account the memalloc usage.
  Converted drivers will make use of this new API and will set 
  NETIF_F_MEMALLOC
  to indicate the driver fully supports this feature.
  
  When a SOCK_MEMALLOC socket is marked, the device is checked for this 
  feature
  and tries to increase the memalloc pool; if both succeed, the device is 
  marked
  with IFF_MEMALLOC, indicating to {,__}netdev_alloc_skb() that it is OK to 
  dip
  into the memalloc pool.
  
  Memalloc sk_buff allocations are not done from the SLAB but are done using 
  alloc_pages(). sk_buff::memalloc records this exception so that 
  kfree_skbmem()
  can do the right thing.
  
  Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
  Signed-off-by: Daniel Phillips [EMAIL PROTECTED]
  
 
 How much of this is just building special case support for large allocations
 for jumbo frames? Wouldn't it make more sense to just fix those drivers to
 do scatter and add the support hooks for that?

Only some of the horrors in __alloc_skb(), esp those related to the
order argument. OTOH, yes I would very much like all the jumbo capable
driver to do proper scather/gather on fragments, alas drivers are not my
storng point.

If someone (preferably the maintainers) will contribute patches

-
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][PATCH 2/9] deadlock prevention core

2006-08-08 Thread Thomas Graf
* Peter Zijlstra [EMAIL PROTECTED] 2006-08-08 21:33
 +struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
 + unsigned length, gfp_t gfp_mask)
 +{
 + struct sk_buff *skb;
 +
 + if (dev  (dev-flags  IFF_MEMALLOC)) {
 + WARN_ON(gfp_mask  (__GFP_NOMEMALLOC | __GFP_MEMALLOC));
 + gfp_mask = ~(__GFP_NOMEMALLOC | __GFP_MEMALLOC);
 +
 + if ((skb = ___netdev_alloc_skb(dev, length,
 +gfp_mask | __GFP_NOMEMALLOC)))
 + goto done;
 + if (dev_reserve_used(dev) = dev-rx_reserve)
 + goto out;
 + if (!(skb = ___netdev_alloc_skb(dev, length,
 + gfp_mask | __GFP_MEMALLOC)))
 + goto out;
 + atomic_inc(dev-rx_reserve_used);
 + } else
 + if (!(skb = ___netdev_alloc_skb(dev, length, gfp_mask)))
 + goto out;
 +
 +done:
 + skb-dev = dev;
 +out:
 + return skb;
 +}
 +

  void __kfree_skb(struct sk_buff *skb)
  {
 + struct net_device *dev = skb-dev;
 +
   dst_release(skb-dst);
  #ifdef CONFIG_XFRM
   secpath_put(skb-sp);
 @@ -389,6 +480,8 @@ void __kfree_skb(struct sk_buff *skb)
  #endif
  
   kfree_skbmem(skb);
 + if (dev  (dev-flags  IFF_MEMALLOC))
 + dev_unreserve_skb(dev);
  }

skb-dev is not guaranteed to still point to the allocating device
once the skb is freed again so reserve/unreserve isn't symmetric.
You'd need skb-alloc_dev or something.
-
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][PATCH 3/9] e1000 driver conversion

2006-08-08 Thread Peter Zijlstra
On Tue, 2006-08-08 at 13:50 -0700, Auke Kok wrote:
 Peter Zijlstra wrote:
  Update the driver to make use of the NETIF_F_MEMALLOC feature.
  
  Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
  Signed-off-by: Daniel Phillips [EMAIL PROTECTED]
  
  ---
   drivers/net/e1000/e1000_main.c |   11 +--
   1 file changed, 5 insertions(+), 6 deletions(-)
  
  Index: linux-2.6/drivers/net/e1000/e1000_main.c
  ===
  --- linux-2.6.orig/drivers/net/e1000/e1000_main.c
  +++ linux-2.6/drivers/net/e1000/e1000_main.c
  @@ -4020,8 +4020,6 @@ e1000_alloc_rx_buffers(struct e1000_adap
   */
  skb_reserve(skb, NET_IP_ALIGN);
   
  -   skb-dev = netdev;
  -
  buffer_info-skb = skb;
  buffer_info-length = adapter-rx_buffer_len;
   map_skb:
  @@ -4135,8 +4136,6 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
   */
  skb_reserve(skb, NET_IP_ALIGN);
   
  -   skb-dev = netdev;
  -
  buffer_info-skb = skb;
  buffer_info-length = adapter-rx_ps_bsize0;
  buffer_info-dma = pci_map_single(pdev, skb-data,
  -
 
 can we really delete these??

The new {,__}netdev_alloc_skb() will set it when the allocation
succeeds.

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