From owner-freebsd-wireless@freebsd.org Tue Nov 3 06:17:18 2015 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A4B5A25CE9 for ; Tue, 3 Nov 2015 06:17:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C25611038; Tue, 3 Nov 2015 06:17:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodd200 with SMTP id d200so9529985iod.0; Mon, 02 Nov 2015 22:17:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1ZmvNF/n8mrBZXVJDdq/z8mAHiD+441a8la6JcGOz9I=; b=b84u5+4Kh9a6qwC+RNfzT9NkHKQL0o+xOFpHZOXpVr8Ip/aMoUH8xCcgaX4hiZ+oOp xGzPsmudQj8m1P4a27R1Y/LBC5U51BNdM7Qe/18+lPQnYUO0Nk0o/RpuHiUUfqnyvUgQ G8xRrkK1F8xpXQbJGa4NzScukxn9JCIJQhw8B+fbz3o9NWLCJ+ckrwMkVZ7d0MEGJ4Dp jXR3D96T4TOHp0W8v6skeHPmweJg6TrtHqwAHpVy14JlFqEWAbXsnkG8aov7am+ntlF1 56tf8Ko94RgG8KSDyQ8yB1rtI+c1oC6nzMQuTSn8A8U4yoLvbbzV0hbg1zZXfv3aUR/B ouxg== MIME-Version: 1.0 X-Received: by 10.107.152.2 with SMTP id a2mr25170798ioe.123.1446531437328; Mon, 02 Nov 2015 22:17:17 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.46.66 with HTTP; Mon, 2 Nov 2015 22:17:17 -0800 (PST) In-Reply-To: References: <1446174922.809135.424262409.16BCE412@webmail.messagingengine.com> <1446474203.3014685.426732569.13D78488@webmail.messagingengine.com> Date: Mon, 2 Nov 2015 22:17:17 -0800 X-Google-Sender-Auth: MzWrTpJO0mZaeSgzWIhcOJ5AHjA Message-ID: Subject: Re: bridge/wifi panic From: Adrian Chadd To: Andriy Voskoboinyk Cc: "freebsd-wireless@freebsd.org" , Mark Felder Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.20 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, 03 Nov 2015 06:17:18 -0000 Ok, I've dug into it a bit more. The root bits here were more exposed from the ifnet changes that were made, but the TL;DR is that if the driver starts to transmit the frame and fails, we can't return an error. We have to free the buffer ourselves. So for ath, and maybe iwn too, we can't return an error if we decide to start encapsulating the frame. That's the point where the mbuf may change. For something like "interface is down", "queue depth is too large", etc then we can do it. So for ath, I think I have to pick a point in the output path where we won't return the mbuf. It's likely once we call ath_tx_start() then we should consume the mbuf and return no-error. Now, the bug bug here is that ath_tx_start() actually does free the mbuf, and we .. then return failure codes. We should return OK, and consume the node reference. I'll sleep on it and see :) -adrian