* Re: [patch] latency tracer, 2.6.15-rc7
From: Lee Revell @ 2006-01-01 8:32 UTC (permalink / raw)
To: Linus Torvalds
Cc: Ingo Molnar, Dave Jones, Hugh Dickins, linux-kernel, NetDev
In-Reply-To: <1135991732.31111.57.camel@mindpipe>
On Fri, 2005-12-30 at 20:15 -0500, Lee Revell wrote:
> On Fri, 2005-12-30 at 17:02 -0800, Linus Torvalds wrote:
> >
> > On Fri, 30 Dec 2005, Lee Revell wrote:
> > >
> > > It seems that the networking code's use of RCU can cause 10ms+
> > > latencies:
> >
> > Hmm. Is there a big jump at the 10ms mark? Do you have a 100Hz timer
> > source?
> >
> > A latency jump at 10ms would tend to indicate a missed wakeup that
> > was "picked up" by the next timer tick.
>
> No there are no large jumps, it really seems that this was the network
> code causing an RCU callback to drop ~2K routes at once. Specifically
> RCU invokes dst_rcu_free 2085 times in a single batch
> (call_rcu_bh(&rt->u.dst.rcu_head, dst_rcu_free) is only called from
> rt_free() and rt_drop()).
>
> I have found that many of the paths in the network stack that can cause
> high latencies can be tuned via sysctls (for example
> net.ipv4.route.gc_thresh); this one may be the same.
On a related topic:
I thought I had solved the route cache flushing problem by tuning these
sysctls, but it does not seems to help.
The short version is that rt_run_flush and rt_garbage_collect can cause
15ms+ latencies when a lot of routes (up to 4096 it seems) are flushed
in one go:
$ grep "local_bh_enable (rt_run_flush)" /proc/latency_trace | wc -l
4096
$ grep "local_bh_enable (rt_garbage_collect)" /proc/latency_trace | wc
-l
4096
(rt_run_flush and rt_garbage_collect call spin_lock_bh/spin_unlock_bh
once for each flushed route so the above grep effectively counts the
number of routes flushed at once)
I reported this a year or so ago and it led to Ingo adding an option to
-rt (then called the voluntary preempt patch) to always run softirqs in
threads which makes rt_run_flush preemptible.
Anyway I thought I could work around this with mainline by tuning the
network stack to minimize the effect of route cache flushing on
scheduler latency using these sysctls to cause the route cache to be
flushed more often and/or limit the maximum size of the route cache:
$ sudo /sbin/sysctl -a | grep route
net.ipv4.route.gc_elasticity = 8
net.ipv4.route.gc_interval = 60
net.ipv4.route.gc_timeout = 300
net.ipv4.route.gc_min_interval_ms = 20
net.ipv4.route.gc_min_interval = 0
net.ipv4.route.max_size = 65536
net.ipv4.route.gc_thresh = 256
net.ipv4.route.max_delay = 10
net.ipv4.route.min_delay = 2
I tried lowering gc_min_interval_ms, gc_timeout, max_size, and gc_thresh
but rt_run_flush will still process up to 4096 (the size of the route
hash table?) routes at once.
(stop here if you don't care to interpret long latency_trace reports)
17ms+ latency caused by rt_run_flush then rt_garbage_collect processing
4096 routes:
preemption latency trace v1.1.5 on 2.6.15-rc7
--------------------------------------------------------------------
latency: 17286 us, #19154/19154, CPU#0 | (M:rt VP:0, KP:0, SP:0 HP:0)
-----------------
| task: gtk-gnutella-8581 (uid:1000 nice:0 policy:0 rt_prio:0)
-----------------
_------=> CPU#
/ _-----=> irqs-off
| / _----=> need-resched
|| / _---=> hardirq/softirq
||| / _--=> preempt-depth
|||| /
||||| delay
cmd pid ||||| time | caller
\ / ||||| \ | /
epiphany-8742 0dns8 0us : __trace_start_sched_wakeup (try_to_wake_up)
epiphany-8742 0dns8 1us : __trace_start_sched_wakeup <<...>-8581> (73 0)
epiphany-8742 0dns7 2us : preempt_schedule (__trace_start_sched_wakeup)
epiphany-8742 0dns6 2us : preempt_schedule (try_to_wake_up)
epiphany-8742 0dns5 3us : preempt_schedule (__wake_up)
epiphany-8742 0dns5 4us : preempt_schedule (ep_poll_safewake)
epiphany-8742 0dnH5 6us : do_IRQ (c011223e b 0)
epiphany-8742 0d.h. 6us : __do_IRQ (do_IRQ)
epiphany-8742 0d.h1 7us+: mask_and_ack_8259A (__do_IRQ)
epiphany-8742 0d.h. 12us : handle_IRQ_event (__do_IRQ)
epiphany-8742 0d.h. 13us : usb_hcd_irq (handle_IRQ_event)
epiphany-8742 0d.h. 13us : uhci_irq (usb_hcd_irq)
epiphany-8742 0d.h. 14us : via_driver_irq_handler (handle_IRQ_event)
epiphany-8742 0d.h. 16us : rhine_interrupt (handle_IRQ_event)
epiphany-8742 0d.h. 16us : ioread16 (rhine_interrupt)
epiphany-8742 0d.h. 17us : ioread8 (rhine_interrupt)
epiphany-8742 0d.h. 18us : iowrite16 (rhine_interrupt)
epiphany-8742 0d.h. 19us : ioread8 (rhine_interrupt)
epiphany-8742 0d.h. 20us : rhine_tx (rhine_interrupt)
epiphany-8742 0d.h1 21us : raise_softirq_irqoff (rhine_tx)
epiphany-8742 0d.h. 22us : ioread16 (rhine_interrupt)
epiphany-8742 0d.h. 23us : ioread8 (rhine_interrupt)
epiphany-8742 0d.h1 25us : note_interrupt (__do_IRQ)
epiphany-8742 0d.h1 25us : end_8259A_irq (__do_IRQ)
epiphany-8742 0d.h1 26us : enable_8259A_irq (end_8259A_irq)
epiphany-8742 0dnH5 28us : irq_exit (do_IRQ)
epiphany-8742 0dns5 28us < (2097760)
epiphany-8742 0dns4 29us : preempt_schedule (__wake_up)
epiphany-8742 0dns3 30us : preempt_schedule (sock_def_readable)
epiphany-8742 0dns2 31us : preempt_schedule (tcp_v4_rcv)
epiphany-8742 0dns1 32us : preempt_schedule (ip_local_deliver)
epiphany-8742 0dns. 33us : preempt_schedule (netif_receive_skb)
epiphany-8742 0dns. 33us : net_tx_action (__do_softirq)
epiphany-8742 0dns. 34us : __kfree_skb (net_tx_action)
epiphany-8742 0dns. 35us : sock_wfree (__kfree_skb)
epiphany-8742 0dns. 35us : kfree_skbmem (__kfree_skb)
epiphany-8742 0dns. 36us : skb_release_data (kfree_skbmem)
epiphany-8742 0dns. 37us : kfree (skb_release_data)
epiphany-8742 0dns. 38us : kmem_cache_free (kfree_skbmem)
epiphany-8742 0dn.. 39us : schedule (work_resched)
epiphany-8742 0dn.. 40us : stop_trace (schedule)
epiphany-8742 0dn.. 40us : profile_hit (schedule)
epiphany-8742 0dn.1 41us : sched_clock (schedule)
epiphany-8742 0dn.2 43us : recalc_task_prio (schedule)
epiphany-8742 0dn.2 44us : effective_prio (recalc_task_prio)
epiphany-8742 0dn.2 45us : requeue_task (schedule)
<...>-8581 0d..2 47us : __switch_to (schedule)
<...>-8581 0d..2 49us : schedule <epiphany-8742> (7d 73)
<...>-8581 0d.h2 50us : do_IRQ (c022ecf4 0 0)
<...>-8581 0d.h. 51us : __do_IRQ (do_IRQ)
<...>-8581 0d.h1 52us+: mask_and_ack_8259A (__do_IRQ)
<...>-8581 0d.h. 56us : handle_IRQ_event (__do_IRQ)
<...>-8581 0d.h. 56us : timer_interrupt (handle_IRQ_event)
<...>-8581 0d.h1 57us+: mark_offset_tsc (timer_interrupt)
<...>-8581 0d.h1 64us : do_timer (timer_interrupt)
<...>-8581 0d.h1 64us : update_wall_time (do_timer)
<...>-8581 0d.h1 65us : update_wall_time_one_tick (update_wall_time)
<...>-8581 0d.h1 66us : update_process_times (timer_interrupt)
<...>-8581 0d.h1 66us : account_system_time (update_process_times)
<...>-8581 0d.h1 67us : acct_update_integrals (account_system_time)
<...>-8581 0d.h1 69us : run_local_timers (update_process_times)
<...>-8581 0d.h1 69us : raise_softirq (run_local_timers)
<...>-8581 0d.h1 70us : scheduler_tick (update_process_times)
<...>-8581 0d.h1 71us : sched_clock (scheduler_tick)
<...>-8581 0d.h2 72us : task_timeslice (scheduler_tick)
<...>-8581 0d.h1 73us : run_posix_cpu_timers (update_process_times)
<...>-8581 0d.h1 74us : smp_local_timer_interrupt (timer_interrupt)
<...>-8581 0d.h1 75us : profile_tick (smp_local_timer_interrupt)
<...>-8581 0d.h1 76us : profile_hit (profile_tick)
<...>-8581 0d.h1 77us : note_interrupt (__do_IRQ)
<...>-8581 0d.h1 77us : end_8259A_irq (__do_IRQ)
<...>-8581 0d.h1 78us+: enable_8259A_irq (end_8259A_irq)
<...>-8581 0d.h2 80us : irq_exit (do_IRQ)
<...>-8581 0d..3 81us : do_softirq (irq_exit)
<...>-8581 0dns. 81us : __do_softirq (do_softirq)
<...>-8581 0dns. 82us : run_timer_softirq (__do_softirq)
<...>-8581 0dns. 83us : preempt_schedule (run_timer_softirq)
<...>-8581 0dns. 84us : rt_secret_rebuild (run_timer_softirq)
<...>-8581 0dns. 85us : rt_cache_flush (rt_secret_rebuild)
<...>-8581 0dns1 86us : del_timer (rt_cache_flush)
<...>-8581 0dns. 87us : local_bh_enable (rt_cache_flush)
<...>-8581 0dns. 88us : preempt_schedule (local_bh_enable)
<...>-8581 0dns. 88us : rt_run_flush (rt_cache_flush)
<...>-8581 0dns. 89us : get_random_bytes (rt_run_flush)
<...>-8581 0dns. 90us : extract_entropy (get_random_bytes)
<...>-8581 0dns. 91us : xfer_secondary_pool (extract_entropy)
<...>-8581 0dns. 92us : extract_entropy (xfer_secondary_pool)
<...>-8581 0dns. 93us : xfer_secondary_pool (extract_entropy)
<...>-8581 0dns. 94us : account (extract_entropy)
<...>-8581 0dns. 95us : preempt_schedule (account)
<...>-8581 0dns. 96us : extract_buf (extract_entropy)
<...>-8581 0dns. 97us : sha_init (extract_buf)
<...>-8581 0dns. 98us+: sha_transform (extract_buf)
<...>-8581 0dns. 106us+: __add_entropy_words (extract_buf)
<...>-8581 0dns. 108us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 109us+: sha_transform (extract_buf)
<...>-8581 0dns. 116us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 117us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 118us+: sha_transform (extract_buf)
<...>-8581 0dns. 125us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 126us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 127us+: sha_transform (extract_buf)
<...>-8581 0dns. 134us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 135us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 136us+: sha_transform (extract_buf)
<...>-8581 0dns. 143us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 144us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 144us+: sha_transform (extract_buf)
<...>-8581 0dns. 151us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 152us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 153us+: sha_transform (extract_buf)
<...>-8581 0dns. 160us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 161us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 162us+: sha_transform (extract_buf)
<...>-8581 0dns. 169us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 170us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 171us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 172us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 173us+: sha_transform (extract_buf)
<...>-8581 0dns. 180us : __add_entropy_words (xfer_secondary_pool)
<...>-8581 0dns. 182us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 183us : credit_entropy_store (xfer_secondary_pool)
<...>-8581 0dns. 184us : preempt_schedule (credit_entropy_store)
<...>-8581 0dns. 185us : account (extract_entropy)
<...>-8581 0dns1 186us : __wake_up (account)
<...>-8581 0dns2 186us : __wake_up_common (__wake_up)
<...>-8581 0dns1 187us : preempt_schedule (__wake_up)
<...>-8581 0dns. 188us : preempt_schedule (account)
<...>-8581 0dns. 188us : extract_buf (extract_entropy)
<...>-8581 0dns. 189us : sha_init (extract_buf)
<...>-8581 0dns. 190us+: sha_transform (extract_buf)
<...>-8581 0dns. 197us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 198us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 198us+: sha_transform (extract_buf)
<...>-8581 0dns. 205us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 206us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 207us : __add_entropy_words (extract_buf)
<...>-8581 0dns. 209us : preempt_schedule (__add_entropy_words)
<...>-8581 0dns. 209us+: sha_transform (extract_buf)
<...>-8581 0dns. 217us : local_bh_enable (rt_run_flush)
<...>-8581 0dns. 218us : preempt_schedule (local_bh_enable)
<...>-8581 0dns. 219us : call_rcu_bh (rt_run_flush)
<...>-8581 0dns. 220us : local_bh_enable (rt_run_flush)
<...>-8581 0dns. 221us : preempt_schedule (local_bh_enable)
<...>-8581 0dns. 222us : call_rcu_bh (rt_run_flush)
<...>-8581 0dns. 223us : call_rcu_bh (rt_run_flush)
<...>-8581 0dns. 224us : local_bh_enable (rt_run_flush)
<...>-8581 0dns. 225us : preempt_schedule (local_bh_enable)
<...>-8581 0dns. 226us : local_bh_enable (rt_run_flush)
<...>-8581 0dns. 227us : preempt_schedule (local_bh_enable)
[ rt_run_flush x 4096 routes ]
<...>-8581 0dns. 8763us : local_bh_enable (rt_run_flush)
<...>-8581 0dns. 8764us : preempt_schedule (local_bh_enable)
<...>-8581 0dns. 8765us : mod_timer (rt_secret_rebuild)
<...>-8581 0dns. 8766us : __mod_timer (mod_timer)
<...>-8581 0dns. 8766us : lock_timer_base (__mod_timer)
<...>-8581 0dns1 8767us : internal_add_timer (__mod_timer)
<...>-8581 0dns. 8769us+: preempt_schedule (__mod_timer)
<...>-8581 0dns. 8771us : preempt_schedule (run_timer_softirq)
<...>-8581 0dns. 8772us : tcp_delack_timer (run_timer_softirq)
[ tcp_delack_timer ... ]
<...>-8581 0dns. 8841us : preempt_schedule (tcp_delack_timer)
<...>-8581 0dns. 8842us+: preempt_schedule (run_timer_softirq)
<...>-8581 0dnH. 8845us : do_IRQ (c010dc95 b 0)
[ network irq ]
<...>-8581 0dnH. 8871us : irq_exit (do_IRQ)
<...>-8581 0dns. 8871us < (2097760)
<...>-8581 0dns. 8872us : run_timer_softirq (__do_softirq)
<...>-8581 0dns. 8873us : net_rx_action (__do_softirq)
<...>-8581 0dns. 8874us : process_backlog (net_rx_action)
<...>-8581 0dns. 8875us : netif_receive_skb (process_backlog)
<...>-8581 0dns1 8877us : packet_rcv_spkt (netif_receive_skb)
<...>-8581 0dns1 8878us : skb_clone (packet_rcv_spkt)
<...>-8581 0dns1 8878us : kmem_cache_alloc (skb_clone)
<...>-8581 0dns1 8880us : strlcpy (packet_rcv_spkt)
<...>-8581 0dns2 8881us : sk_run_filter (packet_rcv_spkt)
<...>-8581 0dns1 8882us : preempt_schedule (packet_rcv_spkt)
<...>-8581 0dns1 8883us : __kfree_skb (packet_rcv_spkt)
<...>-8581 0dns1 8884us : skb_release_data (kfree_skbmem)
<...>-8581 0dns1 8884us : kmem_cache_free (kfree_skbmem)
<...>-8581 0dns1 8885us : ip_rcv (netif_receive_skb)
<...>-8581 0dns1 8886us : ip_route_input (ip_rcv)
<...>-8581 0dns1 8887us : rt_hash_code (ip_route_input)
<...>-8581 0dns1 8888us : preempt_schedule (ip_route_input)
<...>-8581 0dns1 8889us : ip_route_input_slow (ip_route_input)
<...>-8581 0dns1 8890us : preempt_schedule (ip_route_input_slow)
<...>-8581 0dns1 8891us+: memset (ip_route_input_slow)
<...>-8581 0dns1 8893us+: fn_hash_lookup (ip_route_input_slow)
<...>-8581 0dns2 8895us : fib_semantic_match (fn_hash_lookup)
<...>-8581 0dns1 8897us : preempt_schedule (fn_hash_lookup)
<...>-8581 0dns1 8899us : fib_validate_source (ip_route_input_slow)
<...>-8581 0dns1 8900us : memset (fib_validate_source)
<...>-8581 0dns1 8901us : preempt_schedule (fib_validate_source)
<...>-8581 0dns1 8902us : fn_hash_lookup (fib_validate_source)
<...>-8581 0dns1 8903us : preempt_schedule (fn_hash_lookup)
<...>-8581 0dns1 8904us : fn_hash_lookup (fib_validate_source)
<...>-8581 0dns2 8906us : fib_semantic_match (fn_hash_lookup)
<...>-8581 0dns1 8907us : preempt_schedule (fn_hash_lookup)
<...>-8581 0dns1 8908us : __fib_res_prefsrc (fib_validate_source)
<...>-8581 0dns1 8909us : inet_select_addr (__fib_res_prefsrc)
<...>-8581 0dns1 8910us+: preempt_schedule (inet_select_addr)
<...>-8581 0dns1 8912us : dst_alloc (ip_route_input_slow)
<...>-8581 0dns1 8913us+: rt_garbage_collect (dst_alloc)
<...>-8581 0dns1 8916us : local_bh_enable (rt_garbage_collect)
<...>-8581 0dns1 8917us : preempt_schedule (local_bh_enable)
<...>-8581 0dns1 8918us : local_bh_enable (rt_garbage_collect)
<...>-8581 0dns1 8919us : preempt_schedule (local_bh_enable)
[ rt_garbage_collect x 4096 routes ]
<...>-8581 0dns1 16460us : local_bh_enable (rt_garbage_collect)
<...>-8581 0dns1 16461us : preempt_schedule (local_bh_enable)
<...>-8581 0dns1 16462us+: kmem_cache_alloc (dst_alloc)
<...>-8581 0dns1 16468us : preempt_schedule (ip_route_input_slow)
<...>-8581 0dns1 16469us : rt_hash_code (ip_route_input_slow)
<...>-8581 0dns1 16470us : rt_intern_hash (ip_route_input_slow)
<...>-8581 0dns1 16472us : local_bh_enable (rt_intern_hash)
<...>-8581 0dns1 16473us+: preempt_schedule (local_bh_enable)
<...>-8581 0dns1 16476us+: ip_local_deliver (ip_rcv)
[ ~1ms more network softirqs ]
<...>-8581 0dns. 17278us+: preempt_schedule (rcu_check_quiescent_state)
<...>-8581 0dn.2 17280us < (2097760)
<...>-8581 0dn.1 17281us : preempt_schedule (schedule)
<...>-8581 0dn.1 17282us : trace_stop_sched_switched (schedule)
<...>-8581 0dn.2 17283us+: trace_stop_sched_switched <<...>-8581> (73 0)
<...>-8581 0dn.2 17285us : trace_stop_sched_switched (schedule)
Lee
^ permalink raw reply
* 2.6.15-rc7: known regressions
From: Adrian Bunk @ 2006-01-02 16:46 UTC (permalink / raw)
To: Linus Torvalds, Linux Kernel Mailing List
Cc: Kirill Korotaev, Ismail Donmez, Michael Madore, David Brownell,
Wu Fengguang, Paul E. McKenney, Mathias Klein, Christian Casteyde,
P. Christeas, Mauro Carvalho Chehab, Torsten Seeboth, pj,
simon.derr, jt, netdev, Andrey Borzenkov, gregkh, linux-usb-devel,
phil.el, oprofile-list, perex, alsa-devel
In-Reply-To: <Pine.LNX.4.64.0512241930370.14098@g5.osdl.org>
This email lists some known regressions in 2.6.15-rc7 compared to 2.6.14.
If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you was declared guilty for a breakage or in any other way involved
with one or more of these issues.
Subject : cpuset_excl_nodes_overlap() may sleep under tasklist_lock
References : http://lkml.org/lkml/2005/12/28/63
Submitter : Kirill Korotaev <dev@sw.ru>
Status : unknown
Subject : /sys/class/net/<device name>/wireless directory is gone
References : http://bugzilla.kernel.org/show_bug.cgi?id=5800
http://marc.theaimsgroup.com/?l=linux-netdev&m=113619905529636&w=2
Submitter : Ismail Donmez <ismail@uludag.org.tr>
Handled-By : Andrey Borzenkov <arvidjaar@mail.ru>
Status : patch available
Subject : USB handoff, irq 193: nobody cared!
References : http://lkml.org/lkml/2005/11/14/274
Submitter : Michael Madore <michael.madore@gmail.com>
Status : unknown, caused by a patch by David Brownell
Subject : BUG: spinlock recursion on 2.6.14-mm2 when oprofiling
References : http://lkml.org/lkml/2005/11/18/95
Submitter : Wu Fengguang <wfg@mail.ustc.edu.cn>
Handled-By : "Paul E. McKenney" <paulmck@us.ibm.com>
Status : unknown, reported against -mm, already fixed in -mm
(make-rcu-task_struct-safe-for-oprofile.patch)
Is this bug present in Linus' tree?
Subject : oops in kernel 2.6.15-rc{6,7}
References : http://lkml.org/lkml/2005/12/28/75
http://lkml.org/lkml/2005/12/30/119
Submitter : Mathias Klein <ma_klein@gmx.de>
Status : unknown
Subject : No sound with snd_intel8x0 & ALi M5455 chipset
(kobject_register failed)
References : http://bugzilla.kernel.org/show_bug.cgi?id=5760
Submitter : Christian Casteyde <casteyde.christian@free.fr>
Status : submitter was asked to do a binary search for
the guilty patch
Subject : No sound from CX23880 tuner w. 2.6.15-rc5
References : http://lkml.org/lkml/2005/12/12/190
http://www.spinics.net/lists/vfl/msg22791.html
Submitter : "P. Christeas" <p_christ@hol.gr>
Handled-By : Mauro Carvalho Chehab <mchehab@infradead.org>
Torsten Seeboth <Torsten.Seeboth@t-online.de>
Status : regression in cx88-tvaudio.c, no patch known
Subject : x86_64: PANIC: early exception
References : http://bugzilla.kernel.org/show_bug.cgi?id=5758
Status : Andi considers his patch too risky for 2.6.15,
workaround available, should be noted in the
final 2.6.15 announcement
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply
* Re: [PATCH][2.6.14.5] fix /sys/class/net/<if>/wireless without dev->get_wireless_stats
From: Andrey Borzenkov @ 2006-01-02 17:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <200601021545.59097.ismail@uludag.org.tr>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I accidentally used wrong lkml address, so I resend it now with proper format.
dev->get_wireless_stats is deprecated but removing it also removes wireless
subdirectory in sysfs. This patch puts it back.
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
- ---
- --- linux-2.6.14.5/net/core/net-sysfs.c.orig 2005-12-27 03:26:33.000000000 +0300
+++ linux-2.6.14.5/net/core/net-sysfs.c 2006-01-02 13:33:34.000000000 +0300
@@ -16,6 +16,7 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
+#include <net/iw_handler.h>
#define to_class_dev(obj) container_of(obj,struct class_device,kobj)
#define to_net_dev(class) container_of(class, struct net_device, class_dev)
@@ -313,13 +314,19 @@ static ssize_t wireless_show(struct clas
char *))
{
struct net_device *dev = to_net_dev(cd);
- - const struct iw_statistics *iw;
+ const struct iw_statistics *iw = NULL;
ssize_t ret = -EINVAL;
read_lock(&dev_base_lock);
- - if (dev_isalive(dev) && dev->get_wireless_stats
- - && (iw = dev->get_wireless_stats(dev)) != NULL)
- - ret = (*format)(iw, buf);
+ if (dev_isalive(dev)) {
+ if(dev->wireless_handlers &&
+ dev->wireless_handlers->get_wireless_stats)
+ iw = dev->wireless_handlers->get_wireless_stats(dev);
+ else if (dev->get_wireless_stats)
+ iw = dev->get_wireless_stats(dev);
+ if (iw != NULL)
+ ret = (*format)(iw, buf);
+ }
read_unlock(&dev_base_lock);
return ret;
@@ -420,7 +427,8 @@ void netdev_unregister_sysfs(struct net_
sysfs_remove_group(&class_dev->kobj, &netstat_group);
#ifdef WIRELESS_EXT
- - if (net->get_wireless_stats)
+ if ((net->get_wireless_stats ||
+ net->wireless_handlers && net->wireless_handlers->get_wireless_stats))
sysfs_remove_group(&class_dev->kobj, &wireless_group);
#endif
class_device_del(class_dev);
@@ -453,7 +461,8 @@ int netdev_register_sysfs(struct net_dev
goto out_unreg;
#ifdef WIRELESS_EXT
- - if (net->get_wireless_stats &&
+ if ((net->get_wireless_stats ||
+ net->wireless_handlers && net->wireless_handlers->get_wireless_stats) &&
(ret = sysfs_create_group(&class_dev->kobj, &wireless_group)))
goto out_cleanup;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDuV+kR6LMutpd94wRAugpAKChYCaH91dykwqMPGb6Xm5kXmIa0ACePENS
QwHqJFgsCyblXHkUKdZM9j0=
=37cH
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: 2.6.15-rc7: known regressions
From: Paul E. McKenney @ 2006-01-02 18:57 UTC (permalink / raw)
To: Adrian Bunk
Cc: Linus Torvalds, Linux Kernel Mailing List, Kirill Korotaev,
Ismail Donmez, Michael Madore, David Brownell, Wu Fengguang,
Mathias Klein, Christian Casteyde, P. Christeas,
Mauro Carvalho Chehab, Torsten Seeboth, pj, simon.derr, jt,
netdev, Andrey Borzenkov, gregkh, linux-usb-devel, phil.el,
oprofile-list, perex, alsa-devel
In-Reply-To: <20060102164636.GH17398@stusta.de>
On Mon, Jan 02, 2006 at 05:46:36PM +0100, Adrian Bunk wrote:
> This email lists some known regressions in 2.6.15-rc7 compared to 2.6.14.
>
> If you find your name in the Cc header, you are either submitter of one
> of the bugs, maintainer of an affectected subsystem or driver, a patch
> of you was declared guilty for a breakage or in any other way involved
> with one or more of these issues.
[ . . . ]
> Subject : BUG: spinlock recursion on 2.6.14-mm2 when oprofiling
> References : http://lkml.org/lkml/2005/11/18/95
> Submitter : Wu Fengguang <wfg@mail.ustc.edu.cn>
> Handled-By : "Paul E. McKenney" <paulmck@us.ibm.com>
> Status : unknown, reported against -mm, already fixed in -mm
> (make-rcu-task_struct-safe-for-oprofile.patch)
> Is this bug present in Linus' tree?
No, this bug is not present in Linus's tree.
Thanx, Paul
^ permalink raw reply
* [PATCH - 2.6.14.5]x25: fix for broken x25 module
From: Shaun Pereira @ 2006-01-03 5:48 UTC (permalink / raw)
To: linux-kenel; +Cc: linux-x25, x25 maintainer, Andrew Morton, linux netdev
Hi
Have included a patch fix for the x25 module in the latest stable
version of the kernel.
Problem:
When a user-space server application calls bind on a socket, then
in kernel space this bound socket is considered 'x25-linked' and the
SOCK_ZAPPED flag is unset.(As in x25_bind()/af_x25.c).
Now when a user-space client application attempts to connect to the
server on the listening socket, if the kernel accepts this in-coming
call, then it returns a new socket to userland and attempts to reply to
the caller.
The reply/x25_sendmsg() will fail, because the new socket created on
call-accept has its SOCK_ZAPPED flag set by x25_make_new().
(sock_init_data() called by x25_alloc_socket() called by x25_make_new()
sets the flag to SOCK_ZAPPED)).
Fix:
Using the sock_copy_flag() routine available in sock.h fixes this.
Tested on 32 and 64 bit kernels with x25 over tcp.
I hope this fix can be applied to the next release of the kernel.
Many Thanks
Shaun
Signed-off-by:Shaun Pereira <pereira.shaun@gmail.com>
diff -uprN -X dontdiff linux-2.6.14.5-vanilla/net/x25/af_x25.c
linux-2.6.14.5/net/x25/af_x25.c
--- linux-2.6.14.5-vanilla/net/x25/af_x25.c 2005-12-27
11:26:33.000000000 +1100
+++ linux-2.6.14.5/net/x25/af_x25.c 2006-01-03 10:25:39.000000000 +1100
@@ -540,12 +540,7 @@ static struct sock *x25_make_new(struct
sk->sk_state = TCP_ESTABLISHED;
sk->sk_sleep = osk->sk_sleep;
sk->sk_backlog_rcv = osk->sk_backlog_rcv;
-
- if (sock_flag(osk, SOCK_ZAPPED))
- sock_set_flag(sk, SOCK_ZAPPED);
-
- if (sock_flag(osk, SOCK_DBG))
- sock_set_flag(sk, SOCK_DBG);
+ sock_copy_flags(sk, osk);
ox25 = x25_sk(osk);
x25->t21 = ox25->t21;
^ permalink raw reply
* [PATCH] fix a few "warning: 'cleanup_card' defined but not used"
From: Denis Vlasenko @ 2006-01-03 8:03 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 146 bytes --]
These warnings are emitted if non-modular network drivers are built.
Fixes just move cleanup_card() definitions into #ifdef MODULE region.
--
vda
[-- Attachment #2: linux-2.6.15-rc7.cleanup_card.patch --]
[-- Type: text/x-diff, Size: 12844 bytes --]
CC drivers/net/wd.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/wd.c:131: warning: 'cleanup_card' defined but not used
CC drivers/net/3c503.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/3c503.c:152: warning: 'cleanup_card' defined but not used
CC drivers/net/ne.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/ne.c:216: warning: 'cleanup_card' defined but not used
CC drivers/net/hp.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/hp.c:106: warning: 'cleanup_card' defined but not used
CC drivers/net/hp-plus.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/hp-plus.c:142: warning: 'cleanup_card' defined but not used
CC drivers/net/smc-ultra.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/smc-ultra.c:172: warning: 'cleanup_card' defined but not used
CC drivers/net/smc-ultra32.o
CC drivers/net/e2100.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/e2100.c:144: warning: 'cleanup_card' defined but not used
CC drivers/net/es3210.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/es3210.c:159: warning: 'cleanup_card' defined but not used
CC drivers/net/lne390.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/lne390.c:149: warning: 'cleanup_card' defined but not used
CC drivers/net/ne3210.o
CC drivers/net/b44.o
CC drivers/net/forcedeth.o
CC drivers/net/lance.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/lance.c:313: warning: 'cleanup_card' defined but not used
CC drivers/net/3c501.o
CC drivers/net/3c507.o
CC drivers/net/3c515.o
CC drivers/net/eepro.o
CC drivers/net/8139cp.o
CC drivers/net/8139too.o
CC drivers/net/depca.o
CC drivers/net/ewrk3.o
CC drivers/net/ni52.o
CC drivers/net/ni65.o
CC drivers/net/3c505.o
CC drivers/net/ac3200.o
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/ac3200.c:127: warning: 'cleanup_card' defined but not used
CC drivers/net/82596.o
diff -urpN linux-2.6.15-rc7.src/drivers/net/3c503.c linux-2.6.15-rc7.fix/drivers/net/3c503.c
--- linux-2.6.15-rc7.src/drivers/net/3c503.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/3c503.c Sun Jan 1 16:54:08 2006
@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev)
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: el2_close() handles free_irq */
- release_region(dev->base_addr, EL2_IO_EXTENT);
- if (ei_status.mem)
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init el2_probe(int unit)
{
@@ -724,6 +716,14 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: el2_close() handles free_irq */
+ release_region(dev->base_addr, EL2_IO_EXTENT);
+ if (ei_status.mem)
+ iounmap(ei_status.mem);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/ac3200.c linux-2.6.15-rc7.fix/drivers/net/ac3200.c
--- linux-2.6.15-rc7.src/drivers/net/ac3200.c Fri Dec 30 14:11:12 2005
+++ linux-2.6.15-rc7.fix/drivers/net/ac3200.c Sun Jan 1 16:54:35 2006
@@ -123,14 +123,6 @@ static int __init do_ac3200_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* Someday free_irq may be in ac_close_card() */
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, AC_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init ac3200_probe(int unit)
{
@@ -404,6 +396,14 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ /* Someday free_irq may be in ac_close_card() */
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, AC_IO_EXTENT);
+ iounmap(ei_status.mem);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/e2100.c linux-2.6.15-rc7.fix/drivers/net/e2100.c
--- linux-2.6.15-rc7.src/drivers/net/e2100.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/e2100.c Sun Jan 1 16:31:09 2006
@@ -140,13 +140,6 @@ static int __init do_e2100_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: e21_close() handles free_irq */
- iounmap(ei_status.mem);
- release_region(dev->base_addr, E21_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init e2100_probe(int unit)
{
@@ -461,6 +454,13 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: e21_close() handles free_irq */
+ iounmap(ei_status.mem);
+ release_region(dev->base_addr, E21_IO_EXTENT);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/es3210.c linux-2.6.15-rc7.fix/drivers/net/es3210.c
--- linux-2.6.15-rc7.src/drivers/net/es3210.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/es3210.c Sun Jan 1 16:33:17 2006
@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, ES_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init es_probe(int unit)
{
@@ -454,6 +447,13 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, ES_IO_EXTENT);
+ iounmap(ei_status.mem);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/hp-plus.c linux-2.6.15-rc7.fix/drivers/net/hp-plus.c
--- linux-2.6.15-rc7.src/drivers/net/hp-plus.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/hp-plus.c Sun Jan 1 16:33:33 2006
@@ -138,12 +138,6 @@ static int __init do_hpp_probe(struct ne
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: hpp_close() handles free_irq */
- release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init hp_plus_probe(int unit)
{
@@ -471,6 +465,12 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: hpp_close() handles free_irq */
+ release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/hp.c linux-2.6.15-rc7.fix/drivers/net/hp.c
--- linux-2.6.15-rc7.src/drivers/net/hp.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/hp.c Sun Jan 1 16:31:36 2006
@@ -102,12 +102,6 @@ static int __init do_hp_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init hp_probe(int unit)
{
@@ -442,6 +436,12 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/lance.c linux-2.6.15-rc7.fix/drivers/net/lance.c
--- linux-2.6.15-rc7.src/drivers/net/lance.c Fri Dec 30 14:17:46 2005
+++ linux-2.6.15-rc7.fix/drivers/net/lance.c Sun Jan 1 16:32:50 2006
@@ -309,17 +309,6 @@ static void lance_tx_timeout (struct net
\f
-static void cleanup_card(struct net_device *dev)
-{
- struct lance_private *lp = dev->priv;
- if (dev->dma != 4)
- free_dma(dev->dma);
- release_region(dev->base_addr, LANCE_TOTAL_SIZE);
- kfree(lp->tx_bounce_buffs);
- kfree((void*)lp->rx_buffs);
- kfree(lp);
-}
-
#ifdef MODULE
#define MAX_CARDS 8 /* Max number of interfaces (cards) per module */
@@ -365,6 +354,17 @@ int init_module(void)
if (found != 0)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ struct lance_private *lp = dev->priv;
+ if (dev->dma != 4)
+ free_dma(dev->dma);
+ release_region(dev->base_addr, LANCE_TOTAL_SIZE);
+ kfree(lp->tx_bounce_buffs);
+ kfree((void*)lp->rx_buffs);
+ kfree(lp);
}
void cleanup_module(void)
diff -urpN linux-2.6.15-rc7.src/drivers/net/lne390.c linux-2.6.15-rc7.fix/drivers/net/lne390.c
--- linux-2.6.15-rc7.src/drivers/net/lne390.c Fri Dec 30 14:17:47 2005
+++ linux-2.6.15-rc7.fix/drivers/net/lne390.c Sun Jan 1 16:33:51 2006
@@ -145,13 +145,6 @@ static int __init do_lne390_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, LNE390_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init lne390_probe(int unit)
{
@@ -438,6 +431,13 @@ int init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, LNE390_IO_EXTENT);
+ iounmap(ei_status.mem);
}
void cleanup_module(void)
diff -urpN linux-2.6.15-rc7.src/drivers/net/ne.c linux-2.6.15-rc7.fix/drivers/net/ne.c
--- linux-2.6.15-rc7.src/drivers/net/ne.c Fri Dec 30 14:17:47 2005
+++ linux-2.6.15-rc7.fix/drivers/net/ne.c Sun Jan 1 16:31:54 2006
@@ -212,15 +212,6 @@ static int __init do_ne_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
- if (idev)
- pnp_device_detach(idev);
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, NE_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
@@ -857,6 +848,15 @@ int init_module(void)
if (found)
return 0;
return -ENODEV;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+ if (idev)
+ pnp_device_detach(idev);
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void)
diff -urpN linux-2.6.15-rc7.src/drivers/net/ne2.c linux-2.6.15-rc7.fix/drivers/net/ne2.c
--- linux-2.6.15-rc7.src/drivers/net/ne2.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/ne2.c Sun Jan 1 16:32:18 2006
@@ -278,14 +278,6 @@ static int __init do_ne2_probe(struct ne
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- mca_mark_as_unused(ei_status.priv);
- mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, NE_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init ne2_probe(int unit)
{
@@ -810,6 +802,14 @@ int init_module(void)
return 0;
printk(KERN_WARNING "ne2.c: No NE/2 card found\n");
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ mca_mark_as_unused(ei_status.priv);
+ mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void)
diff -urpN linux-2.6.15-rc7.src/drivers/net/smc-ultra.c linux-2.6.15-rc7.fix/drivers/net/smc-ultra.c
--- linux-2.6.15-rc7.src/drivers/net/smc-ultra.c Fri Dec 30 14:11:14 2005
+++ linux-2.6.15-rc7.fix/drivers/net/smc-ultra.c Sun Jan 1 16:53:50 2006
@@ -168,18 +168,6 @@ static int __init do_ultra_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: ultra_close_card() does free_irq */
-#ifdef __ISAPNP__
- struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
- if (idev)
- pnp_device_detach(idev);
-#endif
- release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init ultra_probe(int unit)
{
@@ -592,6 +580,18 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: ultra_close_card() does free_irq */
+#ifdef __ISAPNP__
+ struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+ if (idev)
+ pnp_device_detach(idev);
+#endif
+ release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
+ iounmap(ei_status.mem);
}
void
diff -urpN linux-2.6.15-rc7.src/drivers/net/wd.c linux-2.6.15-rc7.fix/drivers/net/wd.c
--- linux-2.6.15-rc7.src/drivers/net/wd.c Mon Aug 29 02:41:01 2005
+++ linux-2.6.15-rc7.fix/drivers/net/wd.c Sun Jan 1 16:32:05 2006
@@ -127,13 +127,6 @@ static int __init do_wd_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init wd_probe(int unit)
{
@@ -536,6 +529,13 @@ init_module(void)
if (found)
return 0;
return -ENXIO;
+}
+
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
+ iounmap(ei_status.mem);
}
void
^ permalink raw reply
* Re: [PATCH] [TRIVIAL] prism54/islpci_eth.c: dev_kfree_skb in irq context
From: Graham Gower @ 2006-01-03 12:19 UTC (permalink / raw)
To: Roger While; +Cc: linux-kernel, netdev
In-Reply-To: <6.1.1.1.2.20060103105620.02c523e0@192.168.6.12>
012345678901234567890123456789012345678901234567890123456789
On 03/01/06, Roger While <simrw@sim-basis.de> wrote:
> What makes you think this is in IRQ context ?
>
Er... yeah. I must have been off my nut when I wrote that comment.
A more apt comment should perhaps have been "dev_kfree_skb shouldn't be
used with interrupts disabled". Forgive my noobness, I'm a kernel patch virgin.
My logs were starting to fill with messages exatcly like that mentioned here:
http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2840
In any event, the patch at the end of that link was never applied (it doesn't
fix the other call to dev_kfree_skb). After applying my patch, I've not had any
more messages in the logs.
Graham
^ permalink raw reply
* Re: [PATCH] [TRIVIAL] prism54/islpci_eth.c: dev_kfree_skb in irq context
From: Patrick McHardy @ 2006-01-03 13:11 UTC (permalink / raw)
To: Graham Gower; +Cc: Roger While, linux-kernel, netdev
In-Reply-To: <6ec4247d0601030419w377fd396x@mail.gmail.com>
Graham Gower wrote:
> My logs were starting to fill with messages exatcly like that mentioned here:
> http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2840
>
> In any event, the patch at the end of that link was never applied (it doesn't
> fix the other call to dev_kfree_skb). After applying my patch, I've not had any
> more messages in the logs.
The patch has been applied to 2.6.15-rc. Only the first hunk of your
patch is still required, but it doesn't apply anymore. Can you send
a new patch against 2.6.15 please?
^ permalink raw reply
* [git patches] 2.6.x net driver updates
From: Jeff Garzik @ 2006-01-03 16:41 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Just sent this to Andrew and Linus:
Please pull from 'upstream' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
to receive the following updates:
drivers/net/sk98lin/skproc.c | 265 --
drivers/net/wan/lmc/lmc_prot.h | 15
Documentation/networking/gianfar.txt | 72
drivers/net/8139too.c | 86
drivers/net/Kconfig | 17
drivers/net/Makefile | 7
drivers/net/bonding/Makefile | 2
drivers/net/bonding/bond_3ad.c | 106
drivers/net/bonding/bond_3ad.h | 13
drivers/net/bonding/bond_alb.c | 75
drivers/net/bonding/bond_alb.h | 9
drivers/net/bonding/bond_main.c | 781 +------
drivers/net/bonding/bond_sysfs.c | 1358 ++++++++++++
drivers/net/bonding/bonding.h | 52
drivers/net/chelsio/sge.c | 19
drivers/net/chelsio/sge.h | 2
drivers/net/e1000/e1000.h | 4
drivers/net/e1000/e1000_ethtool.c | 111 -
drivers/net/e1000/e1000_hw.c | 67
drivers/net/e1000/e1000_hw.h | 4
drivers/net/e1000/e1000_main.c | 64
drivers/net/gianfar.c | 233 +-
drivers/net/gianfar.h | 69
drivers/net/gianfar_ethtool.c | 2
drivers/net/gianfar_mii.h | 1
drivers/net/gianfar_sysfs.c | 311 ++
drivers/net/ixp2000/Kconfig | 6
drivers/net/ixp2000/Makefile | 3
drivers/net/ixp2000/caleb.c | 137 +
drivers/net/ixp2000/caleb.h | 22
drivers/net/ixp2000/enp2611.c | 245 ++
drivers/net/ixp2000/ixp2400-msf.c | 213 +
drivers/net/ixp2000/ixp2400-msf.h | 115 +
drivers/net/ixp2000/ixp2400_rx.uc | 408 +++
drivers/net/ixp2000/ixp2400_rx.ucode | 130 +
drivers/net/ixp2000/ixp2400_tx.uc | 272 ++
drivers/net/ixp2000/ixp2400_tx.ucode | 98
drivers/net/ixp2000/ixpdev.c | 421 +++
drivers/net/ixp2000/ixpdev.h | 27
drivers/net/ixp2000/ixpdev_priv.h | 57
drivers/net/ixp2000/pm3386.c | 334 +++
drivers/net/ixp2000/pm3386.h | 28
drivers/net/s2io.c | 200 +
drivers/net/s2io.h | 3
drivers/net/sis900.c | 73
drivers/net/sis900.h | 45
drivers/net/sk98lin/Makefile | 3
drivers/net/sk98lin/h/skdrv2nd.h | 9
drivers/net/sk98lin/h/skvpd.h | 8
drivers/net/sk98lin/skethtool.c | 48
drivers/net/sk98lin/skge.c | 212 -
drivers/net/skge.c | 80
drivers/net/skge.h | 73
drivers/net/sky2.c | 3262 ++++++++++++++++++++++++++++++
drivers/net/sky2.h | 1922 +++++++++++++++++
drivers/net/wireless/Kconfig | 6
drivers/net/wireless/airo.c | 15
drivers/net/wireless/atmel.c | 1490 +++++++------
drivers/net/wireless/hostap/Makefile | 1
drivers/net/wireless/hostap/hostap_main.c | 0
drivers/net/wireless/ipw2100.c | 40
drivers/net/wireless/ipw2100.h | 2
drivers/net/wireless/ipw2200.c | 21
drivers/net/wireless/ipw2200.h | 6
include/linux/netdevice.h | 11
net/core/dev.c | 3
net/core/utils.c | 2
67 files changed, 11405 insertions(+), 2391 deletions(-)
Adrian Bunk:
drivers/net/sk98lin/skge.c: make SkPciWriteCfgDWord() a static inline
hostap: rename hostap.c to hostap_main.c
Ananda Raju:
s2io: UFO support
Andrew Morton:
sky2 needs dma_mapping.h
git-netdev-all: s2io warning fix
Andy Fleming:
Gianfar update and sysfs support
Brice Goglin:
Duplicate IPW_DEBUG option for ipw2100 and 2200
Carlo Perassi:
atmel: CodingStyle cleanup
Christophe Lucas:
atmel: audit return code of create_proc_read_entry
Dan Streetman:
airo.c: add support for IW_ENCODE_TEMP (i.e. xsupplicant)
Daniele Venzano:
Add Wake on LAN support to sis900 (2)
Jeff Garzik:
[netdrvr 8139too] replace hand-crafted kernel thread with workqueue
[netdrvr 8139too] use cancel_rearming_delayed_work() to cancel thread
[netdrvr 8139too] use rtnl_shlock_nowait() rather than rtnl_lock_interruptible()
[netdrvr 8139too] fast poll for thread, if an unlikely race occurs
[bonding] Remove superfluous changelog.
Jeff Kirsher:
e1000: Fixes for 8357x
Jens Osterkamp:
spidernet: fix Kconfig after BPA->CELL rename
John W. Linville:
skge: fix warning from inlining SkPciWriteCfgDWord()
e1000: avoid leak when e1000_setup_loopback_test fails
e1000: zero-out pointers in e1000_free_desc_rings
Lennert Buytenhek:
intel ixp2000 network driver
ixp2000: register netdevices last
pm3386: zero stats properly
pm3386: remove unnecessary udelays
caleb/pm3386: include proper header files
ixp2000: use netif_rx_schedule_test
enp2611: don't check netif_running() in link status timer
enp2611: use 'dev' in link status timer
enp2611: report link up/down events
ixp2000: report MAC addresses for each port on init
pm3386: add hook for setting MAC address
pm3386: add hook for setting carrier
pm3386: implement reset
enp2611: disable/enable SERDES carrier on interface down/up
ixp2000: add netpoll support
ixp2000: add driver version, bump version to 0.2
Mitch Williams:
net: allow newline terminated IP addresses in in_aton
net: make dev_valid_name public
bonding: add bond name to all error messages
bonding: expand module param descriptions
bonding: Add transmit policy to /proc
bonding: get slave name from actual slave instead of param list
bonding: move kmalloc out of spinlock in ALB init
bonding: explicitly clear RLB flag during ALB init
bonding: expose some structs
bonding: make functions not static
bonding: move bond creation into separate function
bonding: make bond_init not __init
bonding: Allow ARP target table to have empty entries
bonding: add ARP entries to /proc
bonding: add sysfs functionality to bonding (large)
bonding: version update
bonding: spelling and whitespace corrections
bonding: comments and changelog
shemminger@osdl.org:
sky2: changing mtu doesn't have to reset link
sky2: cleanup interrupt processing
sky2: add hardware VLAN acceleration support
sky2: explicit set power state
sky2: version 0.6
sky2: remove unused definitions
sky2: use kzalloc
sky2: spelling fixes
sky2: fix NAPI and receive handling
sky2: version 0.7
sky2: eliminate special case for EC-A1
sky2: add MII support
sky2: fix receive flush/pause issues
sky2: improve receive performance
sky2: add Yukon-EC ultra support
sky2: handle DMA boundary crossing
sky2: change netif_rx_schedule_test to __netif_schedule_prep
sky2: race with MTU change
sky2: dual port tx completion
sky2: byteorder annotation
sky2: remove pci-express hacks
sky2: use pci_register_driver
sky2: update version number
sk98lin: allow ethtool checksum on/off per port
sk98lin: remove redundant fields in device info
sk98lin: remove /proc interface
Stephen Hemminger:
sky2: new experimental Marvell Yukon2 driver
sky2: driver update.
sky2: fix FIFO DMA alignment problems
sky2: allow ethtool debug access to all of PCI space
sky2: version 0.5
sky2: nway reset (BONUS FEATURE)
sky2: add permanent address support.
ixp2000: change netif_schedule_test to __netif_schedule_prep
sky2: interrupt not cleared.
sky2: don't die if we see chip rev 0xb5
sky2: device structure alignment
sky2: copy threshold as module parameter
sky2: ethtool get/set interrupt coalescing
sky2: phy processing in workqueue rather than tasklet
sky2: no irq disable needed during tx
sky2: ring distance optimization
sky2: map length optimization
sky2: tx/rx ring data structure split
sky2: transmit logic fixes
sky2: transmit complete index optimization
sky2: transmit complete routine optimization
sky2: interrupt/poll optimization
sky2: interrupt coalescing tuning
sky2: handle tx timeout
sky2: quiet ring full message in case of race
sky2: prefetch tuning
sky2: turn on tx flow control
sky2: disable rx checksum on Yukon XL
sky2: version 0.10
chelsio: transmit routine return values
skge: avoid up/down on speed changes
skge: avoid up/down on pause param changes
skge: handle out of memory on MTU size changes
skge: get rid of Yukon2 defines
skge: handle out of memory on ring parameter change
skge: version number (1.3)
skge: error handling on resume
sky2: handle out of memory on admin changes
sky2: don't lose multicast addresses
sky2: handle hardware packet overrun
sky2: version 0.11
Takis:
ipw2200: kzalloc conversion and Kconfig dependency fix
Tobias Klauser:
Remove drivers/net/wan/lmc/lmc_prot.h
^ permalink raw reply
* Re: [PATCH][2.6.14.5] fix /sys/class/net/<if>/wireless without dev->get_wireless_stats
From: Ismail Donmez @ 2006-01-03 17:05 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
In-Reply-To: <200601031852.27386.ismail@uludag.org.tr>
Salı 3 Ocak 2006 18:52 tarihinde şunları yazmıştınız:
> Pazartesi 2 Ocak 2006 19:15 tarihinde şunları yazmıştınız:
> > I accidentally used wrong lkml address, so I resend it now with proper
> > format.
> >
> > dev->get_wireless_stats is deprecated but removing it also removes
> > wireless subdirectory in sysfs. This patch puts it back.
> >
> > Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
>
> Did this make it to 2.6.15?
According to Andrey it didn't, but since Linus you are talking about not
breaking userspace, without this patch many userspace applications and
scripts are broken so at least can we put this in 2.6.15.1 ? It doesn't make
any sense when you leave userspace broken obviously ( there is a bugzilla
entry and a ready patch ) and talking about userspace compatibility at the
same time.
^ permalink raw reply
* Re: [PATCH - 2.6.14.5]x25: fix for broken x25 module
From: David S. Miller @ 2006-01-03 20:13 UTC (permalink / raw)
To: spereira; +Cc: linux-kernel, linux-x25, eis, akpm, netdev
In-Reply-To: <1136267307.11486.44.camel@spereira05.tusc.com.au>
From: Shaun Pereira <spereira@tusc.com.au>
Date: Tue, 03 Jan 2006 16:48:27 +1100
> -
> - if (sock_flag(osk, SOCK_ZAPPED))
> - sock_set_flag(sk, SOCK_ZAPPED);
> -
> - if (sock_flag(osk, SOCK_DBG))
> - sock_set_flag(sk, SOCK_DBG);
> + sock_copy_flags(sk, osk);
Please get your email setup such that the patches you post
might actually be capable of being applied. Your email
client corrupts the tabbing and spaces in patches heavily.
Thanks.
^ permalink raw reply
* Re: [PATCH] forcedeth: TSO fix for large buffers
From: Manfred Spraul @ 2006-01-03 20:33 UTC (permalink / raw)
To: Ayaz Abdulla
Cc: David S. Miller, manfred, jgarzik, afu, linux-kernel, netdev,
torvalds
In-Reply-To: <3E346722.7070304@nvidia.com>
Ayaz Abdulla wrote:
> If you look at the code, I do not set the NV_TX2_VALID bit (stored in
> np->tx_flags) in the first tx descriptor
You are right: tx_flags starts as 0 and is only set to np->tx_flags
after the first tx descriptor was set up.
I overlooked that point, sorry.
Jeff: Could you add the patch to your tree?
--
Manfred
^ permalink raw reply
* Re: [PATCH] [TRIVIAL] prism54/islpci_eth.c: dev_kfree_skb in irq context
From: Graham Gower @ 2006-01-03 23:03 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Roger While, linux-kernel, netdev
In-Reply-To: <43BA7810.6010308@trash.net>
On 03/01/06, Patrick McHardy <kaber@trash.net> wrote:
> Graham Gower wrote:
> > My logs were starting to fill with messages exatcly like that mentioned here:
> > http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=2840
> >
> > In any event, the patch at the end of that link was never applied (it doesn't
> > fix the other call to dev_kfree_skb). After applying my patch, I've not had any
> > more messages in the logs.
>
> The patch has been applied to 2.6.15-rc. Only the first hunk of your
> patch is still required, but it doesn't apply anymore. Can you send
> a new patch against 2.6.15 please?
>
Ok, here's a new one. Hope I got it right this time.
Signed-off-by: Graham Gower <graham.gower@gmail.com>
--- linux-2.6.15/drivers/net/wireless/prism54/islpci_eth.c.orig
+++ linux-2.6.15/drivers/net/wireless/prism54/islpci_eth.c
@@ -177,7 +177,7 @@
#endif
newskb->dev = skb->dev;
- dev_kfree_skb(skb);
+ dev_kfree_skb_irq(skb);
skb = newskb;
}
}
^ permalink raw reply
* Re: [PATCH] forcedeth: TSO fix for large buffers
From: Andrew Morton @ 2006-01-04 6:55 UTC (permalink / raw)
To: Manfred Spraul; +Cc: jgarzik, aabdulla, afu, linux-kernel, netdev, torvalds
In-Reply-To: <200512251451.jBPEpgNe018712@dbl.q-ag.de>
Manfred Spraul <manfred@dbl.q-ag.de> wrote:
>
> This patch contains a bug fix for large buffers. Originally, if a tx
> buffer to be sent was larger then the maximum size of the tx descriptor,
>
> it would overwrite other control bits. In this patch, the buffer is
> split over multiple descriptors. Also, the fragments are now setup in
> forward order.
>
> Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
>
> Rediffed against forcedeth 0.48
> Signed-Off-By: Manfred Spraul <manfred@colorfullife.com>
I've assumed that this patch if From: Ayaz. Please confirm.
If so, it should have had
From: Ayaz Abdulla <aabdulla@nvidia.com>
at the top of the changlog, thanks.
^ permalink raw reply
* Re: Resubmit: [PATCH] natsemi: NAPI support
From: Mark Brown @ 2006-01-04 7:32 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Tim Hockin, netdev, linux-kernel
In-Reply-To: <20051221234850.GC5274@sirena.org.uk>
[-- Attachment #1: Type: text/plain, Size: 10414 bytes --]
This patch against 2.6.14 converts the natsemi driver to use NAPI. It
was originally based on one written by Harald Welte, though it has since
been modified quite a bit, most extensively in order to remove the
ability to disable NAPI since none of the other drivers seem to provide
that functionality any more.
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
---
This revision of the patch:
- Doesn't sleep with the device spinlock held in suspend().
- Improves the synchronisation between poll() and the shutdown paths.
--- linux-2.6.14/drivers/net/natsemi.c.orig 2005-11-29 19:29:12.000000000 +0000
+++ linux/drivers/net/natsemi.c 2005-12-11 14:55:48.000000000 +0000
@@ -3,6 +3,7 @@
Written/copyright 1999-2001 by Donald Becker.
Portions copyright (c) 2001,2002 Sun Microsystems (thockin@sun.com)
Portions copyright 2001,2002 Manfred Spraul (manfred@colorfullife.com)
+ Portions copyright 2004 Harald Welte <laforge@gnumonks.org>
This software may be used and distributed according to the terms of
the GNU General Public License (GPL), incorporated herein by reference.
@@ -135,8 +136,6 @@
TODO:
* big endian support with CFG:BEM instead of cpu_to_le32
- * support for an external PHY
- * NAPI
*/
#include <linux/config.h>
@@ -160,6 +159,7 @@
#include <linux/mii.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
+#include <linux/prefetch.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/io.h>
#include <asm/irq.h>
@@ -183,8 +183,6 @@
NETIF_MSG_TX_ERR)
static int debug = -1;
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 20;
static int mtu;
/* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
@@ -251,14 +249,11 @@ MODULE_AUTHOR("Donald Becker <becker@scy
MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver");
MODULE_LICENSE("GPL");
-module_param(max_interrupt_work, int, 0);
module_param(mtu, int, 0);
module_param(debug, int, 0);
module_param(rx_copybreak, int, 0);
module_param_array(options, int, NULL, 0);
module_param_array(full_duplex, int, NULL, 0);
-MODULE_PARM_DESC(max_interrupt_work,
- "DP8381x maximum events handled per interrupt");
MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)");
MODULE_PARM_DESC(debug, "DP8381x default debug level");
MODULE_PARM_DESC(rx_copybreak,
@@ -691,6 +686,8 @@ struct netdev_private {
/* Based on MTU+slack. */
unsigned int rx_buf_sz;
int oom;
+ /* Interrupt status */
+ u32 intr_status;
/* Do not touch the nic registers */
int hands_off;
/* external phy that is used: only valid if dev->if_port != PORT_TP */
@@ -748,7 +745,8 @@ static void init_registers(struct net_de
static int start_tx(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
static void netdev_error(struct net_device *dev, int intr_status);
-static void netdev_rx(struct net_device *dev);
+static int natsemi_poll(struct net_device *dev, int *budget);
+static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do);
static void netdev_tx_done(struct net_device *dev);
static int natsemi_change_mtu(struct net_device *dev, int new_mtu);
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -776,6 +774,18 @@ static inline void __iomem *ns_ioaddr(st
return (void __iomem *) dev->base_addr;
}
+static inline void natsemi_irq_enable(struct net_device *dev)
+{
+ writel(1, ns_ioaddr(dev) + IntrEnable);
+ readl(ns_ioaddr(dev) + IntrEnable);
+}
+
+static inline void natsemi_irq_disable(struct net_device *dev)
+{
+ writel(0, ns_ioaddr(dev) + IntrEnable);
+ readl(ns_ioaddr(dev) + IntrEnable);
+}
+
static void move_int_phy(struct net_device *dev, int addr)
{
struct netdev_private *np = netdev_priv(dev);
@@ -879,6 +889,7 @@ static int __devinit natsemi_probe1 (str
spin_lock_init(&np->lock);
np->msg_enable = (debug >= 0) ? (1<<debug)-1 : NATSEMI_DEF_MSG;
np->hands_off = 0;
+ np->intr_status = 0;
/* Initial port:
* - If the nic was configured to use an external phy and if find_mii
@@ -932,6 +943,9 @@ static int __devinit natsemi_probe1 (str
dev->do_ioctl = &netdev_ioctl;
dev->tx_timeout = &tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
+ dev->poll = natsemi_poll;
+ dev->weight = 64;
+
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = &natsemi_poll_controller;
#endif
@@ -2158,68 +2172,92 @@ static void netdev_tx_done(struct net_de
}
}
-/* The interrupt handler does all of the Rx thread work and cleans up
- after the Tx thread. */
+/* The interrupt handler doesn't actually handle interrupts itself, it
+ * schedules a NAPI poll if there is anything to do. */
static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
{
struct net_device *dev = dev_instance;
struct netdev_private *np = netdev_priv(dev);
void __iomem * ioaddr = ns_ioaddr(dev);
- int boguscnt = max_interrupt_work;
- unsigned int handled = 0;
if (np->hands_off)
return IRQ_NONE;
- do {
- /* Reading automatically acknowledges all int sources. */
- u32 intr_status = readl(ioaddr + IntrStatus);
+
+ /* Reading automatically acknowledges. */
+ np->intr_status = readl(ioaddr + IntrStatus);
- if (netif_msg_intr(np))
- printk(KERN_DEBUG
- "%s: Interrupt, status %#08x, mask %#08x.\n",
- dev->name, intr_status,
- readl(ioaddr + IntrMask));
+ if (netif_msg_intr(np))
+ printk(KERN_DEBUG
+ "%s: Interrupt, status %#08x, mask %#08x.\n",
+ dev->name, np->intr_status,
+ readl(ioaddr + IntrMask));
- if (intr_status == 0)
- break;
- handled = 1;
+ if (!np->intr_status)
+ return IRQ_NONE;
- if (intr_status &
- (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
- IntrRxErr | IntrRxOverrun)) {
- netdev_rx(dev);
- }
+ prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]);
+
+ if (netif_rx_schedule_prep(dev)) {
+ /* Disable interrupts and register for poll */
+ natsemi_irq_disable(dev);
+ __netif_rx_schedule(dev);
+ }
+ return IRQ_HANDLED;
+}
- if (intr_status &
- (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) {
+/* This is the NAPI poll routine. As well as the standard RX handling
+ * it also handles all other interrupts that the chip might raise.
+ */
+static int natsemi_poll(struct net_device *dev, int *budget)
+{
+ struct netdev_private *np = netdev_priv(dev);
+ void __iomem * ioaddr = ns_ioaddr(dev);
+
+ int work_to_do = min(*budget, dev->quota);
+ int work_done = 0;
+
+ do {
+ if (np->intr_status &
+ (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) {
spin_lock(&np->lock);
netdev_tx_done(dev);
spin_unlock(&np->lock);
}
/* Abnormal error summary/uncommon events handlers. */
- if (intr_status & IntrAbnormalSummary)
- netdev_error(dev, intr_status);
-
- if (--boguscnt < 0) {
- if (netif_msg_intr(np))
- printk(KERN_WARNING
- "%s: Too much work at interrupt, "
- "status=%#08x.\n",
- dev->name, intr_status);
- break;
+ if (np->intr_status & IntrAbnormalSummary)
+ netdev_error(dev, np->intr_status);
+
+ if (np->intr_status &
+ (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
+ IntrRxErr | IntrRxOverrun)) {
+ netdev_rx(dev, &work_done, work_to_do);
}
- } while (1);
+
+ *budget -= work_done;
+ dev->quota -= work_done;
- if (netif_msg_intr(np))
- printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name);
+ if (work_done >= work_to_do)
+ return 1;
+
+ np->intr_status = readl(ioaddr + IntrStatus);
+ } while (np->intr_status);
- return IRQ_RETVAL(handled);
+ netif_rx_complete(dev);
+
+ /* Reenable interrupts providing nothing is trying to shut
+ * the chip down. */
+ spin_lock(&np->lock);
+ if (!np->hands_off && netif_running(dev))
+ natsemi_irq_enable(dev);
+ spin_unlock(&np->lock);
+
+ return 0;
}
/* This routine is logically part of the interrupt handler, but separated
for clarity and better register allocation. */
-static void netdev_rx(struct net_device *dev)
+static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
{
struct netdev_private *np = netdev_priv(dev);
int entry = np->cur_rx % RX_RING_SIZE;
@@ -2237,6 +2275,12 @@ static void netdev_rx(struct net_device
entry, desc_status);
if (--boguscnt < 0)
break;
+
+ if (*work_done >= work_to_do)
+ break;
+
+ (*work_done)++;
+
pkt_len = (desc_status & DescSizeMask) - 4;
if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){
if (desc_status & DescMore) {
@@ -2293,7 +2337,7 @@ static void netdev_rx(struct net_device
np->rx_skbuff[entry] = NULL;
}
skb->protocol = eth_type_trans(skb, dev);
- netif_rx(skb);
+ netif_receive_skb(skb);
dev->last_rx = jiffies;
np->stats.rx_packets++;
np->stats.rx_bytes += pkt_len;
@@ -3074,9 +3118,7 @@ static int netdev_close(struct net_devic
del_timer_sync(&np->timer);
disable_irq(dev->irq);
spin_lock_irq(&np->lock);
- /* Disable interrupts, and flush posted writes */
- writel(0, ioaddr + IntrEnable);
- readl(ioaddr + IntrEnable);
+ natsemi_irq_disable(dev);
np->hands_off = 1;
spin_unlock_irq(&np->lock);
enable_irq(dev->irq);
@@ -3158,6 +3200,9 @@ static void __devexit natsemi_remove1 (s
* * netdev_timer: timer stopped by natsemi_suspend.
* * intr_handler: doesn't acquire the spinlock. suspend calls
* disable_irq() to enforce synchronization.
+ * * natsemi_poll: checks before reenabling interrupts. suspend
+ * sets hands_off, disables interrupts and then waits with
+ * netif_poll_disable().
*
* Interrupts must be disabled, otherwise hands_off can cause irq storms.
*/
@@ -3183,6 +3228,8 @@ static int natsemi_suspend (struct pci_d
spin_unlock_irq(&np->lock);
enable_irq(dev->irq);
+ netif_poll_disable(dev);
+
/* Update the error counts. */
__get_stats(dev);
@@ -3235,6 +3282,7 @@ static int natsemi_resume (struct pci_de
mod_timer(&np->timer, jiffies + 1*HZ);
}
netif_device_attach(dev);
+ netif_poll_enable(dev);
out:
rtnl_unlock();
return 0;
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]
^ permalink raw reply
* Re: Resubmit: [PATCH] natsemi: NAPI support
From: Harald Welte @ 2006-01-04 13:40 UTC (permalink / raw)
To: Jeff Garzik, Tim Hockin, netdev, linux-kernel
In-Reply-To: <20060104073249.GA8024@sirena.org.uk>
[-- Attachment #1: Type: text/plain, Size: 963 bytes --]
On Wed, Jan 04, 2006 at 07:32:49AM +0000, Mark Brown wrote:
> This patch against 2.6.14 converts the natsemi driver to use NAPI. It
> was originally based on one written by Harald Welte, though it has since
> been modified quite a bit, most extensively in order to remove the
> ability to disable NAPI since none of the other drivers seem to provide
> that functionality any more.
Mark, sorry for not responding earlier to your emails with regard to
your natsemi patch.
Thanks for pushing this persistently. From reviewing your patch, I
personally thin it's fine to be merged.
I will test it on my natsemi based boxes later today.
--
- Harald Welte <laforge@gnumonks.org> http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] ipw2200: Fix NETDEV_TX_BUSY erroneous returned
From: Francois Romieu @ 2006-01-04 23:52 UTC (permalink / raw)
To: Zhu Yi; +Cc: Andrew Morton, jketreno, jgarzik, linux-kernel, netdev
In-Reply-To: <20060104040954.GA19618@mail.intel.com>
Zhu Yi <yi.zhu@intel.com> :
>
> This patch fixes the warning below warning for the ipw2200 driver.
>
> NETDEV_TX_BUSY returned; driver should report queue full via
> ieee_device->is_queue_full.
Beyond what was said by Stephen Hemminger, the driver reports a
NETDEV_TX_BUSY when !STATUS_ASSOCIATED: neither this patch nor mine
fix it.
Btw the patch that I posted earlier forgets to protect against
every undue wake-up through:
ipw_rx
-> ipw_rx_notification
-> priv->link_up (work_queue)
-> ipw_bg_link_up
-> ipw_link_up
It will need some extra care to correctly play the
netif_{stop/wake}_queue dance.
--
Ueimor
^ permalink raw reply
* Re: PCI DEVICE ID PROBLEM and Intel Intergrated eth card - a bios bug (?)
From: Jesse Brandeburg @ 2006-01-05 2:56 UTC (permalink / raw)
To: Krzysztof Baranowski; +Cc: mj, linux-kernel, NetDEV list
In-Reply-To: <4807377b0601041854t4b1410fco5c307db6704e03f6@mail.gmail.com>
On 1/4/06, Krzysztof Baranowski <kgb@dione.ids.pl> wrote:
<snip>
> After the upgrade my network card disappeared from both Linux and Win.
>
> After short investigation I noticed one strange incosistency. Under
> the new BIOS the PCI device is reported as PCI VENDOR ID 1459 (
> which is gigabyte) DEV_ID 1019. However Windows driver for this
> card (the lates from both intel and gigabyte) is looking for
> VENDOR_ID 8086 (intel).
IMO, gigabyte should not have changed the vendor id. Effectively
they've said they will be the only ones supporting this hardware (not
intel). Generally subvendor and subdevice ids should be the only
thing changed by OEMs. Since it was changed by a bios upgrade i bet
its a bios bug and should be reported to gigabyte.
Until then you can hack your local kernel to get around it, but the
e1000 driver probably shouldn't change to support this device ID.
also, this is LKML and mentioning windows is just flame bait. :-)
jesse
^ permalink raw reply
* Re: [PATCH] hostap: allow flashing firmware
From: Jouni Malinen @ 2006-01-05 5:18 UTC (permalink / raw)
To: Pavel Roskin; +Cc: NetDev, hostap
In-Reply-To: <1135984946.17805.21.camel@dv>
On Fri, Dec 30, 2005 at 06:22:26PM -0500, Pavel Roskin wrote:
> Host AP driver has code to support writing firmware to non-volatile
> memory, a.k.a. flash. This code has been extensively tested when Host
> AP was a standalone driver.
>
> Add a configuration option to the kernel to allow enabling this
> functionality. Improve the description of the RAM download option.
> Mention cards that require it. Remove obsolete scary comment.
I'm not completely against this change, but that scary comment is there
on purpose and it is not fully obsolete. It is still possible to get
HFA3841 cards into state which require hardware modifications to recover
from (i.e., they are as good as dead for most users). Taken into this
account, I would prefer that the help text for HOSTAP_FIRMWARE_NVRAM
would include a warning about the potential issues of using incorrect
firmware images. In most cases, RAM (volatile) download can be used to
upgrade the firmware without having to modify the flash contents. This
is also what the current Windows drivers are doing.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
* Re: [PATCH] hostap: allow flashing firmware
From: Henrik Brix Andersen @ 2006-01-05 11:34 UTC (permalink / raw)
To: hostap; +Cc: NetDev
In-Reply-To: <20060105051857.GO8939@jm.kir.nu>
[-- Attachment #1.1: Type: text/plain, Size: 946 bytes --]
On Wed, Jan 04, 2006 at 09:18:57PM -0800, Jouni Malinen wrote:
> I'm not completely against this change, but that scary comment is there
> on purpose and it is not fully obsolete. It is still possible to get
> HFA3841 cards into state which require hardware modifications to recover
> from (i.e., they are as good as dead for most users). Taken into this
> account, I would prefer that the help text for HOSTAP_FIRMWARE_NVRAM
> would include a warning about the potential issues of using incorrect
> firmware images. In most cases, RAM (volatile) download can be used to
> upgrade the firmware without having to modify the flash contents. This
> is also what the current Windows drivers are doing.
I would welcome such a warning as well - perhaps make
CONFIG_HOSTAP_FIRMWARE_NVRAM depend on CONFIG_EXPERIMENTAL as well?
Regards,
Brix
--
Henrik Brix Andersen <brix@gentoo.org>
Gentoo Metadistribution | Mobile computing herd
[-- Attachment #1.2: Type: application/pgp-signature, Size: 211 bytes --]
[-- Attachment #2: Type: text/plain, Size: 132 bytes --]
_______________________________________________
HostAP mailing list
HostAP@shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
^ permalink raw reply
* [2.6 patch] fix ipvs compilation
From: Adrian Bunk @ 2006-01-05 13:59 UTC (permalink / raw)
To: wensong, horms, ja; +Cc: netdev, linux-kernel
I don't know which change broke it, but I'm getting the following
compile error in Linus' tree:
<-- snip -->
...
CC net/ipv4/ipvs/ip_vs_sched.o
net/ipv4/ipvs/ip_vs_sched.c: In function 'ip_vs_sched_getbyname':
net/ipv4/ipvs/ip_vs_sched.c:110: warning: implicit declaration of function 'local_bh_disable'
net/ipv4/ipvs/ip_vs_sched.c:124: warning: implicit declaration of function 'local_bh_enable'
...
CC net/ipv4/ipvs/ip_vs_est.o
net/ipv4/ipvs/ip_vs_est.c: In function 'ip_vs_new_estimator':
net/ipv4/ipvs/ip_vs_est.c:147: warning: implicit declaration of function 'local_bh_disable'
net/ipv4/ipvs/ip_vs_est.c:156: warning: implicit declaration of function 'local_bh_enable'
...
LD .tmp_vmlinux1
net/built-in.o: In function `ip_vs_sched_getbyname':ip_vs_sched.c:(.text+0x99cfa): undefined reference to `local_bh_disable'
net/built-in.o: In function `register_ip_vs_scheduler': undefined reference to `local_bh_disable'
net/built-in.o: In function `unregister_ip_vs_scheduler': undefined reference to `local_bh_disable'
net/built-in.o: In function `ip_vs_new_estimator': undefined reference to `local_bh_disable'
net/built-in.o: In function `ip_vs_kill_estimator': undefined reference to `local_bh_disable'
net/built-in.o: more undefined references to `local_bh_disable' follow
make: *** [.tmp_vmlinux1] Error 1
<-- snip -->
This patch fixes them by #include'ing linux/interrupt.h.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-git/net/ipv4/ipvs/ip_vs_sched.c.old 2006-01-05 14:56:44.000000000 +0100
+++ linux-git/net/ipv4/ipvs/ip_vs_sched.c 2006-01-05 14:56:59.000000000 +0100
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
+#include <linux/interrupt.h>
#include <asm/string.h>
#include <linux/kmod.h>
--- linux-git/net/ipv4/ipvs/ip_vs_est.c.old 2006-01-05 14:57:15.000000000 +0100
+++ linux-git/net/ipv4/ipvs/ip_vs_est.c 2006-01-05 14:57:27.000000000 +0100
@@ -18,6 +18,7 @@
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/types.h>
+#include <linux/interrupt.h>
#include <net/ip_vs.h>
^ permalink raw reply
* Re: [2.6 patch] fix ipvs compilation
From: Arnaldo Carvalho de Melo @ 2006-01-05 14:21 UTC (permalink / raw)
To: Adrian Bunk; +Cc: wensong, horms, ja, netdev, linux-kernel
In-Reply-To: <20060105135943.GA3831@stusta.de>
On 1/5/06, Adrian Bunk <bunk@stusta.de> wrote:
> I don't know which change broke it, but I'm getting the following
> compile error in Linus' tree:
>
> <-- snip -->
>
> ...
> CC net/ipv4/ipvs/ip_vs_sched.o
> net/ipv4/ipvs/ip_vs_sched.c: In function 'ip_vs_sched_getbyname':
> net/ipv4/ipvs/ip_vs_sched.c:110: warning: implicit declaration of function 'local_bh_disable'
> net/ipv4/ipvs/ip_vs_sched.c:124: warning: implicit declaration of function 'local_bh_enable'
Thanks Adrian, its related to some header sanitization work I did.
Acked-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
- Arnaldo
^ permalink raw reply
* [PATCH] gfar: fix compile error
From: Kumar Gala @ 2006-01-05 15:41 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel, afleming
Missing include of <linux/in.h> to get definition of IPPROTO_UDP.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
commit 1a6720f78a7fb69451983e6b73723b57594ecac1
tree c8772f20a27fd82d28e78c342782297afb35c580
parent 7b5d230825fc228414dce7dc2bfdace4ecea4613
author Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:45:05 -0600
committer Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:45:05 -0600
drivers/net/gianfar.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 146f951..637b73a 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -84,6 +84,7 @@
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
+#include <linux/in.h>
#include <asm/io.h>
#include <asm/irq.h>
^ permalink raw reply related
* [PATCH] gianfar mii: Use proper resource for MII memory region
From: Kumar Gala @ 2006-01-05 15:42 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel, afleming
We can now have the gianfar mii platform device have a proper
resource for the IO memory region for its registers. Previously
we passed this information that the platform_data structure because
we couldn't handle overlapping memory regions for platform devices.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
commit 7b5d230825fc228414dce7dc2bfdace4ecea4613
tree f822e58596f00a8e18e01e959630a59d95552d4e
parent 470500bb2f548d79e8981e4b1d9841f3d01dd657
author Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:33:44 -0600
committer Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:33:44 -0600
drivers/net/gianfar_mii.c | 5 ++++-
include/linux/fsl_devices.h | 3 ---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index 04a462c..74e52fc 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -128,6 +128,7 @@ int gfar_mdio_probe(struct device *dev)
struct gianfar_mdio_data *pdata;
struct gfar_mii *regs;
struct mii_bus *new_bus;
+ struct resource *r;
int err = 0;
if (NULL == dev)
@@ -151,8 +152,10 @@ int gfar_mdio_probe(struct device *dev)
return -ENODEV;
}
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
/* Set the PHY base address */
- regs = (struct gfar_mii *) ioremap(pdata->paddr,
+ regs = (struct gfar_mii *) ioremap(r->start,
sizeof (struct gfar_mii));
if (NULL == regs) {
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 934aa9b..a7a2b85 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -55,9 +55,6 @@ struct gianfar_platform_data {
};
struct gianfar_mdio_data {
- /* device specific information */
- u32 paddr;
-
/* board specific information */
int irq[32];
};
^ permalink raw reply related
* [PATCH] phy: Added a macro to represent the string format used to match a phy device
From: Kumar Gala @ 2006-01-05 15:43 UTC (permalink / raw)
To: jgarizk; +Cc: netdev, linux-kernel, afleming
Add the PHY_ID_FMT macro to ensure that the format of the id string used by
a driver to match to its specific phy is consistent between the mdio_bus
and the driver.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
commit 470500bb2f548d79e8981e4b1d9841f3d01dd657
tree 45768e543ada5fae24eaa207d031ef5371fd6319
parent 8d8188e951e8433057d0591b0b7db02c1cd9a28e
author Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:30:44 -0600
committer Kumar Gala <galak@kernel.crashing.org> Thu, 05 Jan 2006 09:30:44 -0600
drivers/net/phy/mdio_bus.c | 2 +-
drivers/net/phy/phy.c | 2 +-
include/linux/phy.h | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 02940c0..459443b 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -81,7 +81,7 @@ int mdiobus_register(struct mii_bus *bus
phydev->dev.parent = bus->dev;
phydev->dev.bus = &mdio_bus_type;
- sprintf(phydev->dev.bus_id, "phy%d:%d", bus->id, i);
+ snprintf(phydev->dev.bus_id, BUS_ID_SIZE, PHY_ID_FMT, bus->id, i);
phydev->bus = bus;
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index b8686e4..1474b7c 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -42,7 +42,7 @@
*/
void phy_print_status(struct phy_device *phydev)
{
- pr_info("%s: Link is %s", phydev->dev.bus_id,
+ pr_info("PHY: %s - Link is %s", phydev->dev.bus_id,
phydev->link ? "Up" : "Down");
if (phydev->link)
printk(" - %d/%s", phydev->speed,
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 92a9696..331521a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -53,6 +53,9 @@
#define PHY_MAX_ADDR 32
+/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
+#define PHY_ID_FMT "%x:%02x"
+
/* The Bus class for PHYs. Devices which provide access to
* PHYs should register using this structure */
struct mii_bus {
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox