* Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
From: Eric Dumazet @ 2010-04-21 21:57 UTC (permalink / raw)
To: paulmck
Cc: Miles Lane, Eric Paris, Lai Jiangshan, Ingo Molnar,
Peter Zijlstra, LKML, vgoyal, nauman, netdev, Eric W. Biederman
In-Reply-To: <20100421213543.GO2563@linux.vnet.ibm.com>
Le mercredi 21 avril 2010 à 14:35 -0700, Paul E. McKenney a écrit :
> > [ 33.425087] [ INFO: suspicious rcu_dereference_check() usage. ]
> > [ 33.425090] ---------------------------------------------------
> > [ 33.425094] net/core/dev.c:1993 invoked rcu_dereference_check()
> > without protection!
> > [ 33.425098]
> > [ 33.425098] other info that might help us debug this:
> > [ 33.425100]
> > [ 33.425103]
> > [ 33.425104] rcu_scheduler_active = 1, debug_locks = 1
> > [ 33.425108] 2 locks held by canberra-gtk-pl/4208:
> > [ 33.425111] #0: (sk_lock-AF_INET){+.+.+.}, at:
> > [<ffffffff81394ffd>] inet_stream_connect+0x3a/0x24d
> > [ 33.425125] #1: (rcu_read_lock_bh){.+....}, at:
> > [<ffffffff8134a809>] dev_queue_xmit+0x14e/0x4b8
> > [ 33.425137]
> > [ 33.425138] stack backtrace:
> > [ 33.425142] Pid: 4208, comm: canberra-gtk-pl Not tainted 2.6.34-rc5 #18
> > [ 33.425146] Call Trace:
> > [ 33.425154] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > [ 33.425161] [<ffffffff8134a914>] dev_queue_xmit+0x259/0x4b8
> > [ 33.425167] [<ffffffff8134a809>] ? dev_queue_xmit+0x14e/0x4b8
> > [ 33.425173] [<ffffffff81041c52>] ? _local_bh_enable_ip+0xcd/0xda
> > [ 33.425180] [<ffffffff8135375a>] neigh_resolve_output+0x234/0x285
> > [ 33.425188] [<ffffffff8136f71f>] ip_finish_output2+0x257/0x28c
> > [ 33.425193] [<ffffffff8136f7bc>] ip_finish_output+0x68/0x6a
> > [ 33.425198] [<ffffffff813704b3>] T.866+0x52/0x59
> > [ 33.425203] [<ffffffff813706fe>] ip_output+0xaa/0xb4
> > [ 33.425209] [<ffffffff8136ebb8>] ip_local_out+0x20/0x24
> > [ 33.425215] [<ffffffff8136f204>] ip_queue_xmit+0x309/0x368
> > [ 33.425223] [<ffffffff810e41e6>] ? __kmalloc_track_caller+0x111/0x155
> > [ 33.425230] [<ffffffff813831ef>] ? tcp_connect+0x223/0x3d3
> > [ 33.425236] [<ffffffff81381971>] tcp_transmit_skb+0x707/0x745
> > [ 33.425243] [<ffffffff81383342>] tcp_connect+0x376/0x3d3
> > [ 33.425250] [<ffffffff81268ac3>] ? secure_tcp_sequence_number+0x55/0x6f
> > [ 33.425256] [<ffffffff813872f0>] tcp_v4_connect+0x3df/0x455
> > [ 33.425263] [<ffffffff8133cbd9>] ? lock_sock_nested+0xf3/0x102
> > [ 33.425269] [<ffffffff81395067>] inet_stream_connect+0xa4/0x24d
> > [ 33.425276] [<ffffffff8133b418>] sys_connect+0x90/0xd0
> > [ 33.425283] [<ffffffff81002b9c>] ? sysret_check+0x27/0x62
> > [ 33.425289] [<ffffffff81068922>] ? trace_hardirqs_on_caller+0x114/0x13f
> > [ 33.425296] [<ffffffff813ced00>] ? trace_hardirqs_on_thunk+0x3a/0x3f
> > [ 33.425303] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
>
> This looks like an rcu_dereference() needs to instead be
> rcu_dereference_bh(), but the line numbering in my version of
> net/core/dev.c does not match yours. CCing netdev, hopefully
> someone there will know which rcu_dereference() is indicated.
>
This is already sorted out in David trees
> > [ 85.939528] [ INFO: suspicious rcu_dereference_check() usage. ]
> > [ 85.939531] ---------------------------------------------------
> > [ 85.939535] include/net/inet_timewait_sock.h:227 invoked
> > rcu_dereference_check() without protection!
> > [ 85.939539]
> > [ 85.939540] other info that might help us debug this:
> > [ 85.939541]
> > [ 85.939544]
> > [ 85.939545] rcu_scheduler_active = 1, debug_locks = 1
> > [ 85.939549] 2 locks held by gwibber-service/4798:
> > [ 85.939552] #0: (&p->lock){+.+.+.}, at: [<ffffffff811034b2>]
> > seq_read+0x37/0x381
> > [ 85.939566] #1: (&(&hashinfo->ehash_locks[i])->rlock){+.-...},
> > at: [<ffffffff81386355>] established_get_next+0xc4/0x132
> > [ 85.939579]
> > [ 85.939580] stack backtrace:
> > [ 85.939585] Pid: 4798, comm: gwibber-service Not tainted 2.6.34-rc5 #18
> > [ 85.939588] Call Trace:
> > [ 85.939598] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > [ 85.939604] [<ffffffff81385018>] twsk_net+0x4f/0x57
> > [ 85.939610] [<ffffffff813862e5>] established_get_next+0x54/0x132
> > [ 85.939615] [<ffffffff813864c7>] tcp_seq_next+0x5d/0x6a
> > [ 85.939621] [<ffffffff81103701>] seq_read+0x286/0x381
> > [ 85.939627] [<ffffffff8110347b>] ? seq_read+0x0/0x381
> > [ 85.939633] [<ffffffff81133240>] proc_reg_read+0x8d/0xac
> > [ 85.939640] [<ffffffff810ea110>] vfs_read+0xa6/0x103
> > [ 85.939645] [<ffffffff810ea223>] sys_read+0x45/0x69
> > [ 85.939652] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
>
> This one appears to be a case of missing rcu_read_lock(), but it is
> not clear to me at what level it needs to go.
>
> Eric, any enlightenment on this one and the next one?
>
Coming from commit b099ce2602d806deb41caaa578731848995cdb2a
>From Eric Biederman (CCed)
Apparently he added rcu to twsk_net(), but Changelog doesnt mention it.
> > [ 87.296366] [ INFO: suspicious rcu_dereference_check() usage. ]
> > [ 87.296369] ---------------------------------------------------
> > [ 87.296373] include/net/inet_timewait_sock.h:227 invoked
> > rcu_dereference_check() without protection!
> > [ 87.296377]
> > [ 87.296377] other info that might help us debug this:
> > [ 87.296379]
> > [ 87.296382]
> > [ 87.296383] rcu_scheduler_active = 1, debug_locks = 1
> > [ 87.296386] no locks held by gwibber-service/4803.
> > [ 87.296389]
> > [ 87.296390] stack backtrace:
> > [ 87.296395] Pid: 4803, comm: gwibber-service Not tainted 2.6.34-rc5 #18
> > [ 87.296398] Call Trace:
> > [ 87.296411] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > [ 87.296419] [<ffffffff813733d3>] twsk_net+0x4f/0x57
> > [ 87.296424] [<ffffffff813737f3>] __inet_twsk_hashdance+0x50/0x158
> > [ 87.296431] [<ffffffff81389239>] tcp_time_wait+0x1c1/0x24b
> > [ 87.296437] [<ffffffff8137c417>] tcp_fin+0x83/0x162
> > [ 87.296443] [<ffffffff8137cda7>] tcp_data_queue+0x1ff/0xa1e
> > [ 87.296450] [<ffffffff810495c6>] ? mod_timer+0x1e/0x20
> > [ 87.296456] [<ffffffff813809e3>] tcp_rcv_state_process+0x89d/0x8f2
> > [ 87.296463] [<ffffffff8133ca0b>] ? release_sock+0x30/0x10b
> > [ 87.296468] [<ffffffff81386df2>] tcp_v4_do_rcv+0x2de/0x33f
> > [ 87.296475] [<ffffffff8133ca5d>] release_sock+0x82/0x10b
> > [ 87.296481] [<ffffffff81376ef5>] tcp_close+0x1b5/0x37e
> > [ 87.296487] [<ffffffff81395437>] inet_release+0x50/0x57
> > [ 87.296493] [<ffffffff8133a134>] sock_release+0x1a/0x66
> > [ 87.296498] [<ffffffff8133a1a2>] sock_close+0x22/0x26
> > [ 87.296505] [<ffffffff810eb003>] __fput+0x120/0x1cd
> > [ 87.296510] [<ffffffff810eb0c5>] fput+0x15/0x17
> > [ 87.296516] [<ffffffff810e7f3d>] filp_close+0x63/0x6d
> > [ 87.296521] [<ffffffff810e801e>] sys_close+0xd7/0x111
> > [ 87.296528] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
>
> commit d3b8ba1bde9afb7d50cf0712f9d95317ea66c06f
> Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Date: Wed Apr 21 14:04:56 2010 -0700
>
> sched: protect __sched_setscheduler() access to cgroups
>
> A given task's cgroups structures must remain while that task is running
> due to reference counting, so this is presumably a false positive.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 14c44ec..1d43c1a 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -4575,9 +4575,11 @@ recheck:
> * Do not allow realtime tasks into groups that have no runtime
> * assigned.
> */
> + rcu_read_lock();
> if (rt_bandwidth_enabled() && rt_policy(policy) &&
> task_group(p)->rt_bandwidth.rt_runtime == 0)
> return -EPERM;
> + rcu_read_unlock();
> #endif
>
> retval = security_task_setscheduler(p, policy, param);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply
* Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
From: Paul E. McKenney @ 2010-04-21 22:14 UTC (permalink / raw)
To: Eric Dumazet
Cc: Miles Lane, Eric Paris, Lai Jiangshan, Ingo Molnar,
Peter Zijlstra, LKML, vgoyal, nauman, netdev, Eric W. Biederman
In-Reply-To: <1271887029.7895.3535.camel@edumazet-laptop>
On Wed, Apr 21, 2010 at 11:57:09PM +0200, Eric Dumazet wrote:
> Le mercredi 21 avril 2010 à 14:35 -0700, Paul E. McKenney a écrit :
>
> > > [ 33.425087] [ INFO: suspicious rcu_dereference_check() usage. ]
> > > [ 33.425090] ---------------------------------------------------
> > > [ 33.425094] net/core/dev.c:1993 invoked rcu_dereference_check()
> > > without protection!
> > > [ 33.425098]
> > > [ 33.425098] other info that might help us debug this:
> > > [ 33.425100]
> > > [ 33.425103]
> > > [ 33.425104] rcu_scheduler_active = 1, debug_locks = 1
> > > [ 33.425108] 2 locks held by canberra-gtk-pl/4208:
> > > [ 33.425111] #0: (sk_lock-AF_INET){+.+.+.}, at:
> > > [<ffffffff81394ffd>] inet_stream_connect+0x3a/0x24d
> > > [ 33.425125] #1: (rcu_read_lock_bh){.+....}, at:
> > > [<ffffffff8134a809>] dev_queue_xmit+0x14e/0x4b8
> > > [ 33.425137]
> > > [ 33.425138] stack backtrace:
> > > [ 33.425142] Pid: 4208, comm: canberra-gtk-pl Not tainted 2.6.34-rc5 #18
> > > [ 33.425146] Call Trace:
> > > [ 33.425154] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > > [ 33.425161] [<ffffffff8134a914>] dev_queue_xmit+0x259/0x4b8
> > > [ 33.425167] [<ffffffff8134a809>] ? dev_queue_xmit+0x14e/0x4b8
> > > [ 33.425173] [<ffffffff81041c52>] ? _local_bh_enable_ip+0xcd/0xda
> > > [ 33.425180] [<ffffffff8135375a>] neigh_resolve_output+0x234/0x285
> > > [ 33.425188] [<ffffffff8136f71f>] ip_finish_output2+0x257/0x28c
> > > [ 33.425193] [<ffffffff8136f7bc>] ip_finish_output+0x68/0x6a
> > > [ 33.425198] [<ffffffff813704b3>] T.866+0x52/0x59
> > > [ 33.425203] [<ffffffff813706fe>] ip_output+0xaa/0xb4
> > > [ 33.425209] [<ffffffff8136ebb8>] ip_local_out+0x20/0x24
> > > [ 33.425215] [<ffffffff8136f204>] ip_queue_xmit+0x309/0x368
> > > [ 33.425223] [<ffffffff810e41e6>] ? __kmalloc_track_caller+0x111/0x155
> > > [ 33.425230] [<ffffffff813831ef>] ? tcp_connect+0x223/0x3d3
> > > [ 33.425236] [<ffffffff81381971>] tcp_transmit_skb+0x707/0x745
> > > [ 33.425243] [<ffffffff81383342>] tcp_connect+0x376/0x3d3
> > > [ 33.425250] [<ffffffff81268ac3>] ? secure_tcp_sequence_number+0x55/0x6f
> > > [ 33.425256] [<ffffffff813872f0>] tcp_v4_connect+0x3df/0x455
> > > [ 33.425263] [<ffffffff8133cbd9>] ? lock_sock_nested+0xf3/0x102
> > > [ 33.425269] [<ffffffff81395067>] inet_stream_connect+0xa4/0x24d
> > > [ 33.425276] [<ffffffff8133b418>] sys_connect+0x90/0xd0
> > > [ 33.425283] [<ffffffff81002b9c>] ? sysret_check+0x27/0x62
> > > [ 33.425289] [<ffffffff81068922>] ? trace_hardirqs_on_caller+0x114/0x13f
> > > [ 33.425296] [<ffffffff813ced00>] ? trace_hardirqs_on_thunk+0x3a/0x3f
> > > [ 33.425303] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
> >
> > This looks like an rcu_dereference() needs to instead be
> > rcu_dereference_bh(), but the line numbering in my version of
> > net/core/dev.c does not match yours. CCing netdev, hopefully
> > someone there will know which rcu_dereference() is indicated.
>
> This is already sorted out in David trees
Very good!!! ;-)
> > > [ 85.939528] [ INFO: suspicious rcu_dereference_check() usage. ]
> > > [ 85.939531] ---------------------------------------------------
> > > [ 85.939535] include/net/inet_timewait_sock.h:227 invoked
> > > rcu_dereference_check() without protection!
> > > [ 85.939539]
> > > [ 85.939540] other info that might help us debug this:
> > > [ 85.939541]
> > > [ 85.939544]
> > > [ 85.939545] rcu_scheduler_active = 1, debug_locks = 1
> > > [ 85.939549] 2 locks held by gwibber-service/4798:
> > > [ 85.939552] #0: (&p->lock){+.+.+.}, at: [<ffffffff811034b2>]
> > > seq_read+0x37/0x381
> > > [ 85.939566] #1: (&(&hashinfo->ehash_locks[i])->rlock){+.-...},
> > > at: [<ffffffff81386355>] established_get_next+0xc4/0x132
> > > [ 85.939579]
> > > [ 85.939580] stack backtrace:
> > > [ 85.939585] Pid: 4798, comm: gwibber-service Not tainted 2.6.34-rc5 #18
> > > [ 85.939588] Call Trace:
> > > [ 85.939598] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > > [ 85.939604] [<ffffffff81385018>] twsk_net+0x4f/0x57
> > > [ 85.939610] [<ffffffff813862e5>] established_get_next+0x54/0x132
> > > [ 85.939615] [<ffffffff813864c7>] tcp_seq_next+0x5d/0x6a
> > > [ 85.939621] [<ffffffff81103701>] seq_read+0x286/0x381
> > > [ 85.939627] [<ffffffff8110347b>] ? seq_read+0x0/0x381
> > > [ 85.939633] [<ffffffff81133240>] proc_reg_read+0x8d/0xac
> > > [ 85.939640] [<ffffffff810ea110>] vfs_read+0xa6/0x103
> > > [ 85.939645] [<ffffffff810ea223>] sys_read+0x45/0x69
> > > [ 85.939652] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
> >
> > This one appears to be a case of missing rcu_read_lock(), but it is
> > not clear to me at what level it needs to go.
> >
> > Eric, any enlightenment on this one and the next one?
>
> Coming from commit b099ce2602d806deb41caaa578731848995cdb2a
> >From Eric Biederman (CCed)
>
> Apparently he added rcu to twsk_net(), but Changelog doesnt mention it.
Thank you for chasing this down, Eric Dumazet!
Eric Biederman, any enlightment?
Thanx, Paul
> > > [ 87.296366] [ INFO: suspicious rcu_dereference_check() usage. ]
> > > [ 87.296369] ---------------------------------------------------
> > > [ 87.296373] include/net/inet_timewait_sock.h:227 invoked
> > > rcu_dereference_check() without protection!
> > > [ 87.296377]
> > > [ 87.296377] other info that might help us debug this:
> > > [ 87.296379]
> > > [ 87.296382]
> > > [ 87.296383] rcu_scheduler_active = 1, debug_locks = 1
> > > [ 87.296386] no locks held by gwibber-service/4803.
> > > [ 87.296389]
> > > [ 87.296390] stack backtrace:
> > > [ 87.296395] Pid: 4803, comm: gwibber-service Not tainted 2.6.34-rc5 #18
> > > [ 87.296398] Call Trace:
> > > [ 87.296411] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
> > > [ 87.296419] [<ffffffff813733d3>] twsk_net+0x4f/0x57
> > > [ 87.296424] [<ffffffff813737f3>] __inet_twsk_hashdance+0x50/0x158
> > > [ 87.296431] [<ffffffff81389239>] tcp_time_wait+0x1c1/0x24b
> > > [ 87.296437] [<ffffffff8137c417>] tcp_fin+0x83/0x162
> > > [ 87.296443] [<ffffffff8137cda7>] tcp_data_queue+0x1ff/0xa1e
> > > [ 87.296450] [<ffffffff810495c6>] ? mod_timer+0x1e/0x20
> > > [ 87.296456] [<ffffffff813809e3>] tcp_rcv_state_process+0x89d/0x8f2
> > > [ 87.296463] [<ffffffff8133ca0b>] ? release_sock+0x30/0x10b
> > > [ 87.296468] [<ffffffff81386df2>] tcp_v4_do_rcv+0x2de/0x33f
> > > [ 87.296475] [<ffffffff8133ca5d>] release_sock+0x82/0x10b
> > > [ 87.296481] [<ffffffff81376ef5>] tcp_close+0x1b5/0x37e
> > > [ 87.296487] [<ffffffff81395437>] inet_release+0x50/0x57
> > > [ 87.296493] [<ffffffff8133a134>] sock_release+0x1a/0x66
> > > [ 87.296498] [<ffffffff8133a1a2>] sock_close+0x22/0x26
> > > [ 87.296505] [<ffffffff810eb003>] __fput+0x120/0x1cd
> > > [ 87.296510] [<ffffffff810eb0c5>] fput+0x15/0x17
> > > [ 87.296516] [<ffffffff810e7f3d>] filp_close+0x63/0x6d
> > > [ 87.296521] [<ffffffff810e801e>] sys_close+0xd7/0x111
> > > [ 87.296528] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
> >
> > commit d3b8ba1bde9afb7d50cf0712f9d95317ea66c06f
> > Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Date: Wed Apr 21 14:04:56 2010 -0700
> >
> > sched: protect __sched_setscheduler() access to cgroups
> >
> > A given task's cgroups structures must remain while that task is running
> > due to reference counting, so this is presumably a false positive.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > diff --git a/kernel/sched.c b/kernel/sched.c
> > index 14c44ec..1d43c1a 100644
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -4575,9 +4575,11 @@ recheck:
> > * Do not allow realtime tasks into groups that have no runtime
> > * assigned.
> > */
> > + rcu_read_lock();
> > if (rt_bandwidth_enabled() && rt_policy(policy) &&
> > task_group(p)->rt_bandwidth.rt_runtime == 0)
> > return -EPERM;
> > + rcu_read_unlock();
> > #endif
> >
> > retval = security_task_setscheduler(p, policy, param);
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
>
^ permalink raw reply
* Re: [net-next,1/2] add iovnl netlink support
From: Chris Wright @ 2010-04-21 22:18 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Chris Wright, Scott Feldman, davem, netdev
In-Reply-To: <201004212139.22421.arnd@arndb.de>
* Arnd Bergmann (arnd@arndb.de) wrote:
> On Wednesday 21 April 2010, Chris Wright wrote:
> > * Arnd Bergmann (arnd@arndb.de) wrote:
> > > On Wednesday 21 April 2010, Chris Wright wrote:
> > > > * Arnd Bergmann (arnd@arndb.de) wrote:
> > > > > Since it seems what you really want to do is to do the exchange with the
> > > > > switch from here, maybe the hardware configuration part should be moved
> > > > > the DCB interface?
> > > >
> > > > I suppose this would work (although it's a bit odd being out of scope
> > > > of DCB spec).
> > >
> > > It could be anywhere, it doesn't have to be the DCB interface, but could
> > > be anything ranging from ethtool to iplink I guess. And we should define
> > > it in a way that works for any SR-IOV card, whether it's using Cisco's
> > > protocol in firmware, 802.1Qbg VDP in firmware, lldpad to do VDP or
> > > none of the above and just provides an internal switch like all the
> > > existing NICs.
> >
> > Heh, that's exactly what iovnl does ;-)
>
> No, according to what you write below, it's exactly what iovnl does *not* do,
> i.e. part 1 in my list.
OK, I see...in this case to me hw setup was the port profile for the
enic to initiate host<->switch negotiation, sorry for confusion.
> > > 1. Setting up the slave device
> > > a) create an SR-IOV VF to assign to a guest
> > > b) create a macvtap device to pass to qemu or vhost
> > > c) attach a tap device to a bridge
> > > d) create a macvlan device and put it into a container
> > > e) create a virtual interface for a VMDq adapter
> >
> > OK, but iovnl isn't doing this.
>
> The set_mac_vlan that Scott's patch adds seems to implement 1a), as far
> as I can tell. Interestingly, this is not actually implemented in
> the enic driver in patch 2/2. So if we all agree that this is out of the
> scope of iovnl, let's just remove it from the interface and find another
> way for it (ethtool, iplink, ..., as listed above).
Scott, any objection? At least a way to keep moving forward on the port
profile bit.
> Note that we still need to pass the MAC address and VLAN ID (or a list
> of these) to the external switch, my point is just that this should be
> separate from enforcing it in the hypervisor.
Yup, we should focus on reconciling the diff of enic vs vpd port profile
needs.
> > > 2) Registering the slave with the switch
> > > a) use Cisco protocol in enic firmware (see patch 2/2)
> > > b) use standard VDP in lldpad
> > > c) use reverse-engineered cisco protocol in some user tool for
> > > non-enic adapters.
> > > d) use standard VDP in firmware (hopefully this never happens)
> > > e) do nothing at all (as we do today)
> >
> > And this is the step that is the main purpose of iovnl.
> >
> > Here's the simplest snippet of libvirt to show this. It sends
> > set_port_profile netlink messages and then creates macvtap. As simple
> > as it gets...
> >
> > --- a/src/qemu/qemu_conf.c
> > +++ b/src/qemu/qemu_conf.c
> > @@ -1470,6 +1470,11 @@ qemudPhysIfaceConnect(virConnectPtr conn,
> > net->model && STREQ(net->model, "virtio"))
> > vnet_hdr = 1;
> >
> > + setPortProfileId(net->data.direct.linkdev,
> > + net->data.direct.mode,
> > + net->data.direct.profileid,
> > + net->mac);
> > +
> > rc = openMacvtapTap(net->ifname, net->mac, linkdev, brmode,
> > &res_ifname, vnet_hdr);
>
> Ok. In case of VDP, I guess this needs to be extended with the vlan ID
> that has been configured, and possibly with a UUID, because we need to
> pass the same one on the target machine if we migrate it.
>
> Alternatively, the setPortProfileId could figure out the MAC address and
> VLAN ID from the device itself, but then we don't need to pass either of
> them.
^ permalink raw reply
* Re: [net-next,1/2] add iovnl netlink support
From: Chris Wright @ 2010-04-21 22:48 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Scott Feldman, Chris Wright, davem, netdev
In-Reply-To: <201004212313.05060.arnd@arndb.de>
* Arnd Bergmann (arnd@arndb.de) wrote:
> On Wednesday 21 April 2010, Scott Feldman wrote:
> > On 4/21/10 12:39 PM, "Arnd Bergmann" <arnd@arndb.de> wrote:
> >
> > >>> 1. Setting up the slave device
> > >>> a) create an SR-IOV VF to assign to a guest
> > >>> b) create a macvtap device to pass to qemu or vhost
> > >>> c) attach a tap device to a bridge
> > >>> d) create a macvlan device and put it into a container
> > >>> e) create a virtual interface for a VMDq adapter
> > >>
> > >> OK, but iovnl isn't doing this.
> > >
> > > The set_mac_vlan that Scott's patch adds seems to implement 1a), as far
> > > as I can tell. Interestingly, this is not actually implemented in
> > > the enic driver in patch 2/2. So if we all agree that this is out of the
> > > scope of iovnl, let's just remove it from the interface and find another
> > > way for it (ethtool, iplink, ..., as listed above).
> >
> > You're right, not needed for enic since mac addr is included with
> > port-profile push and vlan membership is implied by port-profile. So I put
> > set_mac_vlan in there basically to elicit feedback.
>
> Ok. Two points though:
>
> - when you say that the mac address is included in the port-profile push,
> does that imply that the VF does not have a mac address prior to this?
> This would again mix the NIC configuration phase with the switch
> association, which I think we really need to avoid if we want to be
> able to implement the association in user space!
>
> - The VLAN ID being implied in the port profile seems to be another
> difference between what enic is doing and the current draft VDP
> that will eventually become 802.1Qbg, and I fear that this difference
> will be visible in the iovnl protocol.
>
> > There really wouldn't be much different between iplink and iovnl since
> > they're both rtnetlink...seems we should keep IOV-related APIs in one place.
> > Maybe there are other IOV APIs to add to iovnl in the future like:
> >
> > vf <- add_vf(pf)
> > del_vf(pf, vf)
> >
> > Ethtool doesn't seem the right place for this.
>
> Right. My preference would probably be make these a subcategory of
> the if_link, and use the existing RTM_NEWLINK/RTM_DELLINK commands.
> This would make it resemble the existing interfaces and mean you can
> use
>
> ip link add link eth0 type macvlan # for a container
> ip link add link eth0 type macvtap # for qemu/vhost
> ip link add link eth0 type vf # for device assignment
BTW, what do you mean by device assignment?
> There are obviously significant differences between these three, but
> they also share enough of their properties to let us treat them
> in similar ways.
>
> If we integrate the iovnl client into iproute2, the sequence for setting
> up an enic VF and associating it to the port profile could be
>
> # create vf0, pass mac and vlan id to HW, no association yet
> ip link add link eth0 name vf0 type vf mac fe:dc:ba:12:34:56 vlan 78
Just to clarify...right now, the normal SR-IOV VF is already there.
And, or course, can have its mac addr/vlan set already.
> # associate vf with port profile, mac address must match the one assigned
> # to the interface before.
> ip iov assoc eth0 port-profile "general" host-uuid "dcf2a873-f5ee-41dd-a7ad-802a544e48c2" \
> mac fe:dc:ba:12:34:56
At that point you could just do s/mac fe:.*/link vf0/
thanks,
-chris
^ permalink raw reply
* Re: [PATCH v3] net: batch skb dequeueing from softnet input_pkt_queue
From: Eric Dumazet @ 2010-04-21 23:05 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, netdev, Tom Herbert, jamal
In-Reply-To: <1271238738-8386-1-git-send-email-xiaosuo@gmail.com>
Le mercredi 14 avril 2010 à 17:52 +0800, Changli Gao a écrit :
> batch skb dequeueing from softnet input_pkt_queue
>
> batch skb dequeueing from softnet input_pkt_queue to reduce potential lock
> contention and irq disabling/enabling.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ----
lock contention _is_ a problem, Jamal tests can show it.
irq disabling/enabling is not, and force to use stop_machine() killer.
I suggest something very simple, like a small buffer (16 slots), so that
process_backlog() can batch 16 buffers at once.
Following patch not tested, but its late here and I need to sleep ;)
This is a RFC, not for inclusion, and based on current net-next-2.6 tree
[RFC] net: introduce a batch mode in process_backlog()
We see a lock contention on input_pkt_queue.lock in RPS benches.
As suggested by Changli Gao, we can batch several skbs at once in
process_backlog(), so that we dirty input_pkt_queue less often.
I chose to batch at most 16 skbs per round, and place them in
softnet_data zone where flush_backlog() can find them and eventually
free this skbs at device dismantle.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/linux/netdevice.h | 2 +
net/core/dev.c | 48 +++++++++++++++++++++++++++---------
2 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3c5ed5f..16da8db 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1383,11 +1383,13 @@ static inline int unregister_gifconf(unsigned int family)
/*
* Incoming packets are placed on per-cpu queues
*/
+#define SD_BATCH_SZ 16
struct softnet_data {
struct Qdisc *output_queue;
struct list_head poll_list;
struct sk_buff *completion_queue;
+ struct sk_buff *batch[SD_BATCH_SZ]; /* process_backlog() & flush_backlog() */
#ifdef CONFIG_RPS
struct softnet_data *rps_ipi_list;
diff --git a/net/core/dev.c b/net/core/dev.c
index e904c47..2673ce0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2932,6 +2932,7 @@ static void flush_backlog(void *arg)
struct net_device *dev = arg;
struct softnet_data *sd = &__get_cpu_var(softnet_data);
struct sk_buff *skb, *tmp;
+ int i;
rps_lock(sd);
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp)
@@ -2941,6 +2942,13 @@ static void flush_backlog(void *arg)
input_queue_head_incr(sd);
}
rps_unlock(sd);
+ for (i = 0; i < ARRAY_SIZE(sd->batch); i++) {
+ skb = sd->batch[i];
+ if (skb && skb->dev == dev) {
+ kfree_skb(skb);
+ sd->batch[i] = NULL;
+ }
+ }
}
static int napi_gro_complete(struct sk_buff *skb)
@@ -3245,29 +3253,47 @@ EXPORT_SYMBOL(napi_gro_frags);
static int process_backlog(struct napi_struct *napi, int quota)
{
- int work = 0;
+ int i, n, lim, work = 0;
struct softnet_data *sd = &__get_cpu_var(softnet_data);
+ struct sk_buff *skb;
napi->weight = weight_p;
+ local_irq_disable();
+
do {
- struct sk_buff *skb;
+ lim = quota - work;
+ if (lim > ARRAY_SIZE(sd->batch))
+ lim = ARRAY_SIZE(sd->batch);
+ /* batch at most 16 buffers */
- local_irq_disable();
rps_lock(sd);
- skb = __skb_dequeue(&sd->input_pkt_queue);
- if (!skb) {
+ for (n = 0; n < lim; n++) {
+ sd->batch[n] = __skb_dequeue(&sd->input_pkt_queue);
+ if (!sd->batch[n])
+ break;
+ }
+ if (!sd->input_pkt_queue.qlen) {
__napi_complete(napi);
- rps_unlock(sd);
- local_irq_enable();
- break;
+ quota = 0;
}
- input_queue_head_incr(sd);
rps_unlock(sd);
- local_irq_enable();
- __netif_receive_skb(skb);
- } while (++work < quota);
+ /* Now process our batch */
+ for (i = 0; i < n; i++) {
+ skb = sd->batch[i];
+ /* flush_backlog() might have stolen this skb */
+ input_queue_head_incr(sd);
+ if (likely(skb)) {
+ sd->batch[i] = NULL;
+ local_irq_enable();
+ __netif_receive_skb(skb);
+ local_irq_disable();
+ }
+ }
+ work += n;
+ } while (work < quota);
+ local_irq_enable();
return work;
}
^ permalink raw reply related
* Re: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c
From: David Miller @ 2010-04-21 23:15 UTC (permalink / raw)
To: wg; +Cc: hjk, socketcan-core, netdev
In-Reply-To: <4BCED326.3060000@grandegger.com>
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Wed, 21 Apr 2010 12:27:50 +0200
>> Subject: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c
>>
>> In ems_usb_probe(), a pointer is dereferenced after making sure it is NULL...
>>
>> This patch replaces netdev->dev.parent with &intf->dev in dev_err() calls to
>> avoid this.
>>
>> Signed-off-by: "Hans J. Koch" <hjk@linutronix.de>
...
> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] tg3: Fix INTx fallback when MSI fails
From: David Miller @ 2010-04-21 23:17 UTC (permalink / raw)
To: adetsch; +Cc: netdev, mcarlson
In-Reply-To: <201004161015.12089.adetsch@br.ibm.com>
From: Andre Detsch <adetsch@br.ibm.com>
Date: Fri, 16 Apr 2010 10:15:11 -0300
> tg3: Fix INTx fallback when MSI fails
>
> MSI setup changes the value of some key attributes of struct tg3 *tp.
> These attributes must be taken into account and restored before
> we try to do a new request_irq for INTx fallback.
>
> In powerpc, the original code was leading to an EINVAL return within
> request_irq, because the driver was trying to use the disabled MSI
> virtual irq number instead of tp->pdev->irq.
>
> Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Broadcom folks, please review, thanks.
^ permalink raw reply
* Re: [PATCH] Infiniband: Randomize local port allocation.
From: Roland Dreier @ 2010-04-21 23:19 UTC (permalink / raw)
To: Tetsuo Handa
Cc: sean.hefty, amwang, opurdila, eric.dumazet, netdev, nhorman,
davem, ebiederm, linux-kernel, rolandd
In-Reply-To: <201004150229.o3F2T4dZ054768@www262.sakura.ne.jp>
Thanks, applied this part of the patch -- I preferred this one since the
goto into the middle of a loop seemed worse than a goto out of the loop...
--
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
^ permalink raw reply
* Re: [PATCH net-next-2.6] fasync: RCU locking
From: David Miller @ 2010-04-21 23:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: paulmck, netdev, linux-kernel
In-Reply-To: <1271230961.16881.630.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 14 Apr 2010 09:42:41 +0200
> [PATCH net-next-2.6] fasync: RCU locking
>
> kill_fasync() uses a central rwlock, candidate for RCU conversion.
>
> We can remove __kill_fasync() direct use in net, and rename it to
> kill_fasync_rcu()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
This looks good to me, applied, thanks Eric.
^ permalink raw reply
* Re: ipv6: Fix tcp_v6_send_response checksum
From: Herbert Xu @ 2010-04-21 23:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev, cratiu
In-Reply-To: <20100421.142841.191672280.davem@davemloft.net>
On Wed, Apr 21, 2010 at 02:28:41PM -0700, David Miller wrote:
>
> See? We were computing the checksum over the TCP header twice now :-)
> That's why my patch fixed things for dataless packets, whose
> ->csum would evaluate to zero.
Oh I see, as send_response packets are always dataless this is
corect.
Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH net-next-2.6 v3] fasync: RCU and fine grained locking
From: David Miller @ 2010-04-21 23:20 UTC (permalink / raw)
To: eric.dumazet; +Cc: paulmck, netdev, linux-kernel, laijs
In-Reply-To: <1271274935.16881.1746.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 14 Apr 2010 21:55:35 +0200
> [PATCH net-next-2.6 v3] fasync: RCU and fine grained locking
BTW, just to be clear I made sure to apply V3 of this
patch not the initial submission :-)
^ permalink raw reply
* Re: [PATCH] Infiniband: Randomize local port allocation.
From: Roland Dreier @ 2010-04-21 23:22 UTC (permalink / raw)
To: Tetsuo Handa
Cc: sean.hefty, amwang, opurdila, eric.dumazet, netdev, nhorman,
davem, ebiederm, linux-kernel, rolandd
In-Reply-To: <adabpdco0lb.fsf@roland-alpha.cisco.com>
> Thanks, applied this part of the patch -- I preferred this one since the
err, not "part of the patch" -- I meant "this version of the patch".
--
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
^ permalink raw reply
* Re: [PATCH v3] net: batch skb dequeueing from softnet input_pkt_queue
From: Tom Herbert @ 2010-04-21 23:23 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Changli Gao, David S. Miller, netdev, jamal
In-Reply-To: <1271891149.7895.3751.camel@edumazet-laptop>
> do {
> - struct sk_buff *skb;
> + lim = quota - work;
> + if (lim > ARRAY_SIZE(sd->batch))
> + lim = ARRAY_SIZE(sd->batch);
> + /* batch at most 16 buffers */
>
How about just using two input_pkt_queue's (define
input_pkt_queue[2])? One that is used to enqueue from RPS, and one
that is being processed by process_backlog. Then the only thing that
needs to be done under lock in process_backlog is to switch the
queues; something like sd->current_input_pkt_queue ^= 1
Tom
> - local_irq_disable();
> rps_lock(sd);
> - skb = __skb_dequeue(&sd->input_pkt_queue);
> - if (!skb) {
> + for (n = 0; n < lim; n++) {
> + sd->batch[n] = __skb_dequeue(&sd->input_pkt_queue);
> + if (!sd->batch[n])
> + break;
> + }
> + if (!sd->input_pkt_queue.qlen) {
> __napi_complete(napi);
> - rps_unlock(sd);
> - local_irq_enable();
> - break;
> + quota = 0;
> }
> - input_queue_head_incr(sd);
> rps_unlock(sd);
> - local_irq_enable();
>
> - __netif_receive_skb(skb);
> - } while (++work < quota);
> + /* Now process our batch */
> + for (i = 0; i < n; i++) {
> + skb = sd->batch[i];
> + /* flush_backlog() might have stolen this skb */
> + input_queue_head_incr(sd);
> + if (likely(skb)) {
> + sd->batch[i] = NULL;
> + local_irq_enable();
> + __netif_receive_skb(skb);
> + local_irq_disable();
> + }
> + }
> + work += n;
> + } while (work < quota);
>
> + local_irq_enable();
> return work;
> }
>
>
>
>
^ permalink raw reply
* Re: [PATCH] net: small cleanup of lib8390
From: David Miller @ 2010-04-21 23:23 UTC (permalink / raw)
To: knikanth; +Cc: p_gortmaker, netdev, viro, jeff
In-Reply-To: <201004151751.23899.knikanth@suse.de>
From: Nikanth Karthikesan <knikanth@suse.de>
Date: Thu, 15 Apr 2010 17:51:23 +0530
> Remove the always true #if 1. Also the unecessary re-test of ei_local->irqlock
> and the unreachable printk format string.
>
> Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [RFC][PATCH] xfrm6 refcnt problem in bundle creation
From: David Miller @ 2010-04-21 23:25 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: netdev
In-Reply-To: <4BC73FB7.9090106@dev.6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@dev.6wind.com>
Date: Thu, 15 Apr 2010 18:32:55 +0200
> Subject: [PATCH] xfrm6: ensure to use the same dev when building a bundle
>
> When building a bundle, we set dst.dev and rt6.rt6i_idev.
> We must ensure to set the same device for both fields.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
What we are doing now is definitely wrong and I think your
patch is the correct fix.
Applied to net-2.6, thanks!
^ permalink raw reply
* Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage
From: Eric W. Biederman @ 2010-04-21 23:26 UTC (permalink / raw)
To: paulmck
Cc: Eric Dumazet, Miles Lane, Eric Paris, Lai Jiangshan, Ingo Molnar,
Peter Zijlstra, LKML, vgoyal, nauman, netdev
In-Reply-To: <20100421221426.GS2563@linux.vnet.ibm.com>
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> writes:
> On Wed, Apr 21, 2010 at 11:57:09PM +0200, Eric Dumazet wrote:
>> Le mercredi 21 avril 2010 à 14:35 -0700, Paul E. McKenney a écrit :
>>
>> > > [ 33.425087] [ INFO: suspicious rcu_dereference_check() usage. ]
>> > > [ 33.425090] ---------------------------------------------------
>> > > [ 33.425094] net/core/dev.c:1993 invoked rcu_dereference_check()
>> > > without protection!
>> > > [ 33.425098]
>> > > [ 33.425098] other info that might help us debug this:
>> > > [ 33.425100]
>> > > [ 33.425103]
>> > > [ 33.425104] rcu_scheduler_active = 1, debug_locks = 1
>> > > [ 33.425108] 2 locks held by canberra-gtk-pl/4208:
>> > > [ 33.425111] #0: (sk_lock-AF_INET){+.+.+.}, at:
>> > > [<ffffffff81394ffd>] inet_stream_connect+0x3a/0x24d
>> > > [ 33.425125] #1: (rcu_read_lock_bh){.+....}, at:
>> > > [<ffffffff8134a809>] dev_queue_xmit+0x14e/0x4b8
>> > > [ 33.425137]
>> > > [ 33.425138] stack backtrace:
>> > > [ 33.425142] Pid: 4208, comm: canberra-gtk-pl Not tainted 2.6.34-rc5 #18
>> > > [ 33.425146] Call Trace:
>> > > [ 33.425154] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
>> > > [ 33.425161] [<ffffffff8134a914>] dev_queue_xmit+0x259/0x4b8
>> > > [ 33.425167] [<ffffffff8134a809>] ? dev_queue_xmit+0x14e/0x4b8
>> > > [ 33.425173] [<ffffffff81041c52>] ? _local_bh_enable_ip+0xcd/0xda
>> > > [ 33.425180] [<ffffffff8135375a>] neigh_resolve_output+0x234/0x285
>> > > [ 33.425188] [<ffffffff8136f71f>] ip_finish_output2+0x257/0x28c
>> > > [ 33.425193] [<ffffffff8136f7bc>] ip_finish_output+0x68/0x6a
>> > > [ 33.425198] [<ffffffff813704b3>] T.866+0x52/0x59
>> > > [ 33.425203] [<ffffffff813706fe>] ip_output+0xaa/0xb4
>> > > [ 33.425209] [<ffffffff8136ebb8>] ip_local_out+0x20/0x24
>> > > [ 33.425215] [<ffffffff8136f204>] ip_queue_xmit+0x309/0x368
>> > > [ 33.425223] [<ffffffff810e41e6>] ? __kmalloc_track_caller+0x111/0x155
>> > > [ 33.425230] [<ffffffff813831ef>] ? tcp_connect+0x223/0x3d3
>> > > [ 33.425236] [<ffffffff81381971>] tcp_transmit_skb+0x707/0x745
>> > > [ 33.425243] [<ffffffff81383342>] tcp_connect+0x376/0x3d3
>> > > [ 33.425250] [<ffffffff81268ac3>] ? secure_tcp_sequence_number+0x55/0x6f
>> > > [ 33.425256] [<ffffffff813872f0>] tcp_v4_connect+0x3df/0x455
>> > > [ 33.425263] [<ffffffff8133cbd9>] ? lock_sock_nested+0xf3/0x102
>> > > [ 33.425269] [<ffffffff81395067>] inet_stream_connect+0xa4/0x24d
>> > > [ 33.425276] [<ffffffff8133b418>] sys_connect+0x90/0xd0
>> > > [ 33.425283] [<ffffffff81002b9c>] ? sysret_check+0x27/0x62
>> > > [ 33.425289] [<ffffffff81068922>] ? trace_hardirqs_on_caller+0x114/0x13f
>> > > [ 33.425296] [<ffffffff813ced00>] ? trace_hardirqs_on_thunk+0x3a/0x3f
>> > > [ 33.425303] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
>> >
>> > This looks like an rcu_dereference() needs to instead be
>> > rcu_dereference_bh(), but the line numbering in my version of
>> > net/core/dev.c does not match yours. CCing netdev, hopefully
>> > someone there will know which rcu_dereference() is indicated.
>>
>> This is already sorted out in David trees
>
> Very good!!! ;-)
>
>> > > [ 85.939528] [ INFO: suspicious rcu_dereference_check() usage. ]
>> > > [ 85.939531] ---------------------------------------------------
>> > > [ 85.939535] include/net/inet_timewait_sock.h:227 invoked
>> > > rcu_dereference_check() without protection!
>> > > [ 85.939539]
>> > > [ 85.939540] other info that might help us debug this:
>> > > [ 85.939541]
>> > > [ 85.939544]
>> > > [ 85.939545] rcu_scheduler_active = 1, debug_locks = 1
>> > > [ 85.939549] 2 locks held by gwibber-service/4798:
>> > > [ 85.939552] #0: (&p->lock){+.+.+.}, at: [<ffffffff811034b2>]
>> > > seq_read+0x37/0x381
>> > > [ 85.939566] #1: (&(&hashinfo->ehash_locks[i])->rlock){+.-...},
>> > > at: [<ffffffff81386355>] established_get_next+0xc4/0x132
>> > > [ 85.939579]
>> > > [ 85.939580] stack backtrace:
>> > > [ 85.939585] Pid: 4798, comm: gwibber-service Not tainted 2.6.34-rc5 #18
>> > > [ 85.939588] Call Trace:
>> > > [ 85.939598] [<ffffffff81067fc2>] lockdep_rcu_dereference+0x9d/0xa5
>> > > [ 85.939604] [<ffffffff81385018>] twsk_net+0x4f/0x57
>> > > [ 85.939610] [<ffffffff813862e5>] established_get_next+0x54/0x132
>> > > [ 85.939615] [<ffffffff813864c7>] tcp_seq_next+0x5d/0x6a
>> > > [ 85.939621] [<ffffffff81103701>] seq_read+0x286/0x381
>> > > [ 85.939627] [<ffffffff8110347b>] ? seq_read+0x0/0x381
>> > > [ 85.939633] [<ffffffff81133240>] proc_reg_read+0x8d/0xac
>> > > [ 85.939640] [<ffffffff810ea110>] vfs_read+0xa6/0x103
>> > > [ 85.939645] [<ffffffff810ea223>] sys_read+0x45/0x69
>> > > [ 85.939652] [<ffffffff81002b6b>] system_call_fastpath+0x16/0x1b
>> >
>> > This one appears to be a case of missing rcu_read_lock(), but it is
>> > not clear to me at what level it needs to go.
>> >
>> > Eric, any enlightenment on this one and the next one?
>>
>> Coming from commit b099ce2602d806deb41caaa578731848995cdb2a
>> >From Eric Biederman (CCed)
>>
>> Apparently he added rcu to twsk_net(), but Changelog doesnt mention it.
>
> Thank you for chasing this down, Eric Dumazet!
>
> Eric Biederman, any enlightment?
That change to twsk_net probably should have come in
575f4cd5a5b639457747434dbe18d175fa767db4. The point was to make
twsk_net usable in an rcu context, instead of requiring a lock.
Should it become rcu_deference_raw now that we have lockdep support?
commit 575f4cd5a5b639457747434dbe18d175fa767db4
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Thu Dec 3 02:29:08 2009 +0000
net: Use rcu lookups in inet_twsk_purge.
While we are looking up entries to free there is no reason to take
the lock in inet_twsk_purge. We have to drop locks and restart
occassionally anyway so adding a few more in case we get on the
wrong list because of a timewait move is no big deal. At the
same time not taking the lock for long periods of time is much
more polite to the rest of the users of the hash table.
In my test configuration of killing 4k network namespaces
this change causes 4k back to back runs of inet_twsk_purge on an
empty hash table to go from roughly 20.7s to 3.3s, and the total
time to destroy 4k network namespaces goes from roughly 44s to
3.3s.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric
^ permalink raw reply
* Re: [PATCH] drivers/net/pcmcia/3c574_cs: fixing stats.tx_bytes counter
From: David Miller @ 2010-04-21 23:28 UTC (permalink / raw)
To: linux; +Cc: akurz, netdev
In-Reply-To: <20100416130101.GB7877@comet.dominikbrodowski.net>
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Fri, 16 Apr 2010 15:01:01 +0200
> David,
>
> as this is more netdev-related than PCMCIA-related, could you pick it up?
> Else, I'm willing to take it upstream, but would prefer your ACK on this.
Applied to net-2.6, thanks Dominik.
^ permalink raw reply
* Re: [PATCH] KS8851: NULL pointer dereference if list is empty
From: David Miller @ 2010-04-21 23:29 UTC (permalink / raw)
To: abraham.arce.moreno; +Cc: netdev
In-Reply-To: <k2ocb8016981004161748s1a91f926x3c29b3fbd45ad46c@mail.gmail.com>
From: Abraham Arce <abraham.arce.moreno@gmail.com>
Date: Fri, 16 Apr 2010 19:48:43 -0500
> Fix NULL pointer dereference in ks8851_tx_work by checking if dequeued
> list is already empty before writing the packet to TX FIFO
>
> Unable to handle kernel NULL pointer dereference at virtual address 00000050
> PC is at ks8851_tx_work+0xdc/0x1b0
> LR is at wait_for_common+0x148/0x164
> pc : [<c01c0df4>] lr : [<c025a980>] psr: 20000013
> Backtrace:
> ks8851_tx_work+0x0/0x1b0
> worker_thread+0x0/0x190
> kthread+0x0/0x90
>
> Signed-off-by: Abraham Arce <x0066660@ti.com>
Applied to net-2.6, thanks.
^ permalink raw reply
* Re: [PATCH] mac8390: change an error return code and some cleanup, take 3
From: David Miller @ 2010-04-21 23:30 UTC (permalink / raw)
To: fthain; +Cc: joe, p_gortmaker, netdev, linux-kernel, linux-m68k
In-Reply-To: <alpine.OSX.2.00.1004171258330.358@localhost>
From: Finn Thain <fthain@telegraphics.com.au>
Date: Sat, 17 Apr 2010 13:16:04 +1000 (EST)
>
> Change an error return code from -EAGAIN to -EBUSY since the former is
> misleading.
>
> Nubus slots are geographically addressed and their irqs are equally
> inflexible. -EAGAIN is misleading because retrying will not help fix
> whatever bug it was that made the irq unavailable.
request_irq() itself returns an appropriate error code, so the
correct change is to do:
err = request_irq( ... );
if (err) {
...
and return 'err'.
^ permalink raw reply
* Re: [PATCH] X25 fix dead unaccepted sockets
From: David Miller @ 2010-04-21 23:32 UTC (permalink / raw)
To: andrew.hendry; +Cc: netdev
In-Reply-To: <1271549852.2802.37.camel@ibex>
From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Sun, 18 Apr 2010 10:17:32 +1000
>
> 1, An X25 program binds and listens
> 2, calls arrive waiting to be accepted
> 3, Program exits without accepting
> 4, Sockets time out but don't get correctly cleaned up
> 5, cat /proc/net/x25/socket shows the dead sockets with bad inode fields.
>
> This line borrowed from AX25 sets the dying socket so the timers clean up later.
>
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] ks8842: Add platform data for setting mac address
From: David Miller @ 2010-04-21 23:33 UTC (permalink / raw)
To: richard.rojfors; +Cc: netdev, bhutchings
In-Reply-To: <1271628741.18194.7.camel@debian>
From: Richard Röjfors <richard.rojfors@pelagicore.com>
Date: Mon, 19 Apr 2010 00:12:21 +0200
> This patch adds platform data to the ks8842 driver.
>
> Via the platform data a MAC address, to be used by the controller,
> can be passed.
>
> To ensure this MAC address is used, the MAC address is written
> after each hardware reset.
>
> Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Applied to net-next-2.6, thanks Richard.
^ permalink raw reply
* Re: [PATCH] cxgb3: fix linkup issue
From: David Miller @ 2010-04-21 23:34 UTC (permalink / raw)
To: divy; +Cc: h-shimamoto, netdev, linux-kernel
In-Reply-To: <4BCF4E0E.1080805@chelsio.com>
From: Divy Le Ray <divy@chelsio.com>
Date: Wed, 21 Apr 2010 12:12:14 -0700
> Hiroshi Shimamoto wrote:
>> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>> I encountered an issue that not to link up on cxgb3 fabric.
>> I bisected and found that this regression was introduced by
>> 0f07c4ee8c800923ae7918c231532a9256233eed.
>>
>> Correct to pass phy_addr to cphy_init() at t3_xaui_direct_phy_prep().
>>
>> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>>
>
> Sorry for the review delay, I just came back from some time off.
> Acked-by: Divy Le Ray <divy@chelsio.com>
Applied to net-2.6, thanks.
^ permalink raw reply
* Re: [net-next,1/2] add iovnl netlink support
From: Scott Feldman @ 2010-04-21 23:54 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Chris Wright, davem, netdev
In-Reply-To: <201004212313.05060.arnd@arndb.de>
On 4/21/10 2:13 PM, "Arnd Bergmann" <arnd@arndb.de> wrote:
> On Wednesday 21 April 2010, Scott Feldman wrote:
>> On 4/21/10 12:39 PM, "Arnd Bergmann" <arnd@arndb.de> wrote:
>>
>>>>> 1. Setting up the slave device
>>>>> a) create an SR-IOV VF to assign to a guest
>>>>> b) create a macvtap device to pass to qemu or vhost
>>>>> c) attach a tap device to a bridge
>>>>> d) create a macvlan device and put it into a container
>>>>> e) create a virtual interface for a VMDq adapter
>>>>
>>>> OK, but iovnl isn't doing this.
>>>
>>> The set_mac_vlan that Scott's patch adds seems to implement 1a), as far
>>> as I can tell. Interestingly, this is not actually implemented in
>>> the enic driver in patch 2/2. So if we all agree that this is out of the
>>> scope of iovnl, let's just remove it from the interface and find another
>>> way for it (ethtool, iplink, ..., as listed above).
>>
>> You're right, not needed for enic since mac addr is included with
>> port-profile push and vlan membership is implied by port-profile. So I put
>> set_mac_vlan in there basically to elicit feedback.
>
> Ok. Two points though:
>
> - when you say that the mac address is included in the port-profile push,
> does that imply that the VF does not have a mac address prior to this?
Correct, VF has no mac addr prior to port-profile being applied. The
mac_addr is the mac_addr of the VM guest interface that's to use the VF. If
the port-profile defines L2 mac spoofing, for example, the switch wants to
know the mac address before i/o starts. I/o doesn't start until
port-profile is applied and the switch virtual port is setup.
> This would again mix the NIC configuration phase with the switch
> association, which I think we really need to avoid if we want to be
> able to implement the association in user space!
>
> - The VLAN ID being implied in the port profile seems to be another
> difference between what enic is doing and the current draft VDP
> that will eventually become 802.1Qbg, and I fear that this difference
> will be visible in the iovnl protocol.
It's not just a VLAN ID, but the entire VLAN membership for the switch
virtual port. The port-profile may define a single native VLAN for access
mode on the switch port, or a trunk mode with a list of allowed vlans, with
on native vlan.
The key is the port-profile. The port-profile resolves the configuration of
the switch virtual port. The configuration of the switch virtual port
includes many setting like I mentioned earlier: VLAN membership, QoS (rate
limits, priority class, L2 security, etc).
>> There really wouldn't be much different between iplink and iovnl since
>> they're both rtnetlink...seems we should keep IOV-related APIs in one place.
>> Maybe there are other IOV APIs to add to iovnl in the future like:
>>
>> vf <- add_vf(pf)
>> del_vf(pf, vf)
>>
>> Ethtool doesn't seem the right place for this.
>
> Right. My preference would probably be make these a subcategory of
> the if_link, and use the existing RTM_NEWLINK/RTM_DELLINK commands.
> This would make it resemble the existing interfaces and mean you can
> use
>
> ip link add link eth0 type macvlan # for a container
> ip link add link eth0 type macvtap # for qemu/vhost
> ip link add link eth0 type vf # for device assignment
>
> There are obviously significant differences between these three, but
> they also share enough of their properties to let us treat them
> in similar ways.
>
I don't have strong preference for iovnl vs. extending if_link. I thought I
had a reason against if_link, but I can't recall that now...it'll probably
come to me when I look at it again. Let me look again...
> If we integrate the iovnl client into iproute2, the sequence for setting
> up an enic VF and associating it to the port profile could be
>
> # create vf0, pass mac and vlan id to HW, no association yet
> ip link add link eth0 name vf0 type vf mac fe:dc:ba:12:34:56 vlan 78
>
> # associate vf with port profile, mac address must match the one assigned
> # to the interface before.
> ip iov assoc eth0 port-profile "general" host-uuid
> "dcf2a873-f5ee-41dd-a7ad-802a544e48c2" \
> mac fe:dc:ba:12:34:56
Ya, that sounds pretty close. I still want the flexibility to direct ops to
a PF link for a VF link.
-scott
^ permalink raw reply
* Re: [net-next,1/2] add iovnl netlink support
From: Scott Feldman @ 2010-04-22 0:01 UTC (permalink / raw)
To: Chris Wright, Arnd Bergmann; +Cc: davem, netdev
In-Reply-To: <20100421221806.GD28829@x200.localdomain>
On 4/21/10 3:18 PM, "Chris Wright" <chrisw@redhat.com> wrote:
>> The set_mac_vlan that Scott's patch adds seems to implement 1a), as far
>> as I can tell. Interestingly, this is not actually implemented in
>> the enic driver in patch 2/2. So if we all agree that this is out of the
>> scope of iovnl, let's just remove it from the interface and find another
>> way for it (ethtool, iplink, ..., as listed above).
>
> Scott, any objection? At least a way to keep moving forward on the port
> profile bit.
Yes, that's fine with me, port-profile bit is the most important part.
>> Note that we still need to pass the MAC address and VLAN ID (or a list
>> of these) to the external switch, my point is just that this should be
>> separate from enforcing it in the hypervisor.
>
> Yup, we should focus on reconciling the diff of enic vs vpd port profile
> needs.
-scott
^ permalink raw reply
* Re: Bug#577640: linux-image-2.6.33-2-amd64: Kernel warnings in netns thread
From: Ben Hutchings @ 2010-04-22 0:14 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Martín Ferrari, 577640, netdev, Eric W. Biederman,
Alexey Dobriyan, Mathieu Lacage
In-Reply-To: <m1ljcgzjh4.fsf@fess.ebiederm.org>
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
On Wed, 2010-04-21 at 12:36 -0700, Eric W. Biederman wrote:
> Martín Ferrari <martin.ferrari@gmail.com> writes:
>
> > I'm not starting a new thread/bug, as this is probably related...
> >
> > I just discovered that in 2.6.33, if I create a veth inside a
> > namespace and then move one of the halves into the main namespace,
> > when I kill the namespace, I get one of these warnings followed by an
> > oops. This does not happen if the veth is created from the main ns and
> > then moved, nor in 2.6.32. This happens both in Qemu and on real
> > hardware (both amd64)
> >
> > To reproduce:
> >
> > $ sudo ./startns bash
> > # ip l a type veth
> > # ip l s veth0 netns 1
> > # exit
>
> Nasty weird. I did a quick test here, and I'm not seeing that.
> Does the 2.6.33 experimental kernel have any patches applied?
Yes, but not many beyond the stable updates, and nothing in this area.
You can see the list at:
http://svn.debian.org/wsvn/kernel/dists/trunk/linux-2.6/debian/patches/series/base
Ben.
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
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