Re: TCP Westwood+ patches
From: Stephen Hemminger [EMAIL PROTECTED] Date: Tue, 6 Jun 2006 11:53:06 -0700 I cleaned these up and put them in a git tree. All 4 patches are in my tree now. Thanks Stephen. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ PATCH 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
Quoting David Miller: | | Fix: Move the `UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS)' statement from | udp_queue_rcv_skb to udp_recvmsg. Now InDatagrams only counts those | datagrams which were really delivered (as per RFC 2013). | | | Unfortunately this breaks NFS and other in-kernel UDP socket usages, | which never call recvmsg() and instead take the packet via the | -data_ready() callback done by sock_queue_receive_skb(). | | Your patch will make the counter never get incremented when such | a user is using the UDP socket. | | Probably a better way to handle this is to correct the | INDATAGRAMS value by decrementing it when we notice that | the checksum is incorrect in a deferred manner. This is clearly preferable - would it look like this: csum_copy_err: UDP_INC_STATS_BH(UDP_MIB_INERRORS); UDP_DEC_STATS_BH(UDP_MIB_INDATAGRAMS); /* requires new macro */ skb_kill_datagram(sk, skb, flags); /* ... */ in udp_recvmsg? Here I must pass - there is no xxx_DEC_BH macro in include/net/snmp.h and I don't know whether the following guess is correct: #define SNMP_DEC_STATS_BH(mib, field) \ (per_cpu_ptr(mib[0], raw_smp_processor_id())-mibs[field]--) If this is correct, then it seems done; one could use this macro or add a corresponding UDP_DEC_STATS_BH to include/net/udp.h . - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ PATCH 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
From: Gerrit Renker [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 07:02:45 +0100 This is clearly preferable - would it look like this: csum_copy_err: UDP_INC_STATS_BH(UDP_MIB_INERRORS); UDP_DEC_STATS_BH(UDP_MIB_INDATAGRAMS); /* requires new macro */ skb_kill_datagram(sk, skb, flags); /* ... */ in udp_recvmsg? Here I must pass - there is no xxx_DEC_BH macro in include/net/snmp.h and I don't know whether the following guess is correct: #define SNMP_DEC_STATS_BH(mib, field) \ (per_cpu_ptr(mib[0], raw_smp_processor_id())-mibs[field]--) If this is correct, then it seems done; one could use this macro or add a corresponding UDP_DEC_STATS_BH to include/net/udp.h . The index of mib[] in those macros is always !in_softirq(), the *_BH() variants use zero for the index because they are called in contexts where we know that !in_sortirq() evaluates to false. So your SNMP_DEC_STATS_BH() macro is correct. Can you cook up the patch, which adds your SNMP_DEC_STATS_BH() macro, the UDP_DEC_STATS_BH counterpart, and the change that uses it in net/ipv4/udp.c? I'd appreciate this, thanks a lot. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ PATCH 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
David Miller [EMAIL PROTECTED] wrote: Probably a better way to handle this is to correct the INDATAGRAMS value by decrementing it when we notice that the checksum is incorrect in a deferred manner. I think sunrpc should instead increment the appropriate counters directly as otherwise checksum errors won't be recorded correctly for sunrpc packets. 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 2.6.17-rc6] Remove Prism II support from Orinoco
On Sun, Jun 11, 2006 at 06:40:54PM -0400, Dave Jones wrote: Ah-ha, I had tested the wrong card. I also have a Sitecom card, which matches this ident you remove in your patch.. PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */ snip So with your patch, this card will become totally useless to me. I think you should forward this bug to the HostAP maintainer. This should be either be fixed in the driver or the driver should stop claiming that it supports this card. I merely found the duplicate IDs and removed them from Orinoco. I don't have neither the hardware or the time to test 30+ cards... Having two drivers supporting the same set of hardware seems pretty pointless to me. Plus, it confuses hotplugging/automatic detection. Regards, Faidon - 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.17-rc5-mm3-lockdep -
* Herbert Xu [EMAIL PROTECTED] wrote: On Tue, Jun 06, 2006 at 04:39:21PM +, Stefan Richter wrote: BTW, the locking in -mm's net/unix/af_unix.c::unix_stream_connect() differs a bit from stock unix_stream_connect(). I see spin_lock_bh() in 2.6.17-rc5-mm3 where 2.6.17-rc5 has spin_lock(). Hi Ingo: Looks like this change was introduced by the validator patch. Any idea why this was done? AF_UNIX is a user-space-driven socket so there shouldn't be any need for BH to be disabled there. yeah. I'll investigate - it's quite likely that sk_receive_queue.lock will have to get per-address family locking rules - right? Maybe it's enough to introduce a separate key for AF_UNIX alone (and still having all other protocols share the locking rules for sk_receive_queue.lock) , by reinitializing its spinlock after sock_init_data()? Ingo - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.17-rc5-mm3-lockdep -
On Mon, Jun 12, 2006 at 08:38:07AM +0200, Ingo Molnar wrote: yeah. I'll investigate - it's quite likely that sk_receive_queue.lock will have to get per-address family locking rules - right? Yes that's the issue. Maybe it's enough to introduce a separate key for AF_UNIX alone (and still having all other protocols share the locking rules for sk_receive_queue.lock) , by reinitializing its spinlock after sock_init_data()? This could work. AF_UNIX is probably the only family that does not interact with hardware. 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 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
From: Herbert Xu [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 16:18:09 +1000 David Miller [EMAIL PROTECTED] wrote: Probably a better way to handle this is to correct the INDATAGRAMS value by decrementing it when we notice that the checksum is incorrect in a deferred manner. I think sunrpc should instead increment the appropriate counters directly as otherwise checksum errors won't be recorded correctly for sunrpc packets. Yeah. Good point. But how much protocol internals do we want to slide into the -data_ready() callbacks of such layers? That's ugly and something we should try to avoid. - 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.17-rc5-mm3-lockdep -
From: Ingo Molnar [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 08:38:07 +0200 yeah. I'll investigate - it's quite likely that sk_receive_queue.lock will have to get per-address family locking rules - right? That's right. Maybe it's enough to introduce a separate key for AF_UNIX alone (and still having all other protocols share the locking rules for sk_receive_queue.lock) , by reinitializing its spinlock after sock_init_data()? AF_NETLINK and/or AF_PACKET might be in a similar situation as AF_UNIX. - 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] undo AF_UNIX _bh locking changes and split lock-type instead
* Herbert Xu [EMAIL PROTECTED] wrote: Maybe it's enough to introduce a separate key for AF_UNIX alone (and still having all other protocols share the locking rules for sk_receive_queue.lock) , by reinitializing its spinlock after sock_init_data()? This could work. AF_UNIX is probably the only family that does not interact with hardware. ok, great. The patch below does the trick on my box. regarding your point wrt. path of integration - it is pretty much the only practical way to do this centrally as part of the lock validator patches, but to collect ACKs from subsystem maintainers in the process. So if you like it i'd like to have your ACK but this patch depends on the other lock validator patches (and only makes sense together with them), so they should temporarily stay in the lock validator queue. Hopefully this wont be a state that lasts too long and once the validator is upstream, all patches of course go via the subsystem submission rules. (the #ifdef LOCKDEP should probably be converted to some sort of lockdep_split_lock_key(sk-sk_receive_queue.lock) op - i'll do that later) Ingo -- Subject: undo AF_UNIX _bh locking changes and split lock-type instead From: Ingo Molnar [EMAIL PROTECTED] this cleans up lock-validator-special-locking-af_unix.patch: instead of adding _bh locking to AF_UNIX, this patch splits their sk_receive_queue.lock type from the other networking skb-queue locks. Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- net/unix/af_unix.c | 17 + net/unix/garbage.c |8 2 files changed, 17 insertions(+), 8 deletions(-) Index: linux/net/unix/af_unix.c === --- linux.orig/net/unix/af_unix.c +++ linux/net/unix/af_unix.c @@ -557,6 +557,15 @@ static struct sock * unix_create1(struct atomic_inc(unix_nr_socks); sock_init_data(sock,sk); +#ifdef CONFIG_LOCKDEP + /* +* AF_UNIX sockets do not interact with hardware, hence they +* dont trigger interrupts - so it's safe for them to have +* bh-unsafe locking for their sk_receive_queue.lock. Split off +* this special lock-type by reinitializing the spinlock. +*/ + spin_lock_init(sk-sk_receive_queue.lock); +#endif sk-sk_write_space = unix_write_space; sk-sk_max_ack_backlog = sysctl_unix_max_dgram_qlen; @@ -1073,12 +1082,12 @@ restart: unix_state_wunlock(sk); /* take ten and and send info to listening sock */ - spin_lock_bh(other-sk_receive_queue.lock); + spin_lock(other-sk_receive_queue.lock); __skb_queue_tail(other-sk_receive_queue, skb); /* Undo artificially decreased inflight after embrion * is installed to listening socket. */ atomic_inc(newu-inflight); - spin_unlock_bh(other-sk_receive_queue.lock); + spin_unlock(other-sk_receive_queue.lock); unix_state_runlock(other); other-sk_data_ready(other, 0); sock_put(other); @@ -1843,7 +1852,7 @@ static int unix_ioctl(struct socket *soc break; } - spin_lock_bh(sk-sk_receive_queue.lock); + spin_lock(sk-sk_receive_queue.lock); if (sk-sk_type == SOCK_STREAM || sk-sk_type == SOCK_SEQPACKET) { skb_queue_walk(sk-sk_receive_queue, skb) @@ -1853,7 +1862,7 @@ static int unix_ioctl(struct socket *soc if (skb) amount=skb-len; } - spin_unlock_bh(sk-sk_receive_queue.lock); + spin_unlock(sk-sk_receive_queue.lock); err = put_user(amount, (int __user *)arg); break; } Index: linux/net/unix/garbage.c === --- linux.orig/net/unix/garbage.c +++ linux/net/unix/garbage.c @@ -235,7 +235,7 @@ void unix_gc(void) struct sock *x = pop_stack(); struct sock *sk; - spin_lock_bh(x-sk_receive_queue.lock); + spin_lock(x-sk_receive_queue.lock); skb = skb_peek(x-sk_receive_queue); /* @@ -270,7 +270,7 @@ void unix_gc(void) maybe_unmark_and_push(skb-sk); skb=skb-next; } - spin_unlock_bh(x-sk_receive_queue.lock); + spin_unlock(x-sk_receive_queue.lock); sock_put(x); } @@ -283,7 +283,7 @@ void unix_gc(void) if (u-gc_tree == GC_ORPHAN) { struct sk_buff *nextsk; - spin_lock_bh(s-sk_receive_queue.lock); + spin_lock(s-sk_receive_queue.lock);
Re: [patch] undo AF_UNIX _bh locking changes and split lock-type instead
On Mon, Jun 12, 2006 at 08:57:01AM +0200, Ingo Molnar wrote: regarding your point wrt. path of integration - it is pretty much the only practical way to do this centrally as part of the lock validator patches, but to collect ACKs from subsystem maintainers in the process. So if you like it i'd like to have your ACK but this patch depends on the other lock validator patches (and only makes sense together with them), so they should temporarily stay in the lock validator queue. Hopefully this wont be a state that lasts too long and once the validator is upstream, all patches of course go via the subsystem submission rules. Obviously as long as Dave is happy with it then it's fine. However, it's probably a good idea to cc netdev for relevant patches so that they get a wider review. If you've already sent this one there then I apologise for missing it :) (the #ifdef LOCKDEP should probably be converted to some sort of lockdep_split_lock_key(sk-sk_receive_queue.lock) op - i'll do that later) Cool. Thanks, -- 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] undo AF_UNIX _bh locking changes and split lock-type instead
From: Herbert Xu [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:03:56 +1000 On Mon, Jun 12, 2006 at 08:57:01AM +0200, Ingo Molnar wrote: regarding your point wrt. path of integration - it is pretty much the only practical way to do this centrally as part of the lock validator patches, but to collect ACKs from subsystem maintainers in the process. So if you like it i'd like to have your ACK but this patch depends on the other lock validator patches (and only makes sense together with them), so they should temporarily stay in the lock validator queue. Hopefully this wont be a state that lasts too long and once the validator is upstream, all patches of course go via the subsystem submission rules. Obviously as long as Dave is happy with it then it's fine. However, it's probably a good idea to cc netdev for relevant patches so that they get a wider review. If you've already sent this one there then I apologise for missing it :) Yes, this is fine with me. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ PATCH 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
The code below implements the discussed solution of decrementing InDatagrams if a datagram fails the checksum within udp_recvmsg(). I have given it a quick test / build and checked the outcome against previous results: I now obtained correct counter values, i.e. the application counted exactly InDatagrams datagrams, whereas with the same settings before this was not the case (datagrams with checksum errors were counted both as InErrors and as InDatagrams). Will add this patch to http://bugzilla.kernel.org/show_bug.cgi?id=6660 where this problem is also described. Patches under 2.6.16 with no complaints. Signed-off-by: Gerrit Renker [EMAIL PROTECTED] --- include/net/snmp.h |2 ++ include/net/udp.h |1 + net/ipv4/udp.c |1 + 3 files changed, 4 insertions(+) diff -Nurp a/include/net/snmp.h b/include/net/snmp.h --- a/include/net/snmp.h2006-06-05 21:52:55.0 +0100 +++ b/include/net/snmp.h2006-06-12 07:38:11.0 +0100 @@ -137,6 +137,8 @@ struct linux_mib { (per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())-mibs[field]++) #define SNMP_DEC_STATS(mib, field) \ (per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())-mibs[field]--) +#define SNMP_DEC_STATS_BH(mib, field) \ + (per_cpu_ptr(mib[0], raw_smp_processor_id())-mibs[field]--) #define SNMP_ADD_STATS_BH(mib, field, addend) \ (per_cpu_ptr(mib[0], raw_smp_processor_id())-mibs[field] += addend) #define SNMP_ADD_STATS_USER(mib, field, addend)\ diff -Nurp a/include/net/udp.h b/include/net/udp.h --- a/include/net/udp.h 2006-06-06 18:04:36.0 +0100 +++ b/include/net/udp.h 2006-06-12 07:39:29.0 +0100 @@ -78,6 +78,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udp_st #define UDP_INC_STATS(field) SNMP_INC_STATS(udp_statistics, field) #define UDP_INC_STATS_BH(field) SNMP_INC_STATS_BH(udp_statistics, field) #define UDP_INC_STATS_USER(field) SNMP_INC_STATS_USER(udp_statistics, field) +#define UDP_DEC_STATS_BH(field) SNMP_DEC_STATS_BH(udp_statistics, field) /* /proc */ struct udp_seq_afinfo { diff -Nurp a/net/ipv4/udp.c b/net/ipv4/udp.c --- a/net/ipv4/udp.c2006-06-07 20:44:13.0 +0100 +++ b/net/ipv4/udp.c2006-06-12 07:40:02.0 +0100 @@ -846,6 +846,7 @@ out: csum_copy_err: UDP_INC_STATS_BH(UDP_MIB_INERRORS); + UDP_DEC_STATS_BH(UDP_MIB_INDATAGRAMS); skb_kill_datagram(sk, skb, flags); - 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 3/5] ehea: queue management
John Rose wrote: +#define EHEA_MEM_START 0xc000 You probably don't want to hardcode this. Maybe KERNELBASE from page.h? Yes, we want to use KERNELBASE + +int ehea_reg_mr_adapter(struct ehea_adapter *adapter) +{ + } This creates DMA mappings for the entirety of kernel memory, right? Has this been run by the ppc64 folks for possible impacts? Yes, that is correct. We have tested it on our ppc64 without running into any problems. There should be no impacts on other kernel parts, but we haven't talked to the ppc64 folks yet. Jan-Bernd - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ PATCH 2.6.17-rc6 1/1] udp.c: counting InDatagrams which are never delivered
On Sun, Jun 11, 2006 at 11:49:05PM -0700, David Miller wrote: Yeah. Good point. But how much protocol internals do we want to slide into the -data_ready() callbacks of such layers? That's ugly and something we should try to avoid. I agree with the objective of minimising the exposure of internals. However, in this particular instance we're already exposing much more than a couple of UDP SNMP counters in the sunrpc code. This makes adjusting the counters there the most expedient course of action. Longer term we probably want to restructure the code a bit so that more if it moves to udp.c. 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: MIB ipInHdrErrors error
On Mon, 2006-06-12 at 15:24 +0800, Wei Dong wrote: Also, when kernel receives an IP packet and need to forward, but TTL=1 or TTL=0, kernel just sends an ICMP packet to inform the sender TTL count exceeded, and doesn't increase this counter. This part of your change seems correct, please just resubmit this part. The following is the latest patch for MIB ipIHdrErrors. diff -ruN old/net/ipv4/ip_forward.c new/net/ipv4/ip_forward.c --- old/net/ipv4/ip_forward.c 2006-06-06 13:56:48.0 +0800 +++ new/net/ipv4/ip_forward.c 2006-06-12 15:11:04.0 +0800 @@ -120,6 +120,7 @@ too_many_hops: /* Tell the sender its packet died... */ +IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0); drop: kfree_skb(skb); Signed-off-by: Weidong [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] undo AF_UNIX _bh locking changes and split lock-type instead
* Ingo Molnar [EMAIL PROTECTED] wrote: (the #ifdef LOCKDEP should probably be converted to some sort of lockdep_split_lock_key(sk-sk_receive_queue.lock) op - i'll do that later) i've added such an op, lockdep_reinit_lock_key() - this makes the patch cleaner: -- Subject: undo AF_UNIX _bh locking changes and split lock-type From: Ingo Molnar [EMAIL PROTECTED] this cleans up lock-validator-special-locking-af_unix.patch: instead of adding _bh locking to AF_UNIX, this patch splits their sk_receive_queue.lock type from the other networking skb-queue locks. Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- net/unix/af_unix.c | 18 ++ net/unix/garbage.c |8 2 files changed, 18 insertions(+), 8 deletions(-) Index: linux/net/unix/af_unix.c === --- linux.orig/net/unix/af_unix.c +++ linux/net/unix/af_unix.c @@ -542,6 +542,14 @@ static struct proto unix_proto = { .obj_size = sizeof(struct unix_sock), }; +/* + * AF_UNIX sockets do not interact with hardware, hence they + * dont trigger interrupts - so it's safe for them to have + * bh-unsafe locking for their sk_receive_queue.lock. Split off + * this special lock-type by reinitializing the spinlock key: + */ +static struct lockdep_type_key af_unix_sk_receive_queue_lock_key; + static struct sock * unix_create1(struct socket *sock) { struct sock *sk = NULL; @@ -557,6 +565,8 @@ static struct sock * unix_create1(struct atomic_inc(unix_nr_socks); sock_init_data(sock,sk); + lockdep_reinit_lock_key(sk-sk_receive_queue.lock, + af_unix_sk_receive_queue_lock_key); sk-sk_write_space = unix_write_space; sk-sk_max_ack_backlog = sysctl_unix_max_dgram_qlen; @@ -1073,12 +1083,12 @@ restart: unix_state_wunlock(sk); /* take ten and and send info to listening sock */ - spin_lock_bh(other-sk_receive_queue.lock); + spin_lock(other-sk_receive_queue.lock); __skb_queue_tail(other-sk_receive_queue, skb); /* Undo artificially decreased inflight after embrion * is installed to listening socket. */ atomic_inc(newu-inflight); - spin_unlock_bh(other-sk_receive_queue.lock); + spin_unlock(other-sk_receive_queue.lock); unix_state_runlock(other); other-sk_data_ready(other, 0); sock_put(other); @@ -1843,7 +1853,7 @@ static int unix_ioctl(struct socket *soc break; } - spin_lock_bh(sk-sk_receive_queue.lock); + spin_lock(sk-sk_receive_queue.lock); if (sk-sk_type == SOCK_STREAM || sk-sk_type == SOCK_SEQPACKET) { skb_queue_walk(sk-sk_receive_queue, skb) @@ -1853,7 +1863,7 @@ static int unix_ioctl(struct socket *soc if (skb) amount=skb-len; } - spin_unlock_bh(sk-sk_receive_queue.lock); + spin_unlock(sk-sk_receive_queue.lock); err = put_user(amount, (int __user *)arg); break; } Index: linux/net/unix/garbage.c === --- linux.orig/net/unix/garbage.c +++ linux/net/unix/garbage.c @@ -235,7 +235,7 @@ void unix_gc(void) struct sock *x = pop_stack(); struct sock *sk; - spin_lock_bh(x-sk_receive_queue.lock); + spin_lock(x-sk_receive_queue.lock); skb = skb_peek(x-sk_receive_queue); /* @@ -270,7 +270,7 @@ void unix_gc(void) maybe_unmark_and_push(skb-sk); skb=skb-next; } - spin_unlock_bh(x-sk_receive_queue.lock); + spin_unlock(x-sk_receive_queue.lock); sock_put(x); } @@ -283,7 +283,7 @@ void unix_gc(void) if (u-gc_tree == GC_ORPHAN) { struct sk_buff *nextsk; - spin_lock_bh(s-sk_receive_queue.lock); + spin_lock(s-sk_receive_queue.lock); skb = skb_peek(s-sk_receive_queue); while (skb skb != (struct sk_buff *)s-sk_receive_queue) { @@ -298,7 +298,7 @@ void unix_gc(void) } skb = nextsk; } - spin_unlock_bh(s-sk_receive_queue.lock); + spin_unlock(s-sk_receive_queue.lock); } u-gc_tree = GC_ORPHAN; } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL
Re: [RFT] Realtek 8168 ethernet support
On 12/06/06 01:30, Francois Romieu wrote: The patch below agaisnt 2.6.17-rc6 includes the following changes: Just FYI: I just tried this patch set, but it doesn't do anything for the freeze at high speed I mentioned on 2006-06-09. It still locks up. (As an additional data point: I installed win2k on this machine, and it seems to have no problems transferring at high speeds. Just wanted to try to rule out faulty hardware.) Thanks, -- Mourad DC - 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] bcm43xx: suspend MAC while executing long pwork
Hi John, Please queue this for 2.6.18. -- Suspend MAC (and make MAC-suspend refcounting) when doing long periodic work. On long periodic work, we disable IRQs on the device, so we don't want the MAC to stay operating and probably miss packets due do non-delivery of interrupts. Signed-off-by: Michael Buesch [EMAIL PROTECTED] Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h === --- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx.h2006-06-05 18:19:59.0 +0200 +++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h 2006-06-12 16:20:28.0 +0200 @@ -723,6 +723,8 @@ u32 irq_savedstate; /* Link Quality calculation context. */ struct bcm43xx_noise_calculation noisecalc; + /* if 0 MAC is suspended. if == 0 MAC is enabled. */ + int mac_suspended; /* Threshold values. */ //TODO: The RTS thr has to be _used_. Currently, it is only set via WX. Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c 2006-06-05 20:17:36.0 +0200 +++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c2006-06-12 16:41:41.0 +0200 @@ -2284,13 +2284,17 @@ /* http://bcm-specs.sipsolutions.net/EnableMac */ void bcm43xx_mac_enable(struct bcm43xx_private *bcm) { - bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, - bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) - | BCM43xx_SBF_MAC_ENABLED); - bcm43xx_write32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON, BCM43xx_IRQ_READY); - bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); /* dummy read */ - bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ - bcm43xx_power_saving_ctl_bits(bcm, -1, -1); + bcm-mac_suspended--; + assert(bcm-mac_suspended = 0); + if (bcm-mac_suspended == 0) { + bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, + bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) + | BCM43xx_SBF_MAC_ENABLED); + bcm43xx_write32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON, BCM43xx_IRQ_READY); + bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); /* dummy read */ + bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ + bcm43xx_power_saving_ctl_bits(bcm, -1, -1); + } } /* http://bcm-specs.sipsolutions.net/SuspendMAC */ @@ -2299,18 +2303,23 @@ int i; u32 tmp; - bcm43xx_power_saving_ctl_bits(bcm, -1, 1); - bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, - bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) -~BCM43xx_SBF_MAC_ENABLED); - bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ - for (i = 10; i; i--) { - tmp = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); - if (tmp BCM43xx_IRQ_READY) - return; - udelay(10); + assert(bcm-mac_suspended = 0); + if (bcm-mac_suspended == 0) { + bcm43xx_power_saving_ctl_bits(bcm, -1, 1); + bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, + bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) +~BCM43xx_SBF_MAC_ENABLED); + bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ + for (i = 10; i; i--) { + tmp = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); + if (tmp BCM43xx_IRQ_READY) + goto out; + udelay(10); + } + printkl(KERN_ERR PFX MAC suspend failed\n); } - printkl(KERN_ERR PFX MAC suspend failed\n); +out: + bcm-mac_suspended++; } void bcm43xx_set_iwmode(struct bcm43xx_private *bcm, @@ -3168,8 +3177,10 @@ /* Periodic work will take a long time, so we want it to * be preemtible. */ - bcm43xx_lock_irqonly(bcm, flags); netif_stop_queue(bcm-net_dev); + synchronize_net(); + bcm43xx_lock_irqonly(bcm, flags); + bcm43xx_mac_suspend(bcm); if (bcm43xx_using_pio(bcm)) bcm43xx_pio_freeze_txqueues(bcm); savedirqs = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); @@ -3192,6 +3203,7 @@ bcm43xx_interrupt_enable(bcm, savedirqs); if (bcm43xx_using_pio(bcm)) bcm43xx_pio_thaw_txqueues(bcm); + bcm43xx_mac_enable(bcm); }
Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
On Mon, Jun 12, 2006 at 01:49:54AM +0300, Faidon Liambotis wrote: Having two drivers supporting the same set of hardware seems pretty pointless to me. Plus, it confuses hotplugging/automatic detection. This subject comes-up from time to time. In fact, I'm pretty sure it came-up very recently w.r.t. orinoco and hostap. The consensus seems to be that drivers should have IDs for all devices they support, even if that means that some devices are supported by multiple drivers. This leaves the choice of which driver to use in the hands of the user and/or distro. If the Orinoco guys want this patch, I'll consider it. Otherwise, I'm not inclined to take it. 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: [PATCH] netpoll: break recursive loop in netpoll rx path
On Mon, Jun 12, 2006 at 11:40:29AM -0400, Neil Horman wrote: Hey there- the netpoll system currently has a rx to tx path via: netpoll_rx __netpoll_rx arp_reply netpoll_send_skb dev-hard_start_tx This rx-tx loop places network drivers at risk of inadvertently causing a deadlock or BUG halt by recursively trying to acquire a spinlock that is used in both their rx and tx paths (this problem was origionally reported to me in the 3c59x driver, which shares a spinlock between the boomerang_interrupt and boomerang_start_xmit routines). Grumble. This patch breaks this loop, by queueing arp frames, so that they can be responded to after all receive operations have been completed. Tested by myself and the reported with successful results. Tested how? kgdb? + if (likely(npi)) + while ((skb = skb_dequeue(npi-arp_tx)) != NULL) + arp_reply(skb); + Assignment inside tests is frowned upon. I'd prefer pulling this out to its own function too. Mathematics is the supreme nostalgia of our time. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using netconsole for debugging suspend/resume
Andi Kleen wrote: On Friday 09 June 2006 17:24, Mark Lord wrote: Andi Kleen wrote: If your laptop has firewire you can also use firescope. (ftp://ftp.suse.com/pub/people/ak/firescope/) .. FW keeps running as long as nobody resets the ieee1394 chip. This looks interesting. But how does one set it up for use on the *other* end of that firewire cable? The Quickstart and manpage don't seem to describe this fully. It's in the manpage: .SH NOTES The target must have the ohci1394 driver loaded. This implies that firescope cannot be used in early boot. That's it. Okay, so I'm daft. But.. *what* is it ?? We have two machines: target (being debugged), and host (anything). Sure, the target has to have ohci1394 loaded, and firescope running. But what about the *other* end of the connection? What commands? 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: Using netconsole for debugging suspend/resume
On Monday 12 June 2006 17:38, Mark Lord wrote: Andi Kleen wrote: On Friday 09 June 2006 17:24, Mark Lord wrote: Andi Kleen wrote: If your laptop has firewire you can also use firescope. (ftp://ftp.suse.com/pub/people/ak/firescope/) .. FW keeps running as long as nobody resets the ieee1394 chip. This looks interesting. But how does one set it up for use on the *other* end of that firewire cable? The Quickstart and manpage don't seem to describe this fully. It's in the manpage: .SH NOTES The target must have the ohci1394 driver loaded. This implies that firescope cannot be used in early boot. That's it. Okay, so I'm daft. But.. *what* is it ?? We have two machines: target (being debugged), and host (anything). Sure, the target has to have ohci1394 loaded, and firescope running. But what about the *other* end of the connection? What commands? From the same manpage: The raw1394 module must be loaded and its device node be writable (this normally requires root) Ok it doesn't say you need ohci1394 too and doesn't say that's the target. If I do a new revision I'll perhaps expand the docs a bit. So load ohci1394/raw1394 and run firescope as root. Your distribution will hopefully take care of the device nodes. Usually you want something like firescope -Au System.map -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] wan/sdla section fixes
On Mon, 12 Jun 2006 19:50:22 +0200 Krzysztof Halasa wrote: Hi, Randy.Dunlap [EMAIL PROTECTED] writes: Priority: tossup. netdev-set_config can be called at any time, so these references to __initdata would be a real problem. However, problem has not been observed AFAIK. Fix section mismatch warnings: WARNING: drivers/net/wan/sdla.o - Section mismatch: reference to .init.data: from .text between 'sdla_set_config' (at offset 0x1b8e) and 'sdla_stats' WARNING: drivers/net/wan/sdla.o - Section mismatch: reference to .init.data: from .text between 'sdla_set_config' (at offset 0x1e76) and 'sdla_stats' Is sdla.c still in use? I remember someone mentioned that Sangoma drivers are now outside the kernel but I don't know how do they relate to sdla.c and friend(s). No idea. static const char* version = SDLA driver v0.30, 12 Sep 1996, [EMAIL PROTECTED]; 1996 doesn't look encouraging but it may be misleading. Yep. You could ignore it :) or rm drivers/net/wan/slda* :) --- ~Randy - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] e1000: fix netpoll with NAPI
On Mon, Jun 12, 2006 at 09:42:14AM -0700, Mitch Williams wrote: On Sun, 2006-06-11 at 17:13 -0700, Neil Horman wrote: Any further thoughts on this guys? I still think my last solution solves all of the netpoll problems, and isn't going to have any noticable impact on performance. I haven't had time to evaluate performance on your patch (sorry!), but after thinking about it, I agree that it should not have any noticeable impact. OTOH, performance tuning is a funny thing, and things you think won't cause problems often do. Thats ok, I just didn't hear out of anyone on friday, so I was curious as to where we were on this. I don't have the ability to do any real world performance testing here, but I'll try to record the run time of the interrupt routine on a limited number of frames here. Anyway, I'm still not quite ready to ACK this because it's just not future-proof. Eventually, we will need to support multiple RX queues, and this solution will not work in that situation. Not sure I understand this. My patch: http://marc.theaimsgroup.com/?l=linux-netdevm=114970506406155w=2 still allows for the use of multiple rx queues in the nominal case. Only when we have to use a relatively slow netpoll driven operation (kgdb, netdump, etc), do we need to receive on the same interface that we transmit on. A simpler short-term solution is just to schedule our NAPI polling on the real netdev instead of our polling netdev. This is a trivial change and works correctly with a single queue. But, like your patch, it isn't future-proof. Again, not sure what you mean here. My last patch proposal: http://marc.theaimsgroup.com/?l=linux-netdevm=114970807606096w=2 Does precisely what you describe, but it still allows for multiple rx queues in the nominal (non poll_controller driven) receive case. So, I'm still thinking and pondering on this one. If we get a patch in to fix the recursive loop in netpoll, my original patch will work, right? Or is there still another issue? I assume you are referring to this patch: http://marc.theaimsgroup.com/?l=linux-netdevm=114970506406155w=2 If so, then no, that patch is still broken for the reasons Jeff outlined previously, The recursion patch that I proposed earlier today is related to a different recursion problem, and while the e1000 driver might be suceptable to it, your patch is also suceptible to the data corruption that arises from when the poll_controller calls adapter-clean_rx at the same that that dev-poll is called for the same adapter on another cpu. If that happens we can have two cpu's writing to the same private net_device data without the benefit of a spinlock to protect them. And yes, you can add a spin lock to protect the case where you have a dev-poll_controller and a dev-poll operation at the same time, but that seems to me like it will also re-serialize all the parallel operations that you could otherwise do with multiple rx queues I'll post again if I get a chance to do some performance measurements Regrds Neil -Mitch - 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 -- /*** *Neil Horman *Software Engineer *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu ***/ - 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 v2 1/2] iWARP Connection Manager.
Andrew, thanks for the review, comments inline... On Thu, 2006-06-08 at 00:54 -0700, Andrew Morton wrote: On Wed, 07 Jun 2006 15:06:05 -0500 Steve Wise [EMAIL PROTECTED] wrote: This patch provides the new files implementing the iWARP Connection Manager. Review Changes: - sizeof - sizeof() - removed printks - removed TT debug code - cleaned up lock/unlock around switch statements. - waitqueue - completion for destroy path. ... +/* + * This function is called on interrupt context. Schedule events on + * the iwcm_wq thread to allow callback functions to downcall into + * the CM and/or block. Events are queued to a per-CM_ID + * work_list. If this is the first event on the work_list, the work + * element is also queued on the iwcm_wq thread. + * + * Each event holds a reference on the cm_id. Until the last posted + * event has been delivered and processed, the cm_id cannot be + * deleted. + */ +static void cm_event_handler(struct iw_cm_id *cm_id, +struct iw_cm_event *iw_event) +{ + struct iwcm_work *work; + struct iwcm_id_private *cm_id_priv; + unsigned long flags; + + work = kmalloc(sizeof(*work), GFP_ATOMIC); + if (!work) + return; This allocation _will_ fail sometimes. The driver must recover from it. Will it do so? Er...no. It will lose this event. Depending on the event...the carnage varies. We'll take a look at this. +EXPORT_SYMBOL(iw_cm_init_qp_attr); This file exports a ton of symbols. It's usual to provide some justifying commentary in the changelog when this happens. This module is a logical instance of the xx_cm where xx is the transport type. I think there is some discussion warranted on whether or not these should all be built into and exported by rdma_cm. One rationale would be that the rdma_cm is the only client for many of these functions (this being a particularly good example) and doing so would reduce the export count. Others would be reasonably needed for any application (connect, etc...) All that said, we'll be sure to document the exported symbols in a follow-up patch. +/* + * Copyright (c) 2005 Network Appliance, Inc. All rights reserved. + * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + *copyright notice, this list of conditions and the following + *disclaimer. + * + * - Redistributions in binary form must reproduce the above + *copyright notice, this list of conditions and the following + *disclaimer in the documentation and/or other materials + *provided with the distribution. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#if !defined(IW_CM_PRIVATE_H) +#define IW_CM_PRIVATE_H We normally use #ifndef here. We'll change this.. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - 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 v2 4/7] AMSO1100 Memory Management.
On Thu, 2006-06-08 at 01:17 -0700, Andrew Morton wrote: On Wed, 07 Jun 2006 15:06:55 -0500 Steve Wise [EMAIL PROTECTED] wrote: +void c2_free(struct c2_alloc *alloc, u32 obj) +{ + spin_lock(alloc-lock); + clear_bit(obj, alloc-table); + spin_unlock(alloc-lock); +} The spinlock is unneeded here. Good point. What does all the code in this file do, anyway? It looks totally generic (and hence inappropriate for drivers/infiniband/hw/amso1100/) and somewhat similar to idr trees, perhaps. We mimicked the mthca driver. It may be code that should be replaced with Linux core services for new drivers. We'll investigate. +int c2_array_set(struct c2_array *array, int index, void *value) +{ + int p = (index * sizeof(void *)) PAGE_SHIFT; + + /* Allocate with GFP_ATOMIC because we'll be called with locks held. */ + if (!array-page_list[p].page) + array-page_list[p].page = + (void **) get_zeroed_page(GFP_ATOMIC); + + if (!array-page_list[p].page) + return -ENOMEM; This _will_ happen under load. What will the result of that be, in the context of thise driver? A higher level object allocation will fail. In this case, a kernel application request will fail and the application must handle the error. This function is incorrectly designed - it should receive a gfp_t argument. Because you don't *know* that the caller will always hold a spinlock. And GFP_KERNEL is far, far stronger than GFP_ATOMIC. This service is allocating a page that the adapter will DMA 2B message indices into. +static int c2_alloc_mqsp_chunk(gfp_t gfp_mask, struct sp_chunk **head) +{ + int i; + struct sp_chunk *new_head; + + new_head = (struct sp_chunk *) __get_free_page(gfp_mask | GFP_DMA); Why is __GFP_DMA in there? Unless you've cornered the ISA bus infiniband market, it's likely to be wrong. Flag confusion about what GFP_DMA means. We'll revisit this whole file ... - 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 2.6.17-rc6] Remove Prism II support from Orinoco
On Mon, Jun 12, 2006 at 11:24:39AM -0400, John W. Linville wrote: On Mon, Jun 12, 2006 at 01:49:54AM +0300, Faidon Liambotis wrote: Having two drivers supporting the same set of hardware seems pretty pointless to me. Plus, it confuses hotplugging/automatic detection. This subject comes-up from time to time. In fact, I'm pretty sure it came-up very recently w.r.t. orinoco and hostap. I remember a patch that added all of Orinoco PCI IDs to HostAP. I'm not sure if you're referring to that, but that's pretty different (and obviously wrong). The consensus seems to be that drivers should have IDs for all devices they support, even if that means that some devices are supported by multiple drivers. This leaves the choice of which driver to use in the hands of the user and/or distro. I'd mostly agree to that if distributors had a way to enable/disable Prism2 support on the orinoco_cs driver based on a build-time configuration option. Should I prepare such a patch? FWIW, I think we've experienced a similar situation like this in the past in the networking land and the consensus was to completely remove the other driver. I'm referring to e100/eepro100, of course. Regards, Faidon - 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: [RFT] Realtek 8168 ethernet support
Mourad De Clerck [EMAIL PROTECTED] : [...] I just tried this patch set, but it doesn't do anything for the freeze at high speed I mentioned on 2006-06-09. It still locks up. (As an additional data point: I installed win2k on this machine, and it seems to have no problems transferring at high speeds. Just wanted to try to rule out faulty hardware.) Please send .config and complete dmesg (starting with 'Linux version ...'). The output of a 'vmstat 1' until it freezes could give some hint. So could trying a different PCI slot. How do you generate traffic ? 15Mo/s of usual traffic means roughly 1000pps. It is not really high speed. Unrelated: have you checked the link setting ? -- Ueimor - 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] wan/sdla section fixes
Randy.Dunlap [EMAIL PROTECTED] writes: static const char* version = SDLA driver v0.30, 12 Sep 1996, [EMAIL PROTECTED]; 1996 doesn't look encouraging but it may be misleading. Yep. You could ignore it :) or rm drivers/net/wan/slda* :) I don't know, maybe Mike will say something? -- Krzysztof Halasa - 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] d80211: update tx.skb after TX handler calls
TX and RX handlers are allowed to change skb. Fix (hopefully) the last place where this is not taken into account. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |1 + 1 files changed, 1 insertion(+) --- dscape.orig/net/d80211/ieee80211.c +++ dscape/net/d80211/ieee80211.c @@ -1760,6 +1760,7 @@ ieee80211_get_buffered_bc(struct net_dev break; } dev_put(tx.dev); + skb = tx.skb; /* handlers are allowed to change skb */ if (res == TXRX_DROP) { I802_DEBUG_INC(local-tx_handlers_drop); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/5] d80211: add first_fragment flag to ieee80211_tx_control
If a driver needs to find out if the fragment it is supposed to pass to the hardware is the first fragment, the only way to do this is to check if a Fragment Number part of seq_ctrl field in the frame header equals to 0. Let's make it easier. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- include/net/d80211.h |2 ++ net/d80211/ieee80211.c |2 ++ 2 files changed, 4 insertions(+) --- dscape.orig/include/net/d80211.h +++ dscape/include/net/d80211.h @@ -158,6 +158,8 @@ struct ieee80211_tx_control { unsigned int rate_ctrl_probe:1; unsigned int clear_dst_mask:1; unsigned int requeue:1; + unsigned int first_fragment:1; /* This is a first fragment of the +* frame */ /* following three flags are only used with Atheros Super A/G */ unsigned int compress:1; unsigned int turbo_prime_notify:1; /* notify HostaAPd after frame --- dscape.orig/net/d80211/ieee80211.c +++ dscape/net/d80211/ieee80211.c @@ -1120,6 +1120,7 @@ __ieee80211_tx_prepare(struct ieee80211_ u8 *pos = skb-data[hdrlen + sizeof(rfc1042_header)]; tx-ethertype = (pos[0] 8) | pos[1]; } + control-first_fragment = 1; } @@ -1190,6 +1191,7 @@ static int __ieee80211_tx(struct ieee802 control-use_rts_cts = 0; control-use_cts_protect = 0; control-clear_dst_mask = 0; + control-first_fragment = 0; for (i = 0; i tx-u.tx.num_extra_frag; i++) { if (!tx-u.tx.extra_frag[i]) continue; - 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
[incomplete 2/5] bcm43xx-d80211: per-queue TX flow control
This is an attempt to fix bcm43xx driver. It is for DMA mode only and incomplete even for that mode - ieee80211_hw-tx() callback should return NETDEV_TX_* constants which is not completely fixed by this patch. --- drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c |6 +- drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c |1 + 2 files changed, 6 insertions(+), 1 deletion(-) --- dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -778,13 +778,16 @@ int bcm43xx_dma_tx(struct bcm43xx_privat * recognizes if the device queue is full and does * not send data anymore. */ + ieee80211_stop_queue(bcm-net_dev, 0); printk(KERN_ERR PFX DMA queue overflow\n); - return -ENOMEM; + return NETDEV_TX_BUSY; } err = dma_tx_fragment(ring, skb, ctl); if (likely(!err)) ring-nr_tx_packets++; + if (free_slots(ring) SLOTS_PER_PACKET) + ieee80211_stop_queue(bcm-net_dev, 0); return err; } @@ -833,6 +836,7 @@ void bcm43xx_dma_handle_xmitstatus(struc slot = next_slot(ring, slot); } bcm-stats.last_tx = jiffies; + ieee80211_wake_queue(bcm-net_dev, 0); } void bcm43xx_dma_get_tx_stats(struct bcm43xx_private *bcm, --- dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3737,6 +3737,7 @@ static int bcm43xx_init_board(struct bcm bcm43xx_security_init(bcm); bcm43xx_measure_channel_change_time(bcm); ieee80211_update_hw(bcm-net_dev, bcm-ieee); + ieee80211_start_queues(bcm-net_dev); ieee80211_netif_oper(bcm-net_dev, NETIF_ATTACH); ieee80211_netif_oper(bcm-net_dev, NETIF_START); ieee80211_netif_oper(bcm-net_dev, NETIF_WAKE); - 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 0/5] d80211: better fragmentation handling
Following patches allow proper handling of situation when hw queue gets filled up while sending 802.11 fragments. This breaks drivers; an example how to fix them is in second patch. Also, get_tx_stats callback is optional now. -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] d80211: handle full queue when sending fragments
When the queue gets filled up while sending fragments, do not discard the frame. Partially sent frames are stored in a buffer in ieee80211_local (there is place for one frame for each queue there). When the space in hw queue gets available again, stored frame for that queue is sent first. Also, the case when driver returns NETDEV_TX_BUSY is handled properly now. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c | 229 +-- net/d80211/ieee80211_i.h | 14 ++ net/d80211/wme.c |5 - 3 files changed, 199 insertions(+), 49 deletions(-) --- dscape.orig/net/d80211/ieee80211.c +++ dscape/net/d80211/ieee80211.c @@ -1153,6 +1153,74 @@ static void inline ieee80211_tx_prepare( __ieee80211_tx_prepare(tx, skb, dev, control); } +static inline int __ieee80211_queue_stopped(struct ieee80211_local *local, + int queue) +{ + return test_bit(IEEE80211_LINK_STATE_XOFF, local-state[queue]); +} + +static inline int __ieee80211_queue_pending(struct ieee80211_local *local, + int queue) +{ + return test_bit(IEEE80211_LINK_STATE_PENDING, local-state[queue]); +} + +#define IEEE80211_TX_OK0 +#define IEEE80211_TX_AGAIN 1 +#define IEEE80211_TX_FRAG_AGAIN2 + +static int __ieee80211_tx(struct ieee80211_local *local, struct sk_buff *skb, + struct ieee80211_txrx_data *tx) +{ + struct ieee80211_tx_control *control = tx-u.tx.control; + int ret, i; + + if (skb) { + ieee80211_dump_frame(local-mdev-name, TX to low-level driver, skb); + ret = local-hw-tx(local-mdev, skb, control); + if (ret) + return IEEE80211_TX_AGAIN; +#ifdef IEEE80211_LEDS + if (local-tx_led_counter++ == 0) { + ieee80211_tx_led(1, local-mdev); + } +#endif /* IEEE80211_LEDS */ + } + if (tx-u.tx.extra_frag) { + control-use_rts_cts = 0; + control-use_cts_protect = 0; + control-clear_dst_mask = 0; + for (i = 0; i tx-u.tx.num_extra_frag; i++) { + if (!tx-u.tx.extra_frag[i]) + continue; + if (__ieee80211_queue_stopped(local, control-queue)) + return IEEE80211_TX_FRAG_AGAIN; + if (i == tx-u.tx.num_extra_frag) { + control-tx_rate = tx-u.tx.last_frag_hwrate; + control-rateidx = tx-u.tx.last_frag_rateidx; + control-rate_ctrl_probe = + tx-u.tx.probe_last_frag; + } + + ieee80211_dump_frame(local-mdev-name, +TX to low-level driver, skb); + ret = local-hw-tx(local-mdev, tx-u.tx.extra_frag[i], + control); + if (ret) + return IEEE80211_TX_FRAG_AGAIN; +#ifdef IEEE80211_LEDS + if (local-tx_led_counter++ == 0) { + ieee80211_tx_led(1, local-mdev); + } +#endif /* IEEE80211_LEDS */ + tx-u.tx.extra_frag[i] = NULL; + } + kfree(tx-u.tx.extra_frag); + tx-u.tx.extra_frag = NULL; + } + return IEEE80211_TX_OK; +} + static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb, struct ieee80211_tx_control *control, int mgmt) { @@ -1163,6 +1231,8 @@ static int ieee80211_tx(struct net_devic ieee80211_txrx_result res = TXRX_DROP; int ret, i; + WARN_ON(__ieee80211_queue_pending(local, control-queue)); + if (unlikely(skb-len 10)) { dev_kfree_skb(skb); return 0; @@ -1193,65 +1263,60 @@ static int ieee80211_tx(struct net_devic return 0; } - ieee80211_dump_frame(local-mdev-name, TX to low-level driver, skb); - ret = local-hw-tx(local-mdev, skb, control); -#ifdef IEEE80211_LEDS - if (!ret local-tx_led_counter++ == 0) { -ieee80211_tx_led(1, dev); -} -#endif /* IEEE80211_LEDS */ if (tx.u.tx.extra_frag) { - if (ret 0) { - /* Must free all fragments and return 0 since skb data -* has been fragmented into multiple buffers. -* TODO: could free extra fragments and restore skb to -* the original form since the data is still there and -* then return nonzero so that Linux netif would -* retry. */ - goto drop; - } - -
Re: [PATCH] netpoll: break recursive loop in netpoll rx path
On Mon, Jun 12, 2006 at 10:51:21AM -0500, Matt Mackall wrote: On Mon, Jun 12, 2006 at 11:40:29AM -0400, Neil Horman wrote: Hey there- the netpoll system currently has a rx to tx path via: netpoll_rx __netpoll_rx arp_reply netpoll_send_skb dev-hard_start_tx This rx-tx loop places network drivers at risk of inadvertently causing a deadlock or BUG halt by recursively trying to acquire a spinlock that is used in both their rx and tx paths (this problem was origionally reported to me in the 3c59x driver, which shares a spinlock between the boomerang_interrupt and boomerang_start_xmit routines). Grumble. This patch breaks this loop, by queueing arp frames, so that they can be responded to after all receive operations have been completed. Tested by myself and the reported with successful results. Tested how? kgdb? Specifically It was tested with netdump. Heres the BZ with details: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194055 + if (likely(npi)) + while ((skb = skb_dequeue(npi-arp_tx)) != NULL) + arp_reply(skb); + Assignment inside tests is frowned upon. I'd prefer pulling this out to its own function too. Sure, no problem. New patch attached with suggested modifications made Regards Neil Signed-off-by: Neil Horman [EMAIL PROTECTED] include/linux/netpoll.h |1 + net/core/netpoll.c | 27 +-- 2 files changed, 26 insertions(+), 2 deletions(-) --- linux-2.6/include/linux/netpoll.h.orig 2006-06-12 09:11:01.0 -0400 +++ linux-2.6/include/linux/netpoll.h 2006-06-12 09:34:17.0 -0400 @@ -31,6 +31,7 @@ struct netpoll_info { int rx_flags; spinlock_t rx_lock; struct netpoll *rx_np; /* netpoll that registered an rx_hook */ + struct sk_buff_head arp_tx; /* list of arp requests to reply to */ }; void netpoll_poll(struct netpoll *np); --- linux-2.6/net/core/netpoll.c.orig 2006-06-12 09:11:01.0 -0400 +++ linux-2.6/net/core/netpoll.c2006-06-12 13:43:25.0 -0400 @@ -54,6 +54,7 @@ static atomic_t trapped; sizeof(struct iphdr) + sizeof(struct ethhdr)) static void zap_completion_queue(void); +static void arp_reply(struct sk_buff *skb); static void queue_process(void *p) { @@ -153,8 +154,25 @@ static void poll_napi(struct netpoll *np } } +static void service_arp_queue(struct netpoll_info *npi) +{ + struct sk_buff *skb; + + if(unlikely(!npi)) + return; + + skb = skb_dequeue(npi-arp_tx); + + while (skb != NULL) { + arp_reply(skb); + skb = skb_dequeue(npi-arp_tx); + } + return; +} + void netpoll_poll(struct netpoll *np) { + if(!np-dev || !netif_running(np-dev) || !np-dev-poll_controller) return; @@ -163,6 +181,8 @@ void netpoll_poll(struct netpoll *np) if (np-dev-poll) poll_napi(np); + service_arp_queue(np-dev-npinfo); + zap_completion_queue(); } @@ -449,7 +469,9 @@ int __netpoll_rx(struct sk_buff *skb) int proto, len, ulen; struct iphdr *iph; struct udphdr *uh; - struct netpoll *np = skb-dev-npinfo-rx_np; + struct netpoll_info *npi = skb-dev-npinfo; + struct netpoll *np = npi-rx_np; + if (!np) goto out; @@ -459,7 +481,7 @@ int __netpoll_rx(struct sk_buff *skb) /* check if netpoll clients need ARP */ if (skb-protocol == __constant_htons(ETH_P_ARP) atomic_read(trapped)) { - arp_reply(skb); + skb_queue_tail(npi-arp_tx, skb); return 1; } @@ -654,6 +676,7 @@ int netpoll_setup(struct netpoll *np) npinfo-poll_owner = -1; npinfo-tries = MAX_RETRIES; spin_lock_init(npinfo-rx_lock); + skb_queue_head_init(npinfo-arp_tx); } else npinfo = ndev-npinfo; -- /*** *Neil Horman *Software Engineer *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu ***/ - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/5] d80211: per-queue TX flow control
Currently, before a packet is passed to the driver, the driver is asked about status of its TX queues (i.e. how many packets are queued in each queue and how large are queues). This is different from the way generic networking works in Linux and it doesn't allow easy implementation of resubmitting fragments to the driver when the queue gets filled up during transmitting. This patch changes the stack not to ask driver about queue status but require driver to do TX flow control. Please note that this breaks drivers. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- include/net/d80211.h | 30 ++ net/d80211/ieee80211.c | 27 +++ net/d80211/ieee80211_i.h |6 ++ net/d80211/wme.c |6 +- 4 files changed, 64 insertions(+), 5 deletions(-) --- dscape.orig/include/net/d80211.h +++ dscape/include/net/d80211.h @@ -781,6 +781,7 @@ int ieee80211_get_hdrlen(u16 fc); * netdevices for each hardware device. The low-level driver does not see * these interfaces, so it should use this function to perform netif * operations on all interface. */ +/* This function is deprecated. */ typedef enum { NETIF_ATTACH, NETIF_DETACH, NETIF_START, NETIF_STOP, NETIF_WAKE, NETIF_IS_STOPPED, NETIF_UPDATE_TX_START @@ -788,6 +789,35 @@ typedef enum { int ieee80211_netif_oper(struct net_device *dev, Netif_Oper op); /** + * ieee80211_wake_queue - wake specific queue + * @dev: pointer to struct net_device as obtained from + * ieee80211_alloc_hw(). + * @queue: queue number (counted from zero). + * + * Drivers should use this function instead of netif_wake_queue. + */ +void ieee80211_wake_queue(struct net_device *dev, int queue); + +/** + * ieee80211_stop_queue - stop specific queue + * @dev: pointer to struct net_device as obtained from + * ieee80211_alloc_hw(). + * @queue: queue number (counted from zero). + * + * Drivers should use this function instead of netif_stop_queue. + */ +void ieee80211_stop_queue(struct net_device *dev, int queue); + +/** + * ieee80211_start_queues - start all queues + * @dev: pointer to struct net_device as obtained from + * ieee80211_alloc_hw(). + * + * Drivers should use this function instead of netif_start_queue. + */ +void ieee80211_start_queues(struct net_device *dev); + +/** * ieee80211_get_mc_list_item - iteration over items in multicast list * @dev: pointer to struct net_device as obtained from * ieee80211_alloc_hw(). --- dscape.orig/net/d80211/ieee80211.c +++ dscape/net/d80211/ieee80211.c @@ -4421,6 +4421,30 @@ int ieee80211_netif_oper(struct net_devi return 0; } +void ieee80211_wake_queue(struct net_device *dev, int queue) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + + if (test_and_clear_bit(IEEE80211_LINK_STATE_XOFF, + local-state[queue])) + __netif_schedule(dev); +} + +void ieee80211_stop_queue(struct net_device *dev, int queue) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + + set_bit(IEEE80211_LINK_STATE_XOFF, local-state[queue]); +} + +void ieee80211_start_queues(struct net_device *dev) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + int i; + + for (i = 0; i local-hw-queues; i++) + clear_bit(IEEE80211_LINK_STATE_XOFF, local-state[i]); +} void * ieee80211_dev_hw_data(struct net_device *dev) { @@ -4548,6 +4572,9 @@ EXPORT_SYMBOL(ieee80211_tx_status); EXPORT_SYMBOL(ieee80211_beacon_get); EXPORT_SYMBOL(ieee80211_get_buffered_bc); EXPORT_SYMBOL(ieee80211_netif_oper); +EXPORT_SYMBOL(ieee80211_wake_queue); +EXPORT_SYMBOL(ieee80211_stop_queue); +EXPORT_SYMBOL(ieee80211_start_queues); EXPORT_SYMBOL(ieee80211_dev_hw_data); EXPORT_SYMBOL(ieee80211_dev_stats); EXPORT_SYMBOL(ieee80211_get_hw_conf); --- dscape.orig/net/d80211/ieee80211_i.h +++ dscape/net/d80211/ieee80211_i.h @@ -353,6 +353,8 @@ struct ieee80211_local { struct sta_info *sta_hash[STA_HASH_SIZE]; struct timer_list sta_cleanup; + unsigned long state[NUM_TX_DATA_QUEUES]; + int mc_count; /* total count of multicast entries in all interfaces */ int iff_allmultis, iff_promiscs; /* number of interfaces with corresponding IFF_ flags */ @@ -514,6 +516,10 @@ struct ieee80211_local { int user_space_mlme; }; +enum ieee80211_link_state_t { + IEEE80211_LINK_STATE_XOFF = 0, +}; + struct sta_attribute { struct attribute attr; ssize_t (*show)(const struct sta_info *, char *buf); --- dscape.orig/net/d80211/wme.c +++ dscape/net/d80211/wme.c @@ -316,18 +316,14 @@ static struct sk_buff *wme_qdiscop_deque struct net_device *dev = qd-dev; struct ieee80211_local *local = dev-ieee80211_ptr; struct ieee80211_hw *hw = local-hw; - struct ieee80211_tx_queue_stats stats; struct sk_buff *skb; struct Qdisc *qdisc; int queue; - /* find which
[PATCH] Make in-kernel hostap less annoying
Most user don't want their kern.log/dmesg filled with debugging gibberish, and could turn it on if prompted. ( Example: wifi0: TXEXC - status=0x0004 ([Discon]) tx_control=000c retry_count=0 tx_rate=0 fc=0x0108 (Data::0 ToDS) A1=00:0f:66:43:d7:0a A2=00:05:3c:06:63:01 A3=33:33:00:00:00:16 A4=00:00:00:00:00:00 ) Also make hostap default to managed mode, instead of master mode, which has bitten a few users expecting it to behave like the orinoco driver it is replacing. Signed-off-by: Kyle McMartin [EMAIL PROTECTED] --- Two minor things I've been carrying around in my personal tree for quite some time. (This is only relevant to the in-kernel driver, I see no reason to change the out-of-tree driver.) Cheers, Kyle diff --git a/drivers/net/wireless/hostap/hostap_config.h b/drivers/net/wireless/hostap/hostap_config.h index c090a5a..bc51fa9 100644 --- a/drivers/net/wireless/hostap/hostap_config.h +++ b/drivers/net/wireless/hostap/hostap_config.h @@ -38,7 +38,7 @@ #endif */ /* Do not include debug messages into the driver */ -/* #define PRISM2_NO_DEBUG */ +#define PRISM2_NO_DEBUG /* Do not include /proc/net/prism2/wlan#/{registers,debug} */ /* #define PRISM2_NO_PROCFS_DEBUG */ diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 328e9a1..57438e8 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c @@ -70,7 +70,7 @@ static char essid[33] = test; module_param_string(essid, essid, sizeof(essid), 0444); MODULE_PARM_DESC(essid, Host AP's ESSID); -static int iw_mode[MAX_PARM_DEVICES] = { IW_MODE_MASTER, DEF_INTS }; +static int iw_mode[MAX_PARM_DEVICES] = { IW_MODE_INFRA, DEF_INTS }; module_param_array(iw_mode, int, NULL, 0444); MODULE_PARM_DESC(iw_mode, Initial operation mode); - 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 3/12] d80211: separate allocation of ieee80211_local
On Thu, 8 Jun 2006 09:49:07 +0200 (CEST), Jiri Benc wrote: ieee80211_local has a separate class_device. That means it has reference counting independent of master net_device and can be freed at a different time, therefore these two structures cannot be allocated together. Solve this by adding ieee80211_ptr pointer to net_device structure (similar to other pointers already presented there) and using it as a pointer to independently allocated ieee80211_local. I suppose approval from Dave will be needed for adding that pointer to net_device, right? [...] include/linux/netdevice.h|1 net/d80211/ieee80211.c | 100 +- net/d80211/ieee80211_dev.c | 17 +++ net/d80211/ieee80211_i.h |9 +++- net/d80211/ieee80211_iface.c | 20 net/d80211/ieee80211_ioctl.c | 92 +++ net/d80211/ieee80211_proc.c |6 +-- net/d80211/ieee80211_scan.c | 10 ++-- net/d80211/ieee80211_sta.c | 58 net/d80211/ieee80211_sysfs.c | 26 --- net/d80211/rate_control.c|4 +- net/d80211/rate_control.h|4 +- net/d80211/wme.c | 26 +-- 13 files changed, 206 insertions(+), 167 deletions(-) [...] --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -371,6 +371,7 @@ #define NETIF_F_UFO 8192 void*ip6_ptr; /* IPv6 specific data */ void*ec_ptr;/* Econet specific data */ void*ax25_ptr; /* AX.25 specific data */ + void*ieee80211_ptr; /* IEEE 802.11 specific data */ /* * Cache line mostly used on receive path (including eth_type_trans()) [...] Thanks, -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/5] bcm43xx-d80211: fix sending of fragments
On Monday 12 June 2006 21:16, Jiri Benc wrote: This makes fragmentation work with bcm43xx. Signed-off-by: Jiri Benc [EMAIL PROTECTED] Signed-off-by: Michael Buesch [EMAIL PROTECTED] The other patch will get my sign-off tomorrow (I think modified, though). I don't have time to look at it more close, now. --- drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c |2 +- drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -703,7 +703,7 @@ static int dma_tx_fragment(struct bcm43x bcm43xx_generate_txhdr(ring-bcm, (struct bcm43xx_txhdr *)hdr_skb-data, skb-data, skb-len, -1,//FIXME +ctl-first_fragment, generate_cookie(ring, slot), ctl); --- dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -183,7 +183,7 @@ static void pio_tx_write_fragment(struct assert(skb_shinfo(skb)-nr_frags == 0); bcm43xx_generate_txhdr(queue-bcm, txhdr, skb-data, skb-len, -1,//FIXME +packet-ctl-first_fragment, generate_cookie(queue, pio_txpacket_getindex(packet)), packet-ctl); -- 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
Re: [PATCH 3/12] d80211: separate allocation of ieee80211_local
On Mon, Jun 12, 2006 at 09:35:23PM +0200, Jiri Benc wrote: On Thu, 8 Jun 2006 09:49:07 +0200 (CEST), Jiri Benc wrote: ieee80211_local has a separate class_device. That means it has reference counting independent of master net_device and can be freed at a different time, therefore these two structures cannot be allocated together. Solve this by adding ieee80211_ptr pointer to net_device structure (similar to other pointers already presented there) and using it as a pointer to independently allocated ieee80211_local. I suppose approval from Dave will be needed for adding that pointer to net_device, right? Ulitmately, yes. :-) 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: [patch] undo AF_UNIX _bh locking changes and split lock-type instead
From: Ingo Molnar [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 10:49:36 +0200 Subject: undo AF_UNIX _bh locking changes and split lock-type From: Ingo Molnar [EMAIL PROTECTED] this cleans up lock-validator-special-locking-af_unix.patch: instead of adding _bh locking to AF_UNIX, this patch splits their sk_receive_queue.lock type from the other networking skb-queue locks. Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: David S. Miller [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 2.6.17-rc6] Remove Prism II support from Orinoco
On Mon, Jun 12, 2006 at 06:39:58PM +0300, Faidon Liambotis wrote: FWIW, I think we've experienced a similar situation like this in the past in the networking land and the consensus was to completely remove the other driver. I'm referring to e100/eepro100, of course. The difference with e100/eepro100, was that there the interface name remained constant regardless of which driver you were using, which isn't the case with orinoco-hostap. Dave -- http://www.codemonkey.org.uk - 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 RFC] netpoll: don't spin forever sending to stopped queues
Matt Mackall wrote: On Thu, Jun 08, 2006 at 07:15:50PM -0700, Jeremy Fitzhardinge wrote: Here's a patch. I haven't tested it beyond compiling it, and I don't know if it is actually correct. In this case, it seems pointless to spin waiting for an even which will never happen. Should netif_poll_disable() cause netpoll_send_skb() (or something) to not even bother trying to send? netif_poll_disable seems mysteriously simple to me. J Did this work for you at all? No, it didn't appear to help; I get the same symptom. I think fix is correct (in that its better than what was there before), but there's probably more going on in my case. I haven't looked into it more deeply yet. I suspect there's another netpoll code path which is spinning forever on an XOFFed queue. When transmitting a skb in netpoll_send_skb(), only retry a limited number of times if the device queue is stopped. Where limited = once? No, it reuses the existing retry logic. It retries 2 times with a 50us pause between attempts, so up to a second. This seems excessive to me; I don't know where those original numbers came from. I tried 5000 retries, but it didn't make any difference to my case. 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: Using netconsole for debugging suspend/resume
Andi Kleen wrote: On Monday 12 June 2006 17:38, Mark Lord wrote: Okay, so I'm daft. But.. *what* is it ?? We have two machines: target (being debugged), and host (anything). Sure, the target has to have ohci1394 loaded, and firescope running. But what about the *other* end of the connection? What commands? From the same manpage: The raw1394 module must be loaded and its device node be writable (this normally requires root) Ok it doesn't say you need ohci1394 too and doesn't say that's the target. If I do a new revision I'll perhaps expand the docs a bit. So load ohci1394/raw1394 and run firescope as root. Your distribution will hopefully take care of the device nodes. Usually you want something like firescope -Au System.map I think the confusion here is that the target doesn't need to be running anything; you can DMA chunks of memory with the OHCI controller with no need for any software support. The debugger host is what's running firescope. Unless I'm confused too, which is likely. Andi, I think your docs should be more explicit about what runs where. Also, the tricky bit for me is debugging resume; firescope still requires the OHCI device to come up to be useful, but I that's no different from using netconsole. Neat stuff; I need to get my two firewire-enabled machines close enough to each other to try it out. 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 RFC] netpoll: don't spin forever sending to stopped queues
Matt Mackall wrote: Ahh, right. I forgot that I'd done that. Can you resend? I just respun it against 2.6.17-rc6-mm2. J -- Subject: netpoll: don't spin forever sending to blocked queues When transmitting a skb in netpoll_send_skb(), only retry a limited number of times if the device queue is stopped. Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED] diff -r 0b8d3d4ee182 net/core/netpoll.c --- a/net/core/netpoll.cMon Jun 12 13:46:23 2006 -0700 +++ b/net/core/netpoll.cMon Jun 12 13:48:34 2006 -0700 @@ -279,14 +279,10 @@ static void netpoll_send_skb(struct netp * network drivers do not expect to be called if the queue is * stopped. */ - if (netif_queue_stopped(np-dev)) { - netif_tx_unlock(np-dev); - netpoll_poll(np); - udelay(50); - continue; - } - - status = np-dev-hard_start_xmit(skb, np-dev); + status = NETDEV_TX_BUSY; + if (!netif_queue_stopped(np-dev)) + status = np-dev-hard_start_xmit(skb, np-dev); + netif_tx_unlock(np-dev); /* success */ - 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: [RFT] Realtek 8168 ethernet support
Mourad De Clerck [EMAIL PROTECTED] : [...] I do notice a pattern with more and less complicated/cpu intensive traffic: using http (wget) I manage to finish doing the transfer of the same reasonably big file. With scp I only manage to get to 90% of that file before it freezes - I should still test whether I can get a http transfer to lock up if I use a (much) bigger file. wget goes faster, right ? Do you have some vmstat 1 output at hand for it ? [...] Unrelated: have you checked the link setting ? ethtool reports Link detected: yes and so does my switch. Ok but can you set correctly the link with the command which was told to fail in you first mail ? The patch could fix it. [...] shuttle:~# scp hell:/srv/bigfile.bin . bigfile.bin 90% 155MB 17.5MB/s 00:00 ETA Can you try something like: dd if=/dev/zero bs=1024k count=1000 | ssh -c blowfish hell dd of=/tmp/1000m.bin May I assume that the freeze locks everything (keyboard, mouse, led) beyond the scp command itself ? -- Ueimor - 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/2] update sunrpc to use in-kernel sockets API
This patch updates sunrpc to use in-kernel sockets API. Thanks Sridhar diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index a27905a..ee80b3c 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -388,7 +388,7 @@ svc_sendto(struct svc_rqst *rqstp, struc /* send head */ if (slen == xdr-head[0].iov_len) flags = 0; - len = sock-ops-sendpage(sock, rqstp-rq_respages[0], 0, xdr-head[0].iov_len, flags); + len = kernel_sendpage(sock, rqstp-rq_respages[0], 0, xdr-head[0].iov_len, flags); if (len != xdr-head[0].iov_len) goto out; slen -= xdr-head[0].iov_len; @@ -400,7 +400,7 @@ svc_sendto(struct svc_rqst *rqstp, struc while (pglen 0) { if (slen == size) flags = 0; - result = sock-ops-sendpage(sock, *ppage, base, size, flags); + result = kernel_sendpage(sock, *ppage, base, size, flags); if (result 0) len += result; if (result != size) @@ -413,7 +413,7 @@ svc_sendto(struct svc_rqst *rqstp, struc } /* send tail */ if (xdr-tail[0].iov_len) { - result = sock-ops-sendpage(sock, rqstp-rq_respages[rqstp-rq_restailpage], + result = kernel_sendpage(sock, rqstp-rq_respages[rqstp-rq_restailpage], ((unsigned long)xdr-tail[0].iov_base) (PAGE_SIZE-1), xdr-tail[0].iov_len, 0); @@ -434,13 +434,10 @@ out: static int svc_recv_available(struct svc_sock *svsk) { - mm_segment_toldfs; struct socket *sock = svsk-sk_sock; int avail, err; - oldfs = get_fs(); set_fs(KERNEL_DS); - err = sock-ops-ioctl(sock, TIOCINQ, (unsigned long) avail); - set_fs(oldfs); + err = kernel_ioctl(sock, TIOCINQ, (unsigned long) avail); return (err = 0)? avail : err; } @@ -472,7 +469,7 @@ svc_recvfrom(struct svc_rqst *rqstp, str * at accept time. FIXME */ alen = sizeof(rqstp-rq_addr); - sock-ops-getname(sock, (struct sockaddr *)rqstp-rq_addr, alen, 1); + kernel_getpeername(sock, (struct sockaddr *)rqstp-rq_addr, alen); dprintk(svc: socket %p recvfrom(%p, %Zu) = %d\n, rqstp-rq_sock, iov[0].iov_base, iov[0].iov_len, len); @@ -758,7 +755,6 @@ svc_tcp_accept(struct svc_sock *svsk) struct svc_serv *serv = svsk-sk_server; struct socket *sock = svsk-sk_sock; struct socket *newsock; - const struct proto_ops *ops; struct svc_sock *newsvsk; int err, slen; @@ -766,29 +762,23 @@ svc_tcp_accept(struct svc_sock *svsk) if (!sock) return; - err = sock_create_lite(PF_INET, SOCK_STREAM, IPPROTO_TCP, newsock); - if (err) { + clear_bit(SK_CONN, svsk-sk_flags); + err = kernel_accept(sock, newsock, O_NONBLOCK); + if (err 0) { if (err == -ENOMEM) printk(KERN_WARNING %s: no more sockets!\n, serv-sv_name); - return; - } - - dprintk(svc: tcp_accept %p allocated\n, newsock); - newsock-ops = ops = sock-ops; - - clear_bit(SK_CONN, svsk-sk_flags); - if ((err = ops-accept(sock, newsock, O_NONBLOCK)) 0) { - if (err != -EAGAIN net_ratelimit()) + else if (err != -EAGAIN net_ratelimit()) printk(KERN_WARNING %s: accept failed (err %d)!\n, serv-sv_name, -err); - goto failed;/* aborted connection or whatever */ + return; } + set_bit(SK_CONN, svsk-sk_flags); svc_sock_enqueue(svsk); slen = sizeof(sin); - err = ops-getname(newsock, (struct sockaddr *) sin, slen, 1); + err = kernel_getpeername(newsock, (struct sockaddr *) sin, slen); if (err 0) { if (net_ratelimit()) printk(KERN_WARNING %s: peername failed (err %d)!\n, @@ -1407,14 +1397,14 @@ svc_create_socket(struct svc_serv *serv, if (sin != NULL) { if (type == SOCK_STREAM) sock-sk-sk_reuse = 1; /* allow address reuse */ - error = sock-ops-bind(sock, (struct sockaddr *) sin, + error = kernel_bind(sock, (struct sockaddr *) sin, sizeof(*sin)); if (error 0) goto bummer; } if (protocol == IPPROTO_TCP) { - if ((error = sock-ops-listen(sock, 64)) 0) + if ((error = kernel_listen(sock, 64)) 0) goto bummer; } diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 4b4e7df..c60b422 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c
[RFC/PATCH 1/2] in-kernel sockets API
This patch makes it convenient to use the sockets API by the in-kernel users like sunrpc, cifs ocfs2 etc and any future users. Currently they get to this API by directly accesing the function pointers in the sock structure. Most of these functions are pretty simple and can be made inline and moved to linux/net.h. I used kernel_ prefix for this API to match with the existing kernel_sendmsg and kernel_recvmsg() although i would prefer ksock_. I have updated sunrpc to use this API. I would appreciate any comments or suggestions for improvements. Thanks Sridhar diff --git a/include/linux/net.h b/include/linux/net.h index 84a490e..b70c28f 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -208,6 +208,25 @@ extern int kernel_recvmsg(struct struct kvec *vec, size_t num, size_t len, int flags); +extern int kernel_bind(struct socket *sock, struct sockaddr *addr, + int addrlen); +extern int kernel_listen(struct socket *sock, int backlog); +extern int kernel_accept(struct socket *sock, struct socket **newsock, +int flags); +extern int kernel_connect(struct socket *sock, struct sockaddr *addr, + int addrlen, int flags); +extern int kernel_getsockname(struct socket *sock, struct sockaddr *addr, + int *addrlen); +extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr, + int *addrlen); +extern int kernel_getsockopt(struct socket *sock, int level, int optname, +char *optval, int *optlen); +extern int kernel_setsockopt(struct socket *sock, int level, int optname, +char *optval, int optlen); +extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, + size_t size, int flags); +extern int kernel_ioctl(struct socket *sock, int cmd, unsigned long arg); + #ifndef CONFIG_SMP #define SOCKOPS_WRAPPED(name) name #define SOCKOPS_WRAP(name, fam) diff --git a/net/socket.c b/net/socket.c index 02948b6..8f36be7 100644 --- a/net/socket.c +++ b/net/socket.c @@ -2160,6 +2160,109 @@ static long compat_sock_ioctl(struct fil } #endif +int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen) +{ + return sock-ops-bind(sock, addr, addrlen); +} + +int kernel_listen(struct socket *sock, int backlog) +{ + return sock-ops-listen(sock, backlog); +} + +int kernel_accept(struct socket *sock, struct socket **newsock, int flags) +{ + struct sock *sk = sock-sk; + int err; + + err = sock_create_lite(sk-sk_family, sk-sk_type, sk-sk_protocol, + newsock); + if (err 0) + goto done; + + err = sock-ops-accept(sock, *newsock, flags); + if (err 0) { + sock_release(*newsock); + goto done; + } + + (*newsock)-ops = sock-ops; + +done: + return err; +} + +int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen, + int flags) +{ + return sock-ops-connect(sock, addr, addrlen, flags); +} + +int kernel_getsockname(struct socket *sock, struct sockaddr *addr, +int *addrlen) +{ + return sock-ops-getname(sock, addr, addrlen, 0); +} + +int kernel_getpeername(struct socket *sock, struct sockaddr *addr, +int *addrlen) +{ + return sock-ops-getname(sock, addr, addrlen, 1); +} + +int kernel_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) +{ + mm_segment_t oldfs = get_fs(); + int err; + + set_fs(KERNEL_DS); + if (level == SOL_SOCKET) + err = sock_getsockopt(sock, level, optname, optval, optlen); + else + err = sock-ops-getsockopt(sock, level, optname, optval, + optlen); + set_fs(oldfs); + return err; +} + +int kernel_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) +{ + mm_segment_t oldfs = get_fs(); + int err; + + set_fs(KERNEL_DS); + if (level == SOL_SOCKET) + err = sock_setsockopt(sock, level, optname, optval, optlen); + else + err = sock-ops-setsockopt(sock, level, optname, optval, + optlen); + set_fs(oldfs); + return err; +} + +int kernel_sendpage(struct socket *sock, struct page *page, int offset, + size_t size, int flags) +{ + if (sock-ops-sendpage) + return sock-ops-sendpage(sock, page, offset, size, flags); + + return sock_no_sendpage(sock, page, offset, size, flags); +} + +int kernel_ioctl(struct socket *sock, int cmd, unsigned long arg) +{ +
Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
On 6/12/06, John W. Linville [EMAIL PROTECTED] wrote: On Mon, Jun 12, 2006 at 01:49:54AM +0300, Faidon Liambotis wrote: Having two drivers supporting the same set of hardware seems pretty pointless to me. Plus, it confuses hotplugging/automatic detection. This subject comes-up from time to time. In fact, I'm pretty sure it came-up very recently w.r.t. orinoco and hostap. The consensus seems to be that drivers should have IDs for all devices they support, even if that means that some devices are supported by multiple drivers. This leaves the choice of which driver to use in the hands of the user and/or distro. my problem is that for my prism 2 adapter both drivers are loaded at which point neither of them works. I'm running FC5, and i have to keep removing the orinoco*.ko files to keep them from loading, so I'm all for this patch. Jesse - 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.6.18 1/6] bnx2: Add an rx drop counter
Add a counter for packets dropped by firmware. Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7a1fb52..1a5f7a8 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -4034,6 +4034,8 @@ bnx2_timer(unsigned long data) msg = (u32) ++bp-fw_drv_pulse_wr_seq; REG_WR_IND(bp, bp-shmem_base + BNX2_DRV_PULSE_MB, msg); + bp-stats_blk-stat_FwRxDrop = REG_RD_IND(bp, BNX2_FW_RX_DROP_COUNT); + if ((bp-phy_flags PHY_SERDES_FLAG) (CHIP_NUM(bp) == CHIP_NUM_5706)) { @@ -4504,6 +4506,10 @@ bnx2_get_stats(struct net_device *dev) net_stats-tx_aborted_errors + net_stats-tx_carrier_errors; + net_stats-rx_missed_errors = + (unsigned long) (stats_blk-stat_IfInMBUFDiscards + + stats_blk-stat_FwRxDrop); + return net_stats; } @@ -4986,7 +4992,7 @@ bnx2_set_rx_csum(struct net_device *dev, return 0; } -#define BNX2_NUM_STATS 45 +#define BNX2_NUM_STATS 46 static struct { char string[ETH_GSTRING_LEN]; @@ -5036,6 +5042,7 @@ static struct { { rx_mac_ctrl_frames }, { rx_filtered_packets }, { rx_discards }, + { rx_fw_discards }, }; #define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4) @@ -5086,6 +5093,7 @@ static const unsigned long bnx2_stats_of STATS_OFFSET32(stat_MacControlFramesReceived), STATS_OFFSET32(stat_IfInFramesL2FilterDiscards), STATS_OFFSET32(stat_IfInMBUFDiscards), +STATS_OFFSET32(stat_FwRxDrop), }; /* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are @@ -5096,7 +5104,7 @@ static u8 bnx2_5706_stats_len_arr[BNX2_N 4,0,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4, + 4,4,4,4,4,4, }; static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = { @@ -5104,7 +5112,7 @@ static u8 bnx2_5708_stats_len_arr[BNX2_N 4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4, + 4,4,4,4,4,4, }; #define BNX2_NUM_TESTS 6 diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index b87925f..ea1ab06 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -231,6 +231,7 @@ struct statistics_block { u32 stat_GenStat13; u32 stat_GenStat14; u32 stat_GenStat15; + u32 stat_FwRxDrop; }; @@ -3481,6 +3482,8 @@ struct l2_fhdr { #define BNX2_COM_SCRATCH 0x0012 +#define BNX2_FW_RX_DROP_COUNT 0x00120084 + /* * cp_reg definition - 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.6.18 2/6] bnx2: Allow WoL settings on new 5708 chips
Allow WOL settings on 5708 B2 and newer chips that have the problem fixed. Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 1a5f7a8..49c09da 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -5642,7 +5642,9 @@ bnx2_init_board(struct pci_dev *pdev, st } } - if (CHIP_NUM(bp) == CHIP_NUM_5708) + if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || + (CHIP_ID(bp) == CHIP_ID_5708_B0) || + (CHIP_ID(bp) == CHIP_ID_5708_B1)) bp-flags |= NO_WOL_FLAG; if (CHIP_ID(bp) == CHIP_ID_5706_A0) { - 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.6.18 4/6] bnx2: Add firmware decompression
Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly. Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index bdaaad8..1fb0a19 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2163,6 +2163,8 @@ config TIGON3 config BNX2 tristate Broadcom NetXtremeII support depends on PCI + select CRC32 + select ZLIB_INFLATE help This driver supports Broadcom NetXtremeII gigabit Ethernet cards. diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7a3d888..3b1fe1e 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -50,6 +50,7 @@ #include linux/crc32.h #include linux/prefetch.h #include linux/cache.h +#include linux/zlib.h #include bnx2.h #include bnx2_fw.h @@ -2084,6 +2085,92 @@ bnx2_set_rx_mode(struct net_device *dev) spin_unlock_bh(bp-phy_lock); } +#define FW_BUF_SIZE0x8000 + +static int +bnx2_gunzip_init(struct bnx2 *bp) +{ + if ((bp-gunzip_buf = vmalloc(FW_BUF_SIZE)) == NULL) + goto gunzip_nomem1; + + if ((bp-strm = kmalloc(sizeof(*bp-strm), GFP_KERNEL)) == NULL) + goto gunzip_nomem2; + + bp-strm-workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); + if (bp-strm-workspace == NULL) + goto gunzip_nomem3; + + return 0; + +gunzip_nomem3: + kfree(bp-strm); + bp-strm = NULL; + +gunzip_nomem2: + vfree(bp-gunzip_buf); + bp-gunzip_buf = NULL; + +gunzip_nomem1: + printk(KERN_ERR PFX %s: Cannot allocate firmware buffer for + uncompression.\n, bp-dev-name); + return -ENOMEM; +} + +static void +bnx2_gunzip_end(struct bnx2 *bp) +{ + kfree(bp-strm-workspace); + + kfree(bp-strm); + bp-strm = NULL; + + if (bp-gunzip_buf) { + vfree(bp-gunzip_buf); + bp-gunzip_buf = NULL; + } +} + +static int +bnx2_gunzip(struct bnx2 *bp, u8 *zbuf, int len, void **outbuf, int *outlen) +{ + int n, rc; + + /* check gzip header */ + if ((zbuf[0] != 0x1f) || (zbuf[1] != 0x8b) || (zbuf[2] != Z_DEFLATED)) + return -EINVAL; + + n = 10; + +#define FNAME 0x8 + if (zbuf[3] FNAME) + while (zbuf[n++] != 0); + + bp-strm-next_in = zbuf + n; + bp-strm-avail_in = len - n; + bp-strm-next_out = bp-gunzip_buf; + bp-strm-avail_out = FW_BUF_SIZE; + + rc = zlib_inflateInit2(bp-strm, -MAX_WBITS); + if (rc != Z_OK) + return rc; + + rc = zlib_inflate(bp-strm, Z_FINISH); + + *outlen = FW_BUF_SIZE - bp-strm-avail_out; + *outbuf = bp-gunzip_buf; + + if ((rc != Z_OK) (rc != Z_STREAM_END)) + printk(KERN_ERR PFX %s: Firmware decompression error: %s\n, + bp-dev-name, bp-strm-msg); + + zlib_inflateEnd(bp-strm); + + if (rc == Z_STREAM_END) + return 0; + + return rc; +} + static void load_rv2p_fw(struct bnx2 *bp, u32 *rv2p_code, u32 rv2p_code_len, u32 rv2p_proc) @@ -2093,9 +2180,9 @@ load_rv2p_fw(struct bnx2 *bp, u32 *rv2p_ for (i = 0; i rv2p_code_len; i += 8) { - REG_WR(bp, BNX2_RV2P_INSTR_HIGH, *rv2p_code); + REG_WR(bp, BNX2_RV2P_INSTR_HIGH, cpu_to_le32(*rv2p_code)); rv2p_code++; - REG_WR(bp, BNX2_RV2P_INSTR_LOW, *rv2p_code); + REG_WR(bp, BNX2_RV2P_INSTR_LOW, cpu_to_le32(*rv2p_code)); rv2p_code++; if (rv2p_proc == RV2P_PROC1) { @@ -2135,7 +,7 @@ load_cpu_fw(struct bnx2 *bp, struct cpu_ int j; for (j = 0; j (fw-text_len / 4); j++, offset += 4) { - REG_WR_IND(bp, offset, fw-text[j]); + REG_WR_IND(bp, offset, cpu_to_le32(fw-text[j])); } } @@ -2191,15 +2278,32 @@ load_cpu_fw(struct bnx2 *bp, struct cpu_ REG_WR_IND(bp, cpu_reg-mode, val); } -static void +static int bnx2_init_cpus(struct bnx2 *bp) { struct cpu_reg cpu_reg; struct fw_info fw; + int rc = 0; + void *text; + u32 text_len; + + if ((rc = bnx2_gunzip_init(bp)) != 0) + return rc; /* Initialize the RV2P processor. */ - load_rv2p_fw(bp, bnx2_rv2p_proc1, sizeof(bnx2_rv2p_proc1), RV2P_PROC1); - load_rv2p_fw(bp, bnx2_rv2p_proc2, sizeof(bnx2_rv2p_proc2), RV2P_PROC2); + rc = bnx2_gunzip(bp, bnx2_rv2p_proc1, sizeof(bnx2_rv2p_proc1), text, +text_len); + if (rc) + goto init_cpu_err; + + load_rv2p_fw(bp, text, text_len, RV2P_PROC1); + + rc = bnx2_gunzip(bp, bnx2_rv2p_proc2, sizeof(bnx2_rv2p_proc2), text, +text_len); + if (rc) + goto init_cpu_err; + + load_rv2p_fw(bp, text, text_len,
Re: [PATCH 2.6.18 4/6] bnx2: Add firmware decompression
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:18 -0700 Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly. Signed-off-by: Michael Chan [EMAIL PROTECTED] ... +#define FNAME0x8 + if (zbuf[3] FNAME) + while (zbuf[n++] != 0); This can potentially loop past the end of zbuf[], so maybe put a sanity check against 'len' and return non-zero if we traverse past the end? - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 6/6] bnx2: Update version and reldate
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:22 -0700 Update driver version to 1.4.42. Signed-off-by: Michael Chan [EMAIL PROTECTED] I didn't get patch 5, I can only assume it was a huge firmware patch and that both vger.kernel.org and my own personal email system blocked it due to size. - 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.6.18 5.5/6 resend] bnx2: Use compressed firmware 5/6
Change bnx2_fw.h to use compressed data (5/6) Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/bnx2_fw.h b/drivers/net/bnx2_fw.h index 99d2989..de0cac7 100644 --- a/drivers/net/bnx2_fw.h +++ b/drivers/net/bnx2_fw.h @@ -1330,201 +1330,199 @@ static const u32 bnx2_TPAT_b06FwBssAddr static const int bnx2_TPAT_b06FwBssLen = 0x250; static const u32 bnx2_TPAT_b06FwSbssAddr = 0x08001a60; static const int bnx2_TPAT_b06FwSbssLen = 0x34; -static u32 bnx2_TPAT_b06FwText[(0x122c/4) + 1] = { - 0x0a000218, 0x, 0x, 0x000d, 0x74706174, 0x20322e35, - 0x2e313100, 0x02050b01, 0x, 0x, 0x, 0x, - 0x, 0x, 0x, 0x, 0x, 0x, - 0x, 0x, 0x, 0x, 0x, 0x, - 0x, 0x1003, 0x, 0x000d, 0x000d, 0x3c020800, - 0x24421a60, 0x3c030800, 0x24631cf0, 0xac40, 0x0043202b, 0x1480fffd, - 0x24420004, 0x3c1d0800, 0x37bd2ffc, 0x03a0f021, 0x3c100800, 0x26100860, - 0x3c1c0800, 0x279c1a60, 0x0e000546, 0x, 0x000d, 0x8f820010, - 0x8c450008, 0x24030800, 0xaf430178, 0x97430104, 0x3c020008, 0xaf420140, - 0x8f820024, 0x30420001, 0x1047, 0x3069, 0x24020002, 0x2523fffe, - 0xa7420146, 0xa7430148, 0x0a000242, 0x3c020800, 0xa7400146, 0x3c020800, - 0x8c43083c, 0x146e, 0x24020f00, 0x8f820024, 0x30430020, 0x0003182b, - 0x00031823, 0x30650009, 0x30420c00, 0x24030400, 0x14430002, 0x34a40001, - 0x34a40005, 0xa744014a, 0x0a000264, 0x3c020800, 0x8f830014, 0x14620008, - 0x, 0x8f820024, 0x30420020, 0x0002102b, 0x00021023, 0x3042000d, - 0x0a000262, 0x34420005, 0x8f820024, 0x30420020, 0x0002102b, 0x00021023, - 0x30420009, 0x34420001, 0xa742014a, 0x3c020800, 0x8c430820, 0x8f840024, - 0x3c020048, 0x00621825, 0x30840006, 0x24020002, 0x1082000d, 0x2c820003, - 0x5045, 0x24020004, 0x10800012, 0x3c020001, 0x0a000284, 0x, - 0x10820007, 0x24020006, 0x1482000f, 0x3c020111, 0x0a00027c, 0x00621025, - 0x0a00027b, 0x3c020101, 0x3c020011, 0x00621025, 0x24030001, 0xaf421000, - 0xaf830020, 0x0a000284, 0x, 0x00621025, 0xaf421000, 0xaf800020, - 0x, 0x, 0x, 0x, 0x8f830020, 0x1060003f, - 0x3c048000, 0x8f421000, 0x00441024, 0x1040fffd, 0x, 0x10600039, - 0x, 0x8f421000, 0x3c030020, 0x00431024, 0x10400034, 0x, - 0x97421014, 0x14400031, 0x, 0x97421008, 0x8f840010, 0x24420006, - 0x00024082, 0x00081880, 0x00643821, 0x8ce5, 0x30430003, 0x30420001, - 0x1044, 0x, 0x000d, 0x0a0002c3, 0x00081080, 0x546f, - 0x30a5, 0x3c06, 0x00a62824, 0x0005182b, 0x00a61026, 0x0002102b, - 0x00621824, 0x1064, 0x, 0x000d, 0x, 0x240001fb, - 0x8ce2, 0x0a0002c2, 0x00462825, 0x0005182b, 0x38a2, 0x0002102b, - 0x00621824, 0x1064, 0x, 0x000d, 0x, 0x24000205, - 0x8ce2, 0x3445, 0x00081080, 0x00441021, 0x3c030800, 0xac45, - 0x8c620830, 0x24420001, 0xac620830, 0x8f840018, 0x01202821, 0x24820008, - 0x30421fff, 0x24434000, 0x0343d821, 0x30a30007, 0xaf84000c, 0xaf820018, - 0xaf420084, 0x1062, 0x24a20007, 0x3045fff8, 0x8f820030, 0x8f84, - 0x00451821, 0xaf82001c, 0x0064102b, 0xaf830030, 0x1442, 0x00641023, - 0xaf820030, 0x8f840030, 0x34028000, 0x00821021, 0x03421821, 0x3c021000, - 0xaf830010, 0xaf440080, 0x03e8, 0xaf420178, 0x8f830024, 0x27bdffe0, - 0xafbf0018, 0xafb10014, 0x30620200, 0x1444, 0xafb00010, 0x000d, - 0x, 0x24000242, 0x00031a82, 0x30630003, 0x000310c0, 0x00431021, - 0x00021080, 0x00431021, 0x00021080, 0x3c030800, 0x24631aa0, 0x00438821, - 0x8e24, 0x1084, 0x, 0x000d, 0x, 0x2400024d, - 0x8f850010, 0x24020001, 0xae22, 0x8ca70008, 0xa227, 0x8f620004, - 0x26300014, 0x02002021, 0x00021402, 0xa2220004, 0x304600ff, 0x24c60005, - 0x0e000673, 0x00063082, 0x8f620004, 0xa6220008, 0x8f430108, 0x3c021000, - 0x00621824, 0x1068, 0x, 0x97420104, 0x92230007, 0x2442ffec, - 0x3045, 0x34630002, 0x0a000321, 0xa2230007, 0x97420104, 0x2442fff0, - 0x3045, 0x8f620004, 0x3042, 0x2c420013, 0x5445, 0x92230007, - 0x92220007, 0x34420001, 0xa2220007, 0x92230007, 0x24020001, 0x10620009, - 0x28620002, 0x14400014, 0x24020002, 0x10620012, 0x24020003, 0x1062000a, - 0x, 0x0a000342, 0x, 0x8f820010, 0x8c43000c, 0x3c04, - 0x00641824, 0x00651825, 0x0a000342, 0xac43000c, 0x8f820010, 0x8c430010, - 0x3c04, 0x00641824, 0x00651825, 0xac430010, 0x8f620004, 0x3042, - 0x24420002, 0x00021083, 0xa2220005, 0x304500ff, 0x8f820010, 0x3c04, - 0x00052880, 0x00a22821, 0x8ca7, 0x96220008, 0x97430104, 0x00e42024, -
[PATCH 2.6.18 5.3/6 resend] bnx2: Use compressed firmware 3/6
Change bnx2_fw.h to use compressed data (3/6) Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/bnx2_fw.h b/drivers/net/bnx2_fw.h index c0e8d55..05e0294 100644 --- a/drivers/net/bnx2_fw.h +++ b/drivers/net/bnx2_fw.h @@ -1057,130 +1057,84 @@ static u32 bnx2_RXP_b06FwRodata[(0x28/4) static u32 bnx2_RXP_b06FwBss[(0x13a4/4) + 1] = { 0x0 }; static u32 bnx2_RXP_b06FwSbss[(0x1c/4) + 1] = { 0x0 }; -static u32 bnx2_rv2p_proc1[] = { - 0x0008, 0xac01, 0x000c, 0x2f81, 0x0010, 0x213f0004, - 0x0010, 0x20bf002c, 0x0010, 0x203f0143, 0x0018, 0x8000fffd, - 0x0010, 0xb1b8b017, 0x000b, 0x2fdf0002, 0x, 0x03d8, - 0x, 0x2c38, 0x0008, 0x2c80, 0x0008, 0x2d00, - 0x0010, 0x91d4, 0x0008, 0x2d800108, 0x0008, 0x0202, - 0x0010, 0x91de, 0x000f, 0x42e0001c, 0x0010, 0x91840a08, - 0x0008, 0x2c8000b0, 0x0008, 0x2d08, 0x0008, 0x2d800150, - 0x, 0x, 0x0010, 0x91de, 0x0010, 0x2c620002, - 0x0018, 0x8012, 0x000b, 0x2fdf0002, 0x000c, 0x1f82, - 0x, 0x2c07, 0x0018, 0x8000ffe6, 0x0008, 0x0202, - 0x000f, 0x42e0001c, 0x0010, 0x91840a08, 0x0008, 0x2c8000b0, - 0x0008, 0x2d08, 0x0010, 0x91d4, 0x0008, 0x2d800108, - 0x, 0x, 0x0010, 0x91de, 0x0018, 0x8004, - 0x000c, 0x1f82, 0x, 0x, 0x0018, 0x8000ffd9, - 0x000c, 0x2982, 0x000c, 0x1f82, 0x, 0x2adf, - 0x0008, 0x2a05, 0x0018, 0x8000ffd4, 0x0008, 0x02240030, - 0x0018, 0x0004, 0x0018, 0x8015, 0x0018, 0x8017, - 0x0018, 0x801b, 0x0018, 0x804c, 0x0018, 0x808c, - 0x0018, 0x800f, 0x0018, 0x800e, 0x0018, 0x800d, - 0x0018, 0x800c, 0x0018, 0x80c2, 0x0018, 0x800a, - 0x0018, 0x8009, 0x0018, 0x8008, 0x0018, 0x80fd, - 0x0018, 0x8006, 0x0018, 0x8005, 0x0018, 0x80ff, - 0x0018, 0x8104, 0x0018, 0x8002, 0x0018, 0x8098, - 0x0018, 0x8000, 0x000c, 0x1f81, 0x, 0x, - 0x0018, 0x8000ffba, 0x0010, 0x91d4, 0x000c, 0x2981, - 0x000c, 0x1f81, 0x0008, 0x2a02, 0x0018, 0x8000ffb5, - 0x0010, 0xb1a0b012, 0x000b, 0x2fdf0002, 0x, 0x2c20, - 0x0008, 0x2c80, 0x0008, 0x2d00, 0x0010, 0x91d4, - 0x0008, 0x2d80011c, 0x, 0x, 0x0010, 0x91de, - 0x000f, 0x4768, 0x000f, 0x060e0001, 0x0010, 0x001f, - 0x, 0x0f58, 0x, 0x0a64, 0x, 0x0ae5, - 0x, 0x0b66, 0x, 0x0d61, 0x0018, 0x8013, - 0x000f, 0x4768, 0x000b, 0x2fdf0002, 0x0008, 0x2c80, - 0x0008, 0x2d00, 0x0010, 0x91d4, 0x0008, 0x2d80011c, - 0x000f, 0x060e0001, 0x0010, 0x001f, 0x, 0x0f58, - 0x0010, 0x91de, 0x, 0x0a64, 0x, 0x0ae5, - 0x, 0x0b66, 0x, 0x0d61, 0x, 0x0262, - 0x000b, 0x2fdf0002, 0x, 0x309a, 0x, 0x3104, - 0x, 0x0c961800, 0x0009, 0x0c99, 0x0004, 0xcc993400, - 0x0010, 0xb1963202, 0x0008, 0x0f80, 0x000c, 0x2981, - 0x0010, 0x00220002, 0x000c, 0x29520001, 0x000c, 0x2952, - 0x0008, 0x2201, 0x000c, 0x1f81, 0x, 0x2adf, - 0x0008, 0x2a03, 0x0018, 0x8000ff83, 0x0010, 0xb1a0b01d, - 0x000b, 0x2fdf0002, 0x, 0x2c20, 0x0008, 0x2c8000b0, - 0x0008, 0x2d08, 0x0010, 0x91d4, 0x0008, 0x2d800150, - 0x, 0x, 0x0010, 0x205f, 0x0008, 0x2c80, - 0x0008, 0x2d00, 0x0008, 0x2d800108, 0x, 0x, - 0x0010, 0x91de, 0x000f, 0x4768, 0x, 0x060e, - 0x0010, 0x001f, 0x, 0x0f58, 0x0010, 0x91de, - 0x, 0x0a64, 0x, 0x0ae5, 0x, 0x0b67, - 0x, 0x0d62, 0x, 0x0ce71800, 0x0009, 0x0c99, - 0x0004, 0xcc993400, 0x0010, 0xb1963220, 0x0008, 0x0f80, - 0x0018, 0x801e, 0x000f, 0x4768, 0x000b, 0x2fdf0002, - 0x0008, 0x2c8000b0, 0x0008, 0x2d08, 0x0010, 0x91d4, - 0x0008, 0x2d80012c, 0x000f, 0x060e0001, 0x0010, 0x001f, - 0x, 0x0f58, 0x0010, 0x91de, 0x, 0x0a64, - 0x, 0x0ae5, 0x, 0x0b67,
[PATCH 2.6.18 5.4/6 resend] bnx2: Use compressed firmware 4/6
Change bnx2_fw.h to use compressed data (4/6) Signed-off-by: Michael Chan [EMAIL PROTECTED] diff --git a/drivers/net/bnx2_fw.h b/drivers/net/bnx2_fw.h index 05e0294..99d2989 100644 --- a/drivers/net/bnx2_fw.h +++ b/drivers/net/bnx2_fw.h @@ -1136,262 +1136,185 @@ static u8 bnx2_rv2p_proc1[] = { 0xfb, 0x49, 0x85, 0x0b, 0xb3, 0xf4, 0x7b, 0x4a, 0x83, 0x9f, 0x94, 0x15, 0x12, 0x3d, 0x80, 0x0b, 0x00, 0x00, 0x00 }; -static u32 bnx2_rv2p_proc2[] = { - 0x, 0x2a00, 0x0010, 0xb1d4, 0x0008, 0x02540003, - 0x0018, 0x0004, 0x0018, 0x800a, 0x0018, 0x800a, - 0x0018, 0x800e, 0x0018, 0x8056, 0x0018, 0x81b9, - 0x0018, 0x81e1, 0x0018, 0x819b, 0x0018, 0x81f9, - 0x0018, 0x819f, 0x0018, 0x81a6, 0x0018, 0x8000, - 0x000c, 0x2981, 0x, 0x2a00, 0x000c, 0x2980, - 0x0010, 0x2053, 0x0018, 0x8000ffee, 0x000c, 0x2981, - 0x0010, 0x91de, 0x0010, 0x001f, 0x, 0x2f80aa00, - 0x, 0x2a00, 0x, 0x0d61, 0x, 0x0362, - 0x, 0x2c40, 0x, 0x02638c00, 0x, 0x2646, - 0x0010, 0x00420002, 0x0008, 0x02040012, 0x0010, 0xb9060836, - 0x, 0x0f58, 0x, 0x0a64, 0x, 0x0ae5, - 0x, 0x0b66, 0x, 0x0c00, 0x, 0x0b80, - 0x0010, 0x00420009, 0x0008, 0x0cc60012, 0x0008, 0x0f83, - 0x, 0x, 0x0010, 0x009f, 0x0008, 0x27110012, - 0x, 0x6690, 0x0008, 0xa31b0012, 0x0018, 0x8008, - 0x, 0x0cc6, 0x0008, 0x0f83, 0x, 0x, - 0x0010, 0x009f, 0x, 0x2711, 0x, 0x6690, - 0x, 0x231b, 0x0010, 0xb197320e, 0x, 0x2596, - 0x, 0x021b, 0x0010, 0x001f, 0x0008, 0x0f83, - 0x000c, 0x2980, 0x0010, 0x2053, 0x, 0x22c50800, - 0x0010, 0x009f, 0x, 0x27002200, 0x, 0x26802000, - 0x, 0x231b, 0x000c, 0x69520001, 0x0018, 0x8000fff3, - 0x0010, 0x01130002, 0x0010, 0xb1980003, 0x0010, 0x001f, - 0x0008, 0x0f84, 0x0008, 0x2203, 0x0008, 0x2c8c, - 0x0008, 0x2d0c, 0x0010, 0x009f, 0x, 0x2596, - 0x000c, 0x2980, 0x, 0x3214, 0x, 0x3295, - 0x, 0x3316, 0x, 0x31e32e00, 0x0008, 0x2d800010, - 0x0010, 0x2053, 0x0018, 0x8000ffac, 0x, 0x2300, - 0x, 0x25e6, 0x0008, 0x220b, 0x000c, 0x6952, - 0x000c, 0x2980, 0x0010, 0x2053, 0x0018, 0x8000ffa5, - 0x000c, 0x2981, 0x0010, 0x91de, 0x, 0x2fd5, - 0x0010, 0x001f, 0x, 0x0270, 0x, 0x0d62, - 0x, 0xbb630800, 0x, 0x2a00, 0x0009, 0x076000ff, - 0x000f, 0x2c0e0007, 0x0008, 0x2c80, 0x0008, 0x2d64, - 0x0008, 0x2d80011c, 0x0009, 0x06420002, 0x000c, 0x61420001, - 0x, 0x0f40, 0x, 0x02d08c00, 0x, 0x2300, - 0x0004, 0x826da000, 0x, 0x8304a000, 0x, 0x22c50c00, - 0x, 0x0376, 0x0004, 0x83860a00, 0x, 0x83870c00, - 0x0010, 0x91de, 0x, 0x037c, 0x, 0x837b0c00, - 0x0001, 0x83060e00, 0x, 0x83870c00, 0x, 0x82850e00, - 0x0010, 0xb1860016, 0x000f, 0x47610018, 0x, 0x068e, - 0x000f, 0x47670010, 0x000f, 0x47e20010, 0x, 0x870e1e00, - 0x0010, 0xb70e1a10, 0x0010, 0x0ce7000e, 0x0008, 0x2209, - 0x, 0x286d, 0x000f, 0x65680010, 0x0003, 0xf66c9400, - 0x0010, 0xb972a003, 0x000c, 0x73e70019, 0x000c, 0x21420004, - 0x0018, 0x823f, 0x, 0x37ed, 0x000c, 0x73e7001a, - 0x0010, 0x2053, 0x0008, 0x2208, 0x000c, 0x61420004, - 0x, 0x02f6, 0x0004, 0x82840a00, 0x0010, 0xb1840a2b, - 0x0010, 0x2d67000a, 0x0010, 0xb96d0804, 0x0004, 0xb6ed0a00, - 0x, 0x37ed, 0x0018, 0x8029, 0x000c, 0x6142, - 0x, 0x3704, 0x, 0x3785, 0x000c, 0x33e7001a, - 0x0018, 0x8024, 0x0010, 0xb96d0809, 0x0004, 0xb6ed0a00, - 0x, 0x036d, 0x0004, 0xb76e0c00, 0x0010, 0x91ee0c1f, - 0x000c, 0x73e7001a, 0x0004, 0xb6ef0c00, 0x, 0x37ed, - 0x0018, 0x801b, 0x000c, 0x6142, 0x0010, 0xb7ee0a05, - 0x0010, 0xb96f0815, 0x0003,
Re: [RFC/PATCH 2/2] update sunrpc to use in-kernel sockets API
On Mon, 12 Jun 2006, Sridhar Samudrala wrote: - sendpage = sock-ops-sendpage ? : sock_no_sendpage; + sendpage = kernel_sendpage ? : sock_no_sendpage; This is not equivalent. -- James Morris [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: Using netconsole for debugging suspend/resume
On Monday 12 June 2006 23:25, Jeremy Fitzhardinge wrote: Andi Kleen wrote: On Monday 12 June 2006 17:38, Mark Lord wrote: Okay, so I'm daft. But.. *what* is it ?? We have two machines: target (being debugged), and host (anything). Sure, the target has to have ohci1394 loaded, and firescope running. But what about the *other* end of the connection? What commands? From the same manpage: The raw1394 module must be loaded and its device node be writable (this normally requires root) Ok it doesn't say you need ohci1394 too and doesn't say that's the target. If I do a new revision I'll perhaps expand the docs a bit. So load ohci1394/raw1394 and run firescope as root. Your distribution will hopefully take care of the device nodes. Usually you want something like firescope -Au System.map I think the confusion here is that the target doesn't need to be running anything; you can DMA chunks of memory with the OHCI controller with no need for any software support. You need ohci1394 loaded at least once. That is why it only works in relatively late boot. I've been playing with the idea of writing early1394 that just turns the DMA controller on as early as possible similar to earlyprintk on the target. Then it would be possible to use it for early debugging too. But so far it's not done yet. I'll try to write better docs next time. BTW Bernd did a gdbstub based on the firescope so you can even examine all kernel variables symbolically. It can even write variables, but not change the flow of the CPU. Standard firescope can just hexdump read/write symbols. With gdb it's also possible to do a core file of the kernel. -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: Remove Prism II support from Orinoco
On 12/06/06 17:10 -0700, Jesse Brandeburg wrote: On 6/12/06, John W. Linville [EMAIL PROTECTED] wrote: On Mon, Jun 12, 2006 at 01:49:54AM +0300, Faidon Liambotis wrote: Having two drivers supporting the same set of hardware seems pretty pointless to me. Plus, it confuses hotplugging/automatic detection. This subject comes-up from time to time. In fact, I'm pretty sure it came-up very recently w.r.t. orinoco and hostap. The consensus seems to be that drivers should have IDs for all devices they support, even if that means that some devices are supported by multiple drivers. This leaves the choice of which driver to use in the hands of the user and/or distro. my problem is that for my prism 2 adapter both drivers are loaded at which point neither of them works. I'm running FC5, and i have to keep removing the orinoco*.ko files to keep them from loading, so I'm all for this patch. use blacklist in module config to block one. Just put in /etc/modprobe.conf blacklist orinoco - 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 Prism II support from Orinoco
Stephen Hemminger wrote: my problem is that for my prism 2 adapter both drivers are loaded at which point neither of them works. I'm running FC5, and i have to keep removing the orinoco*.ko files to keep them from loading, so I'm all for this patch. use blacklist in module config to block one. Just put in /etc/modprobe.conf blacklist orinoco Unfortunately, that workaround doesn't work so well when you want to have the ability to plug real orinoco (hermes) cards to your computer... In other words and unless I'm missing something, there isn't currently a way to have a Hermes card and a Prism II card both plugged in and working. Regards, Faidon - 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/2] update sunrpc to use in-kernel sockets API
James Morris wrote: On Mon, 12 Jun 2006, Sridhar Samudrala wrote: - sendpage = sock-ops-sendpage ? : sock_no_sendpage; + sendpage = kernel_sendpage ? : sock_no_sendpage; This is not equivalent. Actually, we could make this a simple assignment as we check for sock-ops-sendpage in kernel_sendpage(). sendpage = kernel_sendpage; 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
[PATCH] sky2: suspend / resume fix
The resume bug was cause not by an early interrupt but because the idle timeout was not being stopped on suspend. Also disable hardware IRQ's on suspend. Will need to revisit this when wake-on-lan is added. Patch against 2.6.17-rc latest which includes Linus's attempt at fixing this. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- test.orig/drivers/net/sky2.c +++ test/drivers/net/sky2.c @@ -2164,6 +2164,13 @@ static void sky2_descriptor_error(struct /* If idle then force a fake soft NAPI poll once a second * to work around cases where sharing an edge triggered interrupt. */ +static inline void sky2_idle_start(struct sky2_hw *hw) +{ + if (idle_timeout 0) + mod_timer(hw-idle_timer, + jiffies + msecs_to_jiffies(idle_timeout)); +} + static void sky2_idle(unsigned long arg) { struct sky2_hw *hw = (struct sky2_hw *) arg; @@ -2183,9 +2190,6 @@ static int sky2_poll(struct net_device * int work_done = 0; u32 status = sky2_read32(hw, B0_Y2_SP_EISR); - if (!~status) - return 0; - if (status Y2_IS_HW_ERR) sky2_hw_intr(hw); @@ -3353,9 +3357,7 @@ static int __devinit sky2_probe(struct p sky2_write32(hw, B0_IMSK, Y2_IS_BASE); setup_timer(hw-idle_timer, sky2_idle, (unsigned long) hw); - if (idle_timeout 0) - mod_timer(hw-idle_timer, - jiffies + msecs_to_jiffies(idle_timeout)); + sky2_idle_start(hw); pci_set_drvdata(pdev, hw); @@ -3427,9 +3429,14 @@ static void __devexit sky2_remove(struct static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) { struct sky2_hw *hw = pci_get_drvdata(pdev); - int i; + int i, err; + u32 imask; + + pci_save_state(pdev); - for (i = 0; i 2; i++) { + del_timer_sync(hw-idle_timer); + + for (i = 0; i hw-ports; i++) { struct net_device *dev = hw-dev[i]; if (dev) { @@ -3441,8 +3448,17 @@ static int sky2_suspend(struct pci_dev * } } - pci_save_state(pdev); - return sky2_set_power_state(hw, pci_choose_state(pdev, state)); + imask = sky2_read32(hw, B0_IMSK); + sky2_write32(hw, B0_IMSK, 0); + synchronize_irq(hw-pdev-irq); + + err = sky2_set_power_state(hw, pci_choose_state(pdev, state)); + if (err) { + sky2_write32(hw, B0_IMSK, imask); + sky2_idle_start(hw); + } + + return err; } static int sky2_resume(struct pci_dev *pdev) @@ -3460,7 +3476,7 @@ static int sky2_resume(struct pci_dev *p if (err) goto out; - for (i = 0; i 2; i++) { + for (i = 0; i hw-ports; i++) { struct net_device *dev = hw-dev[i]; if (dev netif_running(dev)) { netif_device_attach(dev); @@ -3473,7 +3489,10 @@ static int sky2_resume(struct pci_dev *p } } } -out: + + sky2_idle_start(hw); + + out: return err; } #endif - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using netconsole for debugging suspend/resume
From: Andi Kleen [EMAIL PROTECTED] Date: Tue, 13 Jun 2006 05:47:49 +0200 I've been playing with the idea of writing early1394 that just turns the DMA controller on as early as possible similar to earlyprintk on the target. Then it would be possible to use it for early debugging too. But so far it's not done yet. Does this raw1394 thing with firescope just assume DMA address == physical address? How would it work to access all of physical memory properly on IOMMU platforms? - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 5.2/6 resend] bnx2: Use compressed firmware 2/6
Michael, you just sent out what appears to be 6 copies of the bnx2_fw.h patch :-) I think your patch sending script messed something up. - 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] sky2: suspend / resume fix
Stephen Hemminger wrote: @@ -2183,9 +2190,6 @@ static int sky2_poll(struct net_device * int work_done = 0; u32 status = sky2_read32(hw, B0_Y2_SP_EISR); - if (!~status) - return 0; - if (status Y2_IS_HW_ERR) sky2_hw_intr(hw); It's probably better to do goto end_of_function than simply return, but I disagree that this check should be removed. As long as you are reading values from the hardware, you should include this 0x check. It's certainly possible that the controller could have been unplugged from the time the interrupt handler last ran, and the time that NAPI poll runs. @@ -3427,9 +3429,14 @@ static void __devexit sky2_remove(struct static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) { struct sky2_hw *hw = pci_get_drvdata(pdev); - int i; + int i, err; + u32 imask; + + pci_save_state(pdev); - for (i = 0; i 2; i++) { + del_timer_sync(hw-idle_timer); It would seem smarter to put the timer removal before pci-save-state. + for (i = 0; i hw-ports; i++) { struct net_device *dev = hw-dev[i]; if (dev) { @@ -3441,8 +3448,17 @@ static int sky2_suspend(struct pci_dev * } } - pci_save_state(pdev); - return sky2_set_power_state(hw, pci_choose_state(pdev, state)); + imask = sky2_read32(hw, B0_IMSK); + sky2_write32(hw, B0_IMSK, 0); + synchronize_irq(hw-pdev-irq); This seems obviously racy to me. + err = sky2_set_power_state(hw, pci_choose_state(pdev, state)); + if (err) { + sky2_write32(hw, B0_IMSK, imask); + sky2_idle_start(hw); + } + + return err; } static int sky2_resume(struct pci_dev *pdev) @@ -3460,7 +3476,7 @@ static int sky2_resume(struct pci_dev *p if (err) goto out; - for (i = 0; i 2; i++) { + for (i = 0; i hw-ports; i++) { struct net_device *dev = hw-dev[i]; if (dev netif_running(dev)) { netif_device_attach(dev); @@ -3473,7 +3489,10 @@ static int sky2_resume(struct pci_dev *p } } } -out: + + sky2_idle_start(hw); + + out: return err; } #endif - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using netconsole for debugging suspend/resume
On Tuesday 13 June 2006 06:49, David Miller wrote: From: Andi Kleen [EMAIL PROTECTED] Date: Tue, 13 Jun 2006 05:47:49 +0200 I've been playing with the idea of writing early1394 that just turns the DMA controller on as early as possible similar to earlyprintk on the target. Then it would be possible to use it for early debugging too. But so far it's not done yet. Does this raw1394 thing with firescope just assume DMA address == physical address? Yes. How would it work to access all of physical memory properly on IOMMU platforms? It assumes you don't have an IOMMU - relies on all memory being accessible by ohci1394. On x86-64 it can't access 4GB also, but that's normally ok because the kernel log buffer is below that. I guess if you use 1394 with remote DMA for other protocols (like video etc.) there must be some way for the subsystem to map the memory even on IOMMU systems. I admit I haven't dived that deeply into the 1394 subsystem so I don't know how that works. -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: Using netconsole for debugging suspend/resume
From: Andi Kleen [EMAIL PROTECTED] Date: Tue, 13 Jun 2006 06:54:14 +0200 I guess if you use 1394 with remote DMA for other protocols (like video etc.) there must be some way for the subsystem to map the memory even on IOMMU systems. I admit I haven't dived that deeply into the 1394 subsystem so I don't know how that works. Video-1394 has it's own driver, which does a consistent DMA allocation, and then maps that into userspace using remap_pfn_range(). Entirely portable. Strangely I don't even see any bus_to_virt() etc. calls in the raw1394 driver, just these ptr2int() things... - 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 1/2] in-kernel sockets API
On Mon, 12 Jun 2006 16:56:01 -0700 Sridhar Samudrala [EMAIL PROTECTED] wrote: This patch makes it convenient to use the sockets API by the in-kernel users like sunrpc, cifs ocfs2 etc and any future users. Currently they get to this API by directly accesing the function pointers in the sock structure. Most of these functions are pretty simple and can be made inline and moved to linux/net.h. ... @@ -2176,3 +2279,13 @@ EXPORT_SYMBOL(sock_wake_async); EXPORT_SYMBOL(sockfd_lookup); EXPORT_SYMBOL(kernel_sendmsg); EXPORT_SYMBOL(kernel_recvmsg); +EXPORT_SYMBOL(kernel_bind); +EXPORT_SYMBOL(kernel_listen); +EXPORT_SYMBOL(kernel_accept); +EXPORT_SYMBOL(kernel_connect); +EXPORT_SYMBOL(kernel_getsockname); +EXPORT_SYMBOL(kernel_getpeername); +EXPORT_SYMBOL(kernel_getsockopt); +EXPORT_SYMBOL(kernel_setsockopt); +EXPORT_SYMBOL(kernel_sendpage); +EXPORT_SYMBOL(kernel_ioctl); Don't we want to restrict this to GPL code with EXPORT_SYMBOL_GPL? - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 1/6] bnx2: Add an rx drop counter
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:03 -0700 Add a counter for packets dropped by firmware. Signed-off-by: Michael Chan [EMAIL PROTECTED] Applied to net-2.6.18, thanks. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 2/6] bnx2: Allow WoL settings on new 5708 chips
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:08 -0700 Allow WOL settings on 5708 B2 and newer chips that have the problem fixed. Signed-off-by: Michael Chan [EMAIL PROTECTED] Applied to net-2.6.18, thanks. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 3/6] bnx2: Use CPU native page size
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:13 -0700 Use CPU native page size to determine various ring sizes. This allows order-0 memory allocations on all systems. Signed-off-by: Michael Chan [EMAIL PROTECTED] Are you sure you want to do this when the base page size is up to 64K on some IA64/PowerPC64/Sparc64 configurations? Maybe you can use a limit with some ifdef tests, something like: #if PAGE_SHIFT 13 #define BCM_PAGE_BITS 13 #else #define BCM_PAGE_BITS PAGE_SHIFT #endif which would limit it to 8K. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 4/6 revised] bnx2: Add firmware decompression
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 18:42:29 -0700 On Mon, 2006-06-12 at 17:38 -0700, David Miller wrote: From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:18 -0700 Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly. Signed-off-by: Michael Chan [EMAIL PROTECTED] ... +#define FNAME0x8 + if (zbuf[3] FNAME) + while (zbuf[n++] != 0); This can potentially loop past the end of zbuf[], so maybe put a sanity check against 'len' and return non-zero if we traverse past the end? Add functions to decompress firmware before loading to the internal CPUs. Compressing the firmware reduces the driver size significantly. Added file name length sanity check in the gzip header to prevent going past the end of buffer [suggested by DaveM]. Signed-off-by: Michael Chan [EMAIL PROTECTED] This looks great, applied. Thanks a lot. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 5/6] bnx2: Use compressed firmware
Applied the firmware update patch, thanks a lot. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.18 6/6] bnx2: Update version and reldate
From: Michael Chan [EMAIL PROTECTED] Date: Mon, 12 Jun 2006 17:17:22 -0700 Update driver version to 1.4.42. Signed-off-by: Michael Chan [EMAIL PROTECTED] I'll apply this once we decide what is going to happen with the BCM_PAGE_BITS change. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
IPsec and EAGAIN
Hi all, I have recently run into the issue where connect() returns -EAGAIN if the remote host is on the other end of an IPsec tunnel for which no SAD exists yet. I have read a few threads on the topic, and it seems that the idea is to implement a scheme similar to ARP for queueing outgoing packets until the SAD has been negotiated by the IKE process. I have a couple of questions: are there any patches out which solve this problem? Also, what is the purpose of the code in the xfrm_lookup function (in net/xfrm_policy.c) when `flags' is true? I have applied a patch similar to http://sourceforge.net/mailarchive/message.php?msg_id=8621194 which gives desirable behaviour (ie. telnet appears to pause while the racoon negotiation is performed, after which it connects just fine, no EAGAIN). Please CC me to any responses, I am not subscribed to the list. Thanks for your time, James -- James Ring - 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