Re: IF_DRV_PREPEND unlocked?

2020-07-18 Thread John-Mark Gurney
Marko Zec wrote this message on Fri, Jul 17, 2020 at 23:54 +0200: > On Fri, 17 Jul 2020 11:56:09 -0700 > John-Mark Gurney wrote: > > Marko Zec wrote this message on Fri, Jul 17, 2020 at 12:03 +0200: > ... > > > #define IFQ_DRV_IS_EMPTY(ifq) \ > > > (((ifq)->ifq_drv_len == 0) && ((ifq)->ifq_len

Re: IF_DRV_PREPEND unlocked?

2020-07-17 Thread Marko Zec
On Fri, 17 Jul 2020 11:56:09 -0700 John-Mark Gurney wrote: > Marko Zec wrote this message on Fri, Jul 17, 2020 at 12:03 +0200: ... > > #define IFQ_DRV_IS_EMPTY(ifq) \ > > (((ifq)->ifq_drv_len == 0) && ((ifq)->ifq_len == 0)) > > > > So, if per altq(9) the contract is that with IFQ_DRV_* the if

Re: IF_DRV_PREPEND unlocked?

2020-07-17 Thread John-Mark Gurney
Marko Zec wrote this message on Fri, Jul 17, 2020 at 12:03 +0200: > On Thu, 16 Jul 2020 11:56:29 -0700 > John-Mark Gurney wrote: > > > Marko Zec wrote this message on Thu, Jul 16, 2020 at 07:49 +0200: > > > On Thu, 16 Jul 2020 07:26:22 +0200 > > > Marko Zec wrote: > > > > > > > On Wed, 15 Jul

Re: IF_DRV_PREPEND unlocked?

2020-07-17 Thread Marko Zec
On Thu, 16 Jul 2020 11:56:29 -0700 John-Mark Gurney wrote: > Marko Zec wrote this message on Thu, Jul 16, 2020 at 07:49 +0200: > > On Thu, 16 Jul 2020 07:26:22 +0200 > > Marko Zec wrote: > > > > > On Wed, 15 Jul 2020 16:26:25 -0700 > > > John-Mark Gurney wrote: > > > > > > > I happen to b

Re: IF_DRV_PREPEND unlocked?

2020-07-16 Thread John-Mark Gurney
Marko Zec wrote this message on Thu, Jul 16, 2020 at 07:49 +0200: > On Thu, 16 Jul 2020 07:26:22 +0200 > Marko Zec wrote: > > > On Wed, 15 Jul 2020 16:26:25 -0700 > > John-Mark Gurney wrote: > > > > > I happen to be looking at the implementation of IFQ_DRV_PREPEND, and > > > unlike IFQ_DRV_DEQU

Re: IF_DRV_PREPEND unlocked?

2020-07-15 Thread Marko Zec
On Thu, 16 Jul 2020 07:26:22 +0200 Marko Zec wrote: > On Wed, 15 Jul 2020 16:26:25 -0700 > John-Mark Gurney wrote: > > > I happen to be looking at the implementation of IFQ_DRV_PREPEND, and > > unlike IFQ_DRV_DEQUEUE, it doesn't obtain the lock when manipulating > > the ifq. I took a brief loo

Re: IF_DRV_PREPEND unlocked?

2020-07-15 Thread Marko Zec
On Wed, 15 Jul 2020 16:26:25 -0700 John-Mark Gurney wrote: > I happen to be looking at the implementation of IFQ_DRV_PREPEND, and > unlike IFQ_DRV_DEQUEUE, it doesn't obtain the lock when manipulating > the ifq. I took a brief look at a few drivers, and it looks like some > of them expect that _

IF_DRV_PREPEND unlocked?

2020-07-15 Thread John-Mark Gurney
I happen to be looking at the implementation of IFQ_DRV_PREPEND, and unlike IFQ_DRV_DEQUEUE, it doesn't obtain the lock when manipulating the ifq. I took a brief look at a few drivers, and it looks like some of them expect that _PREPEND lock the Q like _DEQUEUE does. This is likely not an issue o