Date: Mon, 5 Aug 2013 16:01:43 -0500 (CDT) From: Bryan Venteicher <bryanv@daemoninthecloset.org> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: Adrian Chadd <adrian@freebsd.org>, FreeBSD current mailing list <current@freebsd.org>, Navdeep Parhar <np@freebsd.org>, net@freebsd.org, Giuseppe Lettieri <g.lettieri@iet.unipi.it>, Jack Vogel <jfvogel@gmail.com> Subject: Re: [net] protecting interfaces from races between control and data ? Message-ID: <235239368.957.1375736503264.JavaMail.root@daemoninthecloset.org> In-Reply-To: <CA%2BhQ2%2Bi7RHqy3ex9qeU_7-4Ed4zBRwumCrFO7OT_j8VKWZp%2B6g@mail.gmail.com> References: <20130805082307.GA35162@onelab2.iet.unipi.it> <51FFDD1E.1000206@FreeBSD.org> <CAJ-Vmo=Q9AqdBJ0%2B4AiX4%2BWreYuZx6VGGYw=MZ4XhMB1P2yMww@mail.gmail.com> <CA%2BhQ2%2BgZTGmrBKTOAeFnNma4DQXbAy_y8NZrovpWqm_5BJTWhQ@mail.gmail.com> <CAFOYbckJaZYQj2D4k41Nmjm9urue9_CDcdQ3yhRddWx0SzXE6g@mail.gmail.com> <CA%2BhQ2%2BhAcyi=uFcOLV1YNMfDAmdhJoTtqtgpb=R_-RKSmWX9FQ@mail.gmail.com> <CAJ-VmomtmPcN_ebV2AEiRz9sVyYRcvo9Kt0HvhazSCuHpGk3Ew@mail.gmail.com> <CA%2BhQ2%2Bi7RHqy3ex9qeU_7-4Ed4zBRwumCrFO7OT_j8VKWZp%2B6g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- > On Mon, Aug 5, 2013 at 8:19 PM, Adrian Chadd <adrian@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@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) > -----------------------------------------+------------------------------- >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?235239368.957.1375736503264.JavaMail.root>