From owner-freebsd-net@FreeBSD.ORG Mon Oct 29 03:53:11 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63DC4A45; Mon, 29 Oct 2012 03:53:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 269D18FC0C; Mon, 29 Oct 2012 03:53:11 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so4137872pbb.13 for ; Sun, 28 Oct 2012 20:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=kgzlGGvA9hUShv3MWfZgPHASiV2bZeqcuGNaPvjI8Sc=; b=Gg0cBSRV2WzQLy2ZCzpKW2z7QGMlMXyJTYbJkshe+W5RqDiN9gBdtMyNUT4xO857+M ecRuxL8csB0bo8vnGQ8xuJx4+fmsaJJ4H56QYrDzaSovh791XKLCgKrhXD+zxPfuh0PX blHIdHOQZF2CuUHMk3Fg2409T4G/2dpN/4Sa6HnWfAQgyeT3Ne4cwvNAJWoTlucOtN/4 npTY75BsObQydTbxC435k0YOxFwzfTPmxeyBlKhcWrz91Q8ntnwaYLXO0QYxSU7UjU4t LOubpxujwjEaww7eJAQqxggn6eLH3Qx/5gznO3iAbF4r6ul+E21plOgP30+rVcj93g60 PsMQ== MIME-Version: 1.0 Received: by 10.66.74.65 with SMTP id r1mr79954465pav.75.1351482790930; Sun, 28 Oct 2012 20:53:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Sun, 28 Oct 2012 20:53:10 -0700 (PDT) In-Reply-To: References: Date: Sun, 28 Oct 2012 20:53:10 -0700 X-Google-Sender-Auth: ZEzdqL8YeED0RsLvQe31kI_Bp4I Message-ID: Subject: Re: request for help: 'fixing' the 802.11 TX path From: Adrian Chadd To: PseudoCylon Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Net , freebsd-wireless@freebsd.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 03:53:11 -0000 On 28 October 2012 20:43, PseudoCylon wrote: > Cannot we just add custom hand off function to ieee80211_start()? Yes. That's the general idea. But what I don't want to do is have it just wake up the driver TX taskqueue - well, unless we have to. That means we'll have two context switches for each frame being transmitted and that as a concept just sucks. See my (very recent) email to -wireless - I broke TCP throughput quite substantially by moving ath(4) TX into the taskqueue. I thought the problem was _just_ going to be how overlapping, direct dispatch TX could be preempted by the RX tasklet and TX completion, but there's obviously more going on. I'm going to experiment some more with it before I go down this path. I don't want to do the linux thing of "just grab a txrx spinlock in mac80211 before calling the driver", serialising everything that way. That feels plain ugly. But then, a lot of our network drivers do much the same thing - they grab big, long-held locks and they either implement their own lockless queue in front of that lock (eg, what the intel/chelsio code does) or they just ignore it entirely and leave it up to the scheduler to wake up threads once the contending lock is unlocked. I have all kinds of concerns about the behaviour of if_bridge and other if_transmit() enabled friends when sending to one of these badly locked drivers, however that's going to have to wait. Well, maybe I'll poke the network people at meetbsd this weekend and see what they think. Adrian