From owner-freebsd-wireless@freebsd.org Wed Nov 4 18:11:50 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 9B194A26D18 for ; Wed, 4 Nov 2015 18:11:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (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 64844196B; Wed, 4 Nov 2015 18:11:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igpw7 with SMTP id w7so111187937igp.0; Wed, 04 Nov 2015 10:11:50 -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:content-transfer-encoding; bh=zG+HV7b4EGComw4Jp4ui4kYy9ntPpfr3+mUkE5VROqw=; b=THisumX17exocqFOMyGB6m0zkeopwf4gcjo4+RgE2iB3vpgk1yymDOrgJlKfUEkjs1 y9usMdzEVDLteelS/4wH93H4Dk7GFKbowbhbSk5P3HjIUUe6WUlZO6OILN5FjLyKoYqY mmCJEqQnaXOxtBEZw0Q9IF0f7YdchHq0Wgr1LLAu4c2qAFARVHw/QSvRBqUBLzMFoJwD hmHEKsU/RSLfqSHmwFxr2CQfasKHlmd6XoZU5TDzo2x+gfZOFps6cD28KmWhXnU6IvB3 GWzV1bfvs85+7duHqt/nUG63xH21VBuJB1/BdrZY35r+1Q+JoJ5X8JBrQpHimY3DNBhz A38g== MIME-Version: 1.0 X-Received: by 10.50.62.104 with SMTP id x8mr4603129igr.22.1446660709887; Wed, 04 Nov 2015 10:11:49 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.46.66 with HTTP; Wed, 4 Nov 2015 10:11:49 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Nov 2015 10:11:49 -0800 X-Google-Sender-Auth: -J4DAQTaSIaELpOsr4rDc6CL18k Message-ID: Subject: Re: (untested) ath fix upon error From: Adrian Chadd To: Andriy Voskoboinyk Cc: "freebsd-wireless@freebsd.org" , Mark Felder Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Wed, 04 Nov 2015 18:11:50 -0000 On 3 November 2015 at 08:12, Andriy Voskoboinyk wrote: > Tue, 03 Nov 2015 17:31:18 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > >> hiya, >> >> what do people think about this to fix ath(4) transmit errors: >> >> adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/ath >> Index: sys/dev/ath/if_ath.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/dev/ath/if_ath.c (revision 290048) >> +++ sys/dev/ath/if_ath.c (working copy) >> @@ -3320,6 +3320,9 @@ >> * >> * Note: if this fails, then the mbufs are freed but >> * not the node reference. >> + * >> + * So, we now have to free the node reference ourselves here >> + * and return OK up to the stack. >> */ >> next =3D m->m_nextpkt; >> if (ath_tx_start(sc, ni, bf, m)) { >> @@ -3336,7 +3339,14 @@ >> */ >> ath_txfrag_cleanup(sc, &frags, ni); >> ATH_TXBUF_UNLOCK(sc); >> - retval =3D ENOBUFS; >> + >> + /* >> + * XXX: And free the node/return OK; ath_tx_start() may >> have >> + * modified the buffer. We currently have no way t= o >> + * signify that the mbuf was freed but there was an >> error. >> + */ >> + ieee80211_node_free(ni); >> + retval =3D 0; >> goto finish; >> } >> >> >> .. the idea is that we can't return failure once we've called >> ath_tx_start(), as the mbuf needs to be consumed. So we return OK and >> just count an error. >> > > Yes, I think this (temporary?) workaround should fix the issue. > Cool, thanks! -a