Date: Mon, 25 Feb 2013 22:41:54 -0700 From: PseudoCylon <moonlightakkiy@yahoo.ca> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-wireless@freebsd.org Subject: Re: [RFT] net80211 TX serialisation, take #4 Message-ID: <CAFZ_MY%2B=O=-FtnYFqCfETmRk4UVvT-e0WChfNK9SnGtMbRu%2BWQ@mail.gmail.com> In-Reply-To: <CAJ-VmonwpUWdQdJARS-D5UfEr=F7CFLSyWeRsh-iXSa26m7uYQ@mail.gmail.com> References: <CAFZ_MYJ13f6cvL4rP2XrO2rP=odHJigis8EBcAF4r65-ATOxGw@mail.gmail.com> <CAJ-Vmon5p=3gbdnQ1dtCXNGO-=k-_-ZyTS6wuBAMArC-jmdfXw@mail.gmail.com> <CAFZ_MYK-RiCMZ6XUgkhyAWmyXAPDQXnX14YnmWEqDqhjrzpVjA@mail.gmail.com> <CAJ-VmonwpUWdQdJARS-D5UfEr=F7CFLSyWeRsh-iXSa26m7uYQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 25, 2013 at 12:27 AM, Adrian Chadd <adrian@freebsd.org> wrote: > The trouble with using a queue is that things will dequeue frames out > of order, bceause multiple dequeue contexts (ie, each call to > driver_start / driver_transmit) will execute in-parallel. Actually, to prevent that, there is an extra queue. To begin driver_queue:packet1--packet2--3--4--... working_queue:empty hadware_queue:empty After multiple thread dequeue lock dequeue enqueue unlock lock dequeue enqueue unlock They look like, driver_queue:2--3--4--... working_queue:1--2 (the lock preserves the order) hardware_queue: empty If a thread has packet #1 finished first, there is no problem. If a thread has packet #2 finished first, it will try to dequeue the packet #1 (head of the queue) from the working_queue. But the packet isn't marked as "completed", so it will just return. Queue still look like driver_queue:2--3--4--... (of course, other threads are processing remaining packets, but to simplify, no change in driver_queue.) working_queue: 1--2 hardware: empty Later, once the thread with #1 finished processing, it will lock while (completed) {dequeue enqueue} unlock At the end, queue look like, driver_queue:2--3--4--... working_queue: empty hardware_queue: 1--2 (the lock preserves the order) Just wanted to clarify. I will soon test the latest txlock patch. AK
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFZ_MY%2B=O=-FtnYFqCfETmRk4UVvT-e0WChfNK9SnGtMbRu%2BWQ>