Re: [net] protecting interfaces from races between control and data ?

From: Bryan Venteicher <bryanv_at_daemoninthecloset.org>
Date: Mon, 5 Aug 2013 16:01:43 -0500 (CDT)
----- Original Message -----
> On Mon, Aug 5, 2013 at 8:19 PM, Adrian Chadd <adrian_at_freebsd.org> wrote:
> 
> > No, brian said two things:
> >
> > * the flag, protected by the core lock
> > * per-queue flags
> >
> 
> i see no mentions on per-queue flags on his email.
> This is the relevant part
> 

Right, I just use the IFF_DRV_RUNNING flag. I think Adrian meant
'per-queue locks' here? 

> ------------
> 
> What I've done in my drivers is:
>   * Lock the core mutex
>   * Clear IFF_DRV_RUNNING
>   * Lock/unlock each queue's lock
> 
> The various Rx/Tx queue functions check for IFF_DRV_RUNNING after
> (re)acquiring their queue lock. See at vtnet_stop_rendezvous() at
> [1] for an example.
> 
> [1]
> http://svnweb.freebsd.org/base/user/bryanv/vtnetmq/sys/dev/virtio/network/if_vtnet.c?revision=252451&view=markup
> 
> -----------------
> 
> 
> >
> >
> >
> > -adrian
> >
> 
> 
> 
> --
> -----------------------------------------+-------------------------------
>  Prof. Luigi RIZZO, rizzo_at_iet.unipi.it  . Dip. di Ing. dell'Informazione
>  http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
>  TEL      +39-050-2211611               . via Diotisalvi 2
>  Mobile   +39-338-6809875               . 56122 PISA (Italy)
> -----------------------------------------+-------------------------------
> 
Received on Mon Aug 05 2013 - 19:01:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:40 UTC