Date: Mon, 5 Aug 2013 22:16:20 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Adrian Chadd <adrian@freebsd.org> Cc: FreeBSD current mailing list <current@freebsd.org>, Bryan Venteicher <bryanv@daemoninthecloset.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: <CA%2BhQ2%2Bi7RHqy3ex9qeU_7-4Ed4zBRwumCrFO7OT_j8VKWZp%2B6g@mail.gmail.com> In-Reply-To: <CAJ-VmomtmPcN_ebV2AEiRz9sVyYRcvo9Kt0HvhazSCuHpGk3Ew@mail.gmail.com> References: <20130805082307.GA35162@onelab2.iet.unipi.it> <2034715395.855.1375714772487.JavaMail.root@daemoninthecloset.org> <CAJ-VmokT6YKPR7CXsoCavEmWv3W8urZu4eBVgKWaj9iMaVJFZg@mail.gmail.com> <CA%2BhQ2%2BhuoCCweq7fjoYmH3nyhmhb5DzukEdPSMtaJEWa8Ft0JQ@mail.gmail.com> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
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 ------------ 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?CA%2BhQ2%2Bi7RHqy3ex9qeU_7-4Ed4zBRwumCrFO7OT_j8VKWZp%2B6g>