Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
On 31.01.2019 18:21, Eric Dumazet wrote: > > > On 01/31/2019 07:15 AM, Eric Dumazet wrote: >> >> >> On 01/31/2019 05:49 AM, Kirill Tkhai wrote: >>> >>> 2)Not related to your patch -- it looks like we have problem in existing >>> code with this netdev_refcnt_read(). It does not imply a memory orde

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
On 31.01.2019 18:14, Alexandre BESNARD wrote: > Hi Kirill, and thanks for your time, > > On 31 Jan 19 14:49, Kirill Tkhai ktk...@virtuozzo.com wrote : > >> Hi, Alexandre, > >> On 31.01.2019 16:20, alexandre.besn...@softathome.com wrote: >>> From: Alexandre Besnard > >>> Device remaining refere

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Eric Dumazet
On 01/31/2019 07:15 AM, Eric Dumazet wrote: > > > On 01/31/2019 05:49 AM, Kirill Tkhai wrote: >> >> 2)Not related to your patch -- it looks like we have problem in existing >> code with this netdev_refcnt_read(). It does not imply a memory ordering >> or some guarantees about reading percpu va

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Eric Dumazet
On 01/31/2019 05:49 AM, Kirill Tkhai wrote: > > 2)Not related to your patch -- it looks like we have problem in existing > code with this netdev_refcnt_read(). It does not imply a memory ordering > or some guarantees about reading percpu values. For example, in generic > code struct percpu_ref

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Alexandre BESNARD
Hi Kirill, and thanks for your time, On 31 Jan 19 14:49, Kirill Tkhai ktk...@virtuozzo.com wrote : > Hi, Alexandre, > On 31.01.2019 16:20, alexandre.besn...@softathome.com wrote: > > From: Alexandre Besnard > > Device remaining references counter is get as a signed integer. > > When unregiste

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
Hi, Alexandre, On 31.01.2019 16:20, alexandre.besn...@softathome.com wrote: > From: Alexandre Besnard > > Device remaining references counter is get as a signed integer. > > When unregistering network devices, the loop waiting for this counter > to decrement tests the 0 strict equality. Thus if

[PATCH] net: check negative value for signed refcnt

2019-01-31 Thread alexandre . besnard
From: Alexandre Besnard Device remaining references counter is get as a signed integer. When unregistering network devices, the loop waiting for this counter to decrement tests the 0 strict equality. Thus if an error occurs and two references are given back by a protocol, we are stuck in the loo