Re: MP-safe ifnet with psz & psref

2016-06-05 Thread Ryota Ozaki
Hi, So I prepared patches: http://www.netbsd.org/~ozaki-r/m_set_rcvif.diff http://www.netbsd.org/~ozaki-r/m_get_rcvif.diff The first patch introduces m_set_rcvif and m_reset_rcvif that provide consistency API against m_get_rcvif, hide internal of rcvif operation, and reduce the diff of the

Re: MP-safe ifnet with psz & psref

2016-05-22 Thread Ryota Ozaki
On Fri, May 20, 2016 at 6:11 PM, Ryota Ozaki wrote: > On Fri, May 20, 2016 at 5:38 PM, Joerg Sonnenberger wrote: >> On Fri, May 20, 2016 at 12:15:10PM +0900, Ryota Ozaki wrote: >>> > Mbufs are slightly different. They can be queued on an interface for a >>> >

Re: MP-safe ifnet with psz & psref

2016-05-20 Thread Joerg Sonnenberger
On Fri, May 20, 2016 at 12:15:10PM +0900, Ryota Ozaki wrote: > > Mbufs are slightly different. They can be queued on an interface for a > > moderately long time. For this purpose, a "flush" hook would definitely > > be needed. I think having such a hook would be useful for other purposes > > as

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Taylor R Campbell
Date: Fri, 20 May 2016 11:51:24 +0900 From: Ryota Ozaki On Fri, May 20, 2016 at 3:01 AM, Taylor R Campbell wrote: > Can you explain why there are long-term mbufs and rtentries that may > continue to point to ifnets that

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Ryota Ozaki
On Fri, May 20, 2016 at 3:13 AM, Joerg Sonnenberger wrote: > On Thu, May 19, 2016 at 04:11:56PM +0900, Ryota Ozaki wrote: >> I'm working on a next task that replaces an ifnet pointer embedded >> in other objects, say mbuf and rtentry, with an interface index >> (ifnet#if_index) and

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Ryota Ozaki
On Fri, May 20, 2016 at 3:01 AM, Taylor R Campbell wrote: >Date: Thu, 19 May 2016 16:11:56 +0900 >From: Ryota Ozaki > >I'm working on a next task that replaces an ifnet pointer embedded >in other objects, say mbuf and

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Joerg Sonnenberger
On Thu, May 19, 2016 at 04:11:56PM +0900, Ryota Ozaki wrote: > I'm working on a next task that replaces an ifnet pointer embedded > in other objects, say mbuf and rtentry, with an interface index > (ifnet#if_index) and when we take an ifnet object from such objects, > look it up (with psz or

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Taylor R Campbell
Date: Thu, 19 May 2016 16:11:56 +0900 From: Ryota Ozaki I'm working on a next task that replaces an ifnet pointer embedded in other objects, say mbuf and rtentry, with an interface index (ifnet#if_index) and when we take an ifnet object from such objects,

Re: MP-safe ifnet with psz & psref

2016-05-19 Thread Ryota Ozaki
Hi, I'm working on a next task that replaces an ifnet pointer embedded in other objects, say mbuf and rtentry, with an interface index (ifnet#if_index) and when we take an ifnet object from such objects, look it up (with psz or psref) from the interface collection (ifindex2ifnet, just an array).

Re: MP-safe ifnet with psz & psref

2016-05-13 Thread Ryota Ozaki
On Tue, May 10, 2016 at 7:19 PM, Ryota Ozaki wrote: > Yet another patch is here: > http://www.netbsd.org/~ozaki-r/if_get.diff > > This trial patch introduces if_get that returns an ifnet > object with holding psref and if_put that releases psref > of the ifnet object. The

Re: MP-safe ifnet with psz & psref

2016-05-11 Thread Ryota Ozaki
On Thu, May 12, 2016 at 11:36 AM, Christos Zoulas wrote: > In article > , > Ryota Ozaki wrote: >>On Wed, May 11, 2016 at 4:18 AM, matthew green wrote: >>> Thor

Re: MP-safe ifnet with psz & psref

2016-05-11 Thread Christos Zoulas
In article , Ryota Ozaki wrote: >On Wed, May 11, 2016 at 4:18 AM, matthew green wrote: >> Thor Lancelot Simon writes: >>> I do not think you should do any extra work to support kvm

Re: MP-safe ifnet with psz & psref

2016-05-11 Thread Christos Zoulas
In article <11591.1462907...@splode.eterna.com.au>, matthew green wrote: >Thor Lancelot Simon writes: >> I do not think you should do any extra work to support kvm grovelling. > >existing tool functionality should not be broken, however. the >netstat -i groveller code should

Re: MP-safe ifnet with psz & psref

2016-05-11 Thread Ryota Ozaki
Sorry for consecutive patches but one more patch is here: http://www.netbsd.org/~ozaki-r/if_get_byindex.diff The patch implements if_get_byindex that is if_byindex with psref. Same as if_get it's used together with if_put. The patch also replaces some if_byindex with it while some if_byindex

Re: MP-safe ifnet with psz & psref

2016-05-11 Thread Ryota Ozaki
http://www.netbsd.org/~ozaki-r/psref-ifnet.diff One more update. Use IFNET_LOCK to protect whole if_getindex that updates global shared objects and retire index_gen_mtx that is used only for index_gen that is also updated in if_getindex. ozaki-r On Wed, May 11, 2016 at 10:03 AM, Ryota Ozaki

re: MP-safe ifnet with psz & psref

2016-05-10 Thread matthew green
Thor Lancelot Simon writes: > I do not think you should do any extra work to support kvm grovelling. existing tool functionality should not be broken, however. the netstat -i groveller code should be either updated to the new method or converted to a real sysctl, though the current work around

Re: MP-safe ifnet with psz & psref

2016-05-10 Thread Thor Lancelot Simon
I do not think you should do any extra work to support kvm grovelling. On Tue, May 10, 2016 at 12:07:12PM +0900, Ryota Ozaki wrote: > On Thu, Apr 28, 2016 at 4:04 PM, Ryota Ozaki wrote: > > Hi, > > > > This proposal is the first step toward making interfaces > > (struct

Re: MP-safe ifnet with psz & psref

2016-05-10 Thread Ryota Ozaki
Yet another patch is here: http://www.netbsd.org/~ozaki-r/if_get.diff This trial patch introduces if_get that returns an ifnet object with holding psref and if_put that releases psref of the ifnet object. The patch replaces ifnet_lock with if_get/if_put and a simple mutex. The change fixes an

Re: MP-safe ifnet with psz & psref

2016-05-09 Thread Ryota Ozaki
On Thu, Apr 28, 2016 at 4:04 PM, Ryota Ozaki wrote: > Hi, > > This proposal is the first step toward making interfaces > (struct ifnet) MP-safe; it applies psz and psref to ifnet > and ifnet_list to safely look up ifnets from ifnet_list > and safely remove an ifnet. > > Here

MP-safe ifnet with psz & psref

2016-04-28 Thread Ryota Ozaki
Hi, This proposal is the first step toward making interfaces (struct ifnet) MP-safe; it applies psz and psref to ifnet and ifnet_list to safely look up ifnets from ifnet_list and safely remove an ifnet. Here is a patch: http://www.netbsd.org/~ozaki-r/psref-ifnet.diff One concern is m_reclaim