From owner-freebsd-wireless@FreeBSD.ORG Tue Feb 26 05:48:39 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6EDFB1F7 for ; Tue, 26 Feb 2013 05:48:39 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm23-vm3.bullet.mail.ne1.yahoo.com (nm23-vm3.bullet.mail.ne1.yahoo.com [98.138.91.153]) by mx1.freebsd.org (Postfix) with ESMTP id 37AECE71 for ; Tue, 26 Feb 2013 05:48:38 +0000 (UTC) Received: from [98.138.90.53] by nm23.bullet.mail.ne1.yahoo.com with NNFMP; 26 Feb 2013 05:41:54 -0000 Received: from [98.138.226.59] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 26 Feb 2013 05:41:54 -0000 Received: from [127.0.0.1] by smtp210.mail.ne1.yahoo.com with NNFMP; 26 Feb 2013 05:41:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1361857314; bh=9w6fPm/SxBottOBi3zzM6sp+/4qFfkEQ15ohLQfysKk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:MIME-Version:X-Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type; b=ngH8ddiAH35kdpmHsc4mAY0mu1RK+XplvhNKQq9ErtykItvJGGgsXfbZoLhVEGEq2/UDcIEHc6X5icYZ64EJYdSbBTnqKaVSd4Nr2CVTBoOYDzs7Jb7Aedxvgm37f/5DX0AHDVkjkCiClv3Vg9hkyX6fGcx2uykBHoVf7+s8G9M= X-Yahoo-Newman-Id: 847683.36236.bm@smtp210.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: TFJjbREVM1lZKCzCv33z9HmdlGtYqUfFkT7ljcSHfrpymfO TSR2ISL9PkK1_CyV53a6EaoCIB45FdWA2a0ZQYw.xeLgb.LtvAGT64YPUq25 G5kqOPzCHdHZ9nbR2dmomZ5OXuBsVcJIUdvp9OIpLWu4agDaohmC2V9zmkFC 0pcQEG6HZE2BbB6VL8bHeqZCRT1ipGuDrNzlUclavEXOG3.YrVKbpnlrCwIU Lb5Xacvv2l1BG8bTwsaDcuxVhw9wKytZtKjxW5HNsyNk9MQXGTJeQFUoHLJ9 agxDwv4q13ULMrYWa1CQ17QM4DTN6.3.ctxrfEog6gOWHl3MqqLToC.fTk70 2IwJ.Oygdvq.jkhROtjrHYsOujidm0lKboZigMDfZ_IZaAv_eVt7izhJPQB7 pr7HHfN1IKgBJ6FklKdOwI8e9OT4gDmpamhM.xEX5gWIEuE2fQBRzgy.1p_Q .8X46w9P8Cisj3t06zRHL X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ Received: from mail-da0-f52.google.com (moonlightakkiy@209.85.210.52 with plain) by smtp210.mail.ne1.yahoo.com with SMTP; 25 Feb 2013 21:41:54 -0800 PST Received: by mail-da0-f52.google.com with SMTP id x33so817295dad.39 for ; Mon, 25 Feb 2013 21:41:54 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.68.227.129 with SMTP id sa1mr21738196pbc.107.1361857314137; Mon, 25 Feb 2013 21:41:54 -0800 (PST) Received: by 10.68.52.170 with HTTP; Mon, 25 Feb 2013 21:41:54 -0800 (PST) In-Reply-To: References: Date: Mon, 25 Feb 2013 22:41:54 -0700 Message-ID: Subject: Re: [RFT] net80211 TX serialisation, take #4 From: PseudoCylon To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 05:48:39 -0000 On Mon, Feb 25, 2013 at 12:27 AM, Adrian Chadd 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